From 53b35c5b13797ea59bec850447fd347214fef025 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 1 Aug 2022 12:27:49 -0700 Subject: use canvas for qr code --- src/routes/invoice/[id].svelte | 15 +++------------ src/routes/register.js | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'src/routes') 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); {#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" - > -
-
+ />
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 }; } } -- cgit v1.2.3