This commit is contained in:
trev 2025-03-19 06:22:35 -04:00
parent aec0db221f
commit 26f77a992d
3 changed files with 34 additions and 19 deletions

6
android/.idea/AndroidProjectSystem.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>

View File

@ -41,8 +41,9 @@
charArray.push(event.key); charArray.push(event.key);
} }
if (scanning) {
// Send the key to onscan // Send the key to onscan
if ((event.key == 'Tab' || event.key == 'Enter')) { if (event.key == 'Tab' || event.key == 'Enter') {
// Prevent tab or enter from doing anything // Prevent tab or enter from doing anything
event.preventDefault(); event.preventDefault();
@ -51,6 +52,7 @@
charArray = []; charArray = [];
return; return;
} }
}
lastPressed = Date.now(); lastPressed = Date.now();
} }

View File

@ -1,7 +1,6 @@
<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 { SvelteSet } from 'svelte/reactivity'; import { SvelteSet } from 'svelte/reactivity';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
@ -11,7 +10,6 @@
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 });
} }
} }
</script> </script>
@ -19,15 +17,24 @@
<ScanCapture {onscan} /> <ScanCapture {onscan} />
<div class="flex h-screen"> <div class="flex h-screen">
<div class="m-auto flex flex-col gap-8 p-4"> <div class="m-auto flex flex-col justify-center items-center gap-8 p-4">
{#key count} {#key count}
<h1 <h1 in:fade class="decoration-sky text-9xl font-bold text-center underline-offset-4">
in:fade
class="decoration-sky text-9xl font-bold text-center underline-offset-4"
>
{count} {count}
</h1> </h1>
{/key} {/key}
<Button class="w-28 cursor-pointer">Submit</Button>
<div class="flex flex-wrap gap-2">
{#each list as value (value)}
<span>{value}</span>
{/each}
</div>
<Button
class="w-28 cursor-pointer"
onclick={() => {
list.clear();
}}>Reset</Button
>
</div> </div>
</div> </div>