Skip to content

Commit

Permalink
Fix display of canvas on Mobile Safari
Browse files Browse the repository at this point in the history
Updates #49
  • Loading branch information
gilesdring committed Apr 1, 2021
1 parent f4f527c commit b3d9b83
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
2 changes: 2 additions & 0 deletions public/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ button {
}
select{
appearance: none;
-webkit-appearance: none;
border-radius: 0;
background-color: transparent;
border: none;
padding: 0 1em 0 0;
Expand Down
24 changes: 8 additions & 16 deletions src/components/AreaContent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{#if focussed}
<Editor { blobRef } on:resetarea />
{:else}
<p class='description'>
<p>
{ description }
</p>
{/if}
Expand All @@ -33,29 +33,21 @@
height: 100%;
color: white;
font-size: 0.8em;
position: fixed;
left: 0;
right: 0;
padding: 0.7em;
cursor: pointer;
display: flex;
flex-direction: column;
}
section.focussed {
font-size: 1em;
margin: 1em;
padding: 1.7em;
cursor: unset;
}
h2, .description {
padding: 0.7rem;
display: block;
}
h2 {
font-weight: bold;
font-size: 1.4em;
}
.description {
position: absolute;
display: block;
width: 100%;
box-sizing: border-box;
bottom: 0;
left: 0;
flex-grow: 1;
padding-bottom: 0.7em;
}
</style>
5 changes: 2 additions & 3 deletions src/components/Canvas.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@
/>
<g transition:fade>
<foreignObject
transform="translate({(height - content.focussed.size) / 2} {(height -
content.focussed.size) /
2})"
x={(height - content.focussed.size) / 2 }
y={(height - content.focussed.size) / 2 }
width={content.focussed.size}
height={content.focussed.size}
>
Expand Down
5 changes: 2 additions & 3 deletions src/components/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@
section {
box-sizing: border-box;
width: 100%;
max-height: 90%;
padding: 0.7rem;
overflow-y: auto;
font-size: 1.1em;
max-height: 95%;
overflow-y: auto;
}
section :global(.ninety-five) {
max-width: 95%;
Expand Down

0 comments on commit b3d9b83

Please sign in to comment.