Skip to content

Commit

Permalink
Changing toggle frontend to be more smooth
Browse files Browse the repository at this point in the history
  • Loading branch information
samyakjain11 committed Sep 2, 2023
1 parent 3ee3192 commit eeb31fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
let qrImg: string | null = null;
let walletUrl: null | string = null;
let showQR = true;
let user: User | null = null;
userStore.subscribe((data) => (user = data));
Expand Down Expand Up @@ -68,7 +70,13 @@
<div class="block w-full md:max-w-sm md:w-8/12 mx-auto mb-10" in:slide>
<div class="bg-rp-cream px-8 pt-8 pb-5 rounded-md qr-pass flex flex-col items-center gap-2">
{#if qrImg}
<img class="w-full aspect-square" src={qrImg} alt="QR Pass" />
<button on:click={() => { showQR = !showQR }} class="w-full aspect-square">
{#if showQR}
<img src={qrImg} class="w-full aspect-square" alt="QR Pass" />
{:else}
<p class="w-full aspect-square bg-white font-semibold text-rp-blue flex items-center justify-center">{user.email}</p>
{/if}
</button>
{:else}
<div class="w-full aspect-square bg-white animate-pulse rounded-md" />
{/if}
Expand Down

0 comments on commit eeb31fb

Please sign in to comment.