diff options
| author | Adam Soltys <[email protected]> | 2022-11-02 19:47:29 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-02 19:48:18 -0700 |
| commit | f0d88333750a2865d3016e92620a87269160effa (patch) | |
| tree | 1cc276efeb5287e1fc176ec60d46aed091ab08ca /src/routes/(app)/scan | |
| parent | b66477f0912349ef91adaff8c57ac787b5a56447 (diff) | |
| download | coinos-ui-f0d88333750a2865d3016e92620a87269160effa.tar.gz coinos-ui-f0d88333750a2865d3016e92620a87269160effa.zip | |
move to app layout
Diffstat (limited to 'src/routes/(app)/scan')
| -rw-r--r-- | src/routes/(app)/scan/+page.svelte | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/routes/(app)/scan/+page.svelte b/src/routes/(app)/scan/+page.svelte new file mode 100644 index 00000000..10c288dd --- /dev/null +++ b/src/routes/(app)/scan/+page.svelte @@ -0,0 +1,44 @@ +<script> + import { Icon } from '$comp'; + import QrScanner from 'qr-scanner'; + import { onMount, onDestroy } from 'svelte'; + import { back } from '$lib/utils'; + import { goto } from '$app/navigation'; + + let scanner, vid; + onMount(() => { + scanner = new QrScanner(vid, ({ data }) => goto(`/send/${data}`), { + highlightScanRegion: true, + highlightCodeOutline: true + }); + scanner.start(); + }); + + onDestroy(() => scanner?.stop()); +</script> + +<button class="ml-5 md:ml-20 mt-5 md:mt-10 hover:opacity-80" on:click={back}> + <Icon icon="arrow-left" style="w-10" /> +</button> + +<div class="flex w-full mb-4 px-4"> + <div class="bg-black mx-auto rounded-3xl"> + <video + bind:this={vid} + class="border-4 rounded-3xl border-black md:max-w-[600px] !max-h-[300px]" + /> + </div> +</div> + +<div class="flex w-full mb-4"> + <button class="mx-auto border rounded-full px-6 py-2 font-bold hover:opacity-80" on:click={back}> + Cancel + </button> +</div> + +<style> + video { + transition: transform 0.3s ease-out; + transform: scale(1); + } +</style> |
