blob: 1c14cb6d79b01a207983a78181652175364d4ff7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<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, (text) => goto(`/send/${text}`));
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]" />
</div>
</div>
<div class="flex w-full">
<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>
|