From c230185c795b8518e4d94d1cbe80c2596be53ecf Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Sat, 30 Jul 2022 08:31:25 -0600 Subject: add mobile view with dynamic tipping menu --- src/routes/invoice/[amount].svelte | 284 +++++++++++++++++++++++-------------- static/icons/heart.svg | 3 + 2 files changed, 177 insertions(+), 110 deletions(-) create mode 100644 static/icons/heart.svg diff --git a/src/routes/invoice/[amount].svelte b/src/routes/invoice/[amount].svelte index 2cf16e37..d1dea907 100644 --- a/src/routes/invoice/[amount].svelte +++ b/src/routes/invoice/[amount].svelte @@ -74,6 +74,9 @@ type: 'svg', data: text, image: '/images/invoice.svg', + backgroundOptions: { + color: 'rgba(0, 0, 0, 0)' + }, dotsOptions: { type: 'rounded' }, @@ -85,132 +88,189 @@ qrCode.append(document.getElementById('qr')); } }); + + let showMobileTip = false; + + const handleBackButton = () => { + if (showMobileTip) { + tipPercent = 0; + customInput.value = ''; + customTipAmount = 0; + tipAmount = 0; + showMobileTip = false; + } else { + goto('/receive'); + } + }; + + let customInput; {#if $user} - - -