fixes
This commit is contained in:
parent
26f77a992d
commit
5e6df3da7b
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics } from '@capacitor/haptics';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
focused = $bindable(false),
|
focused = $bindable(false),
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Sonner
|
<Sonner
|
||||||
theme={"light"}
|
theme={"dark"}
|
||||||
class="toaster group"
|
class="toaster group"
|
||||||
toastOptions={{
|
toastOptions={{
|
||||||
classes: {
|
classes: {
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
let { children } = $props();
|
let { children } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Toaster />
|
<Toaster class="break-all" position="top-right" />
|
||||||
|
|
||||||
<div class="flex flex-col h-screen">
|
<div class="flex flex-col h-screen">
|
||||||
<div id="header"></div>
|
<div id="header"></div>
|
||||||
|
|
||||||
<div class="overflow-y-auto">
|
<div class="grow flex flex-col overflow-y-auto">
|
||||||
{@render children()}
|
{@render children()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -20,11 +20,13 @@
|
|||||||
<style>
|
<style>
|
||||||
#header {
|
#header {
|
||||||
height: var(--safe-area-inset-top);
|
height: var(--safe-area-inset-top);
|
||||||
|
padding-bottom: 5px;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
height: var(--safe-area-inset-bottom);
|
height: var(--safe-area-inset-bottom);
|
||||||
|
padding-top: 10px;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Button from '$lib/components/ui/button/button.svelte';
|
import Button from '$lib/components/ui/button/button.svelte';
|
||||||
import ScanCapture from '$lib/ScanCapture.svelte';
|
import ScanCapture from '$lib/ScanCapture.svelte';
|
||||||
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
|
import { toast } from 'svelte-sonner';
|
||||||
import { SvelteSet } from 'svelte/reactivity';
|
import { SvelteSet } from 'svelte/reactivity';
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
|
|
||||||
@ -10,31 +12,40 @@
|
|||||||
function onscan(value: string) {
|
function onscan(value: string) {
|
||||||
if (!list.has(value)) {
|
if (!list.has(value)) {
|
||||||
list.add(value);
|
list.add(value);
|
||||||
|
Haptics.impact({ style: ImpactStyle.Light });
|
||||||
|
toast(`${value}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ScanCapture {onscan} />
|
<ScanCapture {onscan} />
|
||||||
|
|
||||||
<div class="flex h-screen">
|
<div class="flex grow">
|
||||||
<div class="m-auto flex flex-col justify-center items-center gap-8 p-4">
|
<div class="m-auto flex flex-col justify-center items-center gap-8 p-4">
|
||||||
{#key count}
|
{#key count}
|
||||||
<h1 in:fade class="decoration-sky text-9xl font-bold text-center underline-offset-4">
|
<h1
|
||||||
|
in:fade={{ duration: 200 }}
|
||||||
|
class="decoration-sky text-9xl font-bold text-center underline-offset-4"
|
||||||
|
>
|
||||||
{count}
|
{count}
|
||||||
</h1>
|
</h1>
|
||||||
{/key}
|
{/key}
|
||||||
|
|
||||||
<div class="flex flex-wrap gap-2">
|
<div class="flex gap-2">
|
||||||
{#each list as value (value)}
|
<Button
|
||||||
<span>{value}</span>
|
class="w-28 cursor-pointer"
|
||||||
{/each}
|
variant="outline"
|
||||||
|
onclick={() => {
|
||||||
|
list.clear();
|
||||||
|
}}>Reset</Button
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
class="w-28 cursor-pointer"
|
||||||
|
onclick={() => {
|
||||||
|
list.clear();
|
||||||
|
toast.success("Scans added")
|
||||||
|
}}>Submit</Button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button
|
|
||||||
class="w-28 cursor-pointer"
|
|
||||||
onclick={() => {
|
|
||||||
list.clear();
|
|
||||||
}}>Reset</Button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user