diff options
| author | Adam Soltys <[email protected]> | 2022-08-01 12:27:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-01 12:27:49 -0700 |
| commit | 53b35c5b13797ea59bec850447fd347214fef025 (patch) | |
| tree | 8c0ea72e12ad4eb35ec6d58629f9330a298747e0 /src | |
| parent | 44664658d460ba2bee41aa87dbbb3f81ef232402 (diff) | |
| download | coinos-ui-53b35c5b13797ea59bec850447fd347214fef025.tar.gz coinos-ui-53b35c5b13797ea59bec850447fd347214fef025.zip | |
use canvas for qr code
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/RegisterOrLogin.svelte | 3 | ||||
| -rw-r--r-- | src/routes/invoice/[id].svelte | 15 | ||||
| -rw-r--r-- | src/routes/register.js | 2 |
3 files changed, 5 insertions, 15 deletions
diff --git a/src/components/RegisterOrLogin.svelte b/src/components/RegisterOrLogin.svelte index 2463f47f..ae1948f5 100644 --- a/src/components/RegisterOrLogin.svelte +++ b/src/components/RegisterOrLogin.svelte @@ -18,7 +18,6 @@ }[page]; let submit = async () => { - console.log("HI") let r = await post(url, { username, password }); if (!r.token) r = await post('/login', { username, password }); $token = r.token; @@ -42,7 +41,7 @@ <form class="space-y-5" on:submit|preventDefault={submit}> <div> <label for="username" class="font-semibold">Username</label> - <!-- svelte-ignore a11y-autofocus --> + <!-- svelte-ignore a11y-autofocus --> <input type="text" required diff --git a/src/routes/invoice/[id].svelte b/src/routes/invoice/[id].svelte index d5a39daa..1f1a7aa3 100644 --- a/src/routes/invoice/[id].svelte +++ b/src/routes/invoice/[id].svelte @@ -67,10 +67,10 @@ let init = async (ready) => { if (!ready) return; let { default: QRCodeStyling } = await import('qr-code-styling'); - console.log('text', text); + const qrCode = new QRCodeStyling({ width: window.screen.width < 640 ? 250 : 300, - type: 'svg', + type: 'canvas', data: text, image: '/images/invoice.svg', backgroundOptions: { @@ -102,9 +102,6 @@ }; let customInput; - - let qrSkeleton = true; - setTimeout(() => (qrSkeleton = false), 1000); </script> {#if $user} @@ -227,13 +224,7 @@ class="border {showMobileTip ? 'border-gray-400' : 'border-lightgrey'} rounded-3xl block md:flex md:p-5 justify-center items-center h-[300px] md:h-[342px] w-[250px] md:w-[342px] relative" - > - <div - class="z-100 h-[300px] md:h-[342px] w-[250px] md:w-[342px] animate-pulse absolute top-0 left-0 bg-gray-400 rounded-3xl {qrSkeleton - ? 'block' - : 'hidden'}" - /> - </div> + /> <div class="px-5 space-y-3"> <div class="flex justify-between"> diff --git a/src/routes/register.js b/src/routes/register.js index 86f12dda..1bb03ba6 100644 --- a/src/routes/register.js +++ b/src/routes/register.js @@ -8,7 +8,7 @@ export async function POST({ request }) { } catch (e) { return { status: 500, - body: e, + body: e }; } } |
