generated from Nigh/svelte-static-pwa-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from szres/mobile-ui-test
test: scale down glyph draw component
- Loading branch information
Showing
2 changed files
with
38 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
<script> | ||
import Glyph from './Glyph.svelte'; | ||
import { onMount } from 'svelte'; | ||
let guess = { points: '', name: '-', score: 0 }; | ||
let innerHeight; | ||
let innerWidth; | ||
let drawSize = { | ||
width: 400, | ||
height: 400 | ||
}; | ||
onMount(() => { | ||
// TODO: | ||
// let size = Math.round(Math.min(innerWidth*0.95, innerHeight/2.2)) | ||
// drawSize = { width: size, height: size } | ||
}); | ||
</script> | ||
|
||
<svelte:window bind:innerHeight bind:innerWidth /> | ||
<div class="flex justify-center pb-2"> | ||
<div class="flex flex-col"> | ||
<Glyph glyph={guess.points} /> | ||
<span class="text-center">{guess.name}</span> | ||
</div> | ||
</div> | ||
<div class="flex justify-center"> | ||
<Glyph | ||
width="500" | ||
height="500" | ||
drawable="true" | ||
on:newGuess={(e) => (guess = e.detail.guess)} | ||
on:newResult | ||
/> | ||
<Glyph {...drawSize} drawable="true" on:newGuess={(e) => (guess = e.detail.guess)} on:newResult /> | ||
</div> |