diff options
| author | Adam Soltys <[email protected]> | 2026-02-03 13:46:15 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 15:34:01 -0800 |
| commit | 918f4b29bc66be343914fd4c9284375825c57fdf (patch) | |
| tree | 68f1b93ee8f1d60400988fd71231295ca886bad6 /src/components/Success.svelte | |
| parent | 44f09f89eb8f69dbb9bba76e0a55125093e7ecc0 (diff) | |
| download | coinos-ui-918f4b29bc66be343914fd4c9284375825c57fdf.tar.gz coinos-ui-918f4b29bc66be343914fd4c9284375825c57fdf.zip | |
cleanup
Diffstat (limited to 'src/components/Success.svelte')
| -rw-r--r-- | src/components/Success.svelte | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/src/components/Success.svelte b/src/components/Success.svelte index b2e126b3..d7561081 100644 --- a/src/components/Success.svelte +++ b/src/components/Success.svelte @@ -2,9 +2,9 @@ import { browser } from "$app/environment"; import { scale } from "svelte/transition"; import Amount from "$comp/Amount.svelte"; - import { Confetti } from "svelte-confetti"; const { amount, tip, rate, currency, locale, title } = $props(); + let ConfettiComp = $state(null); let loaded = $state(false); $effect(() => { if (browser) @@ -12,38 +12,46 @@ loaded = true; }); }); + + $effect(async () => { + if (!browser || !loaded || ConfettiComp) return; + const mod = await import("svelte-confetti"); + ConfettiComp = mod.Confetti; + }); </script> <div class="text-center mt-20 md:mt-0"> {#if loaded} <div class="relative flex justify-center"> <div class="absolute top-64 pointer-events-none"> - <Confetti - amount="20" - size="40" - duration="1600" - delay={[0, 500]} - fallDistance="50px" - colorArray={["url(/images/bolt.svg)"]} - /> - <Confetti - amount="40" - delay={[0, 500]} - size="15" - fallDistance="50px" - duration="1600" - colorArray={[ - "#FFD700", // Gold - "#FF6F61", // Coral - "#6BCB77", // Mint green - "#4D96FF", // Light blue - "#FF9CEE", // Light pink - "#FFD580", // Soft orange - "#87CEEB", // Sky blue - "#FFB6C1", // Light coral pink - "#C1C7FF", // Lavender - ]} - /> + {#if ConfettiComp} + <ConfettiComp + amount="20" + size="40" + duration="1600" + delay={[0, 500]} + fallDistance="50px" + colorArray={["url(/images/bolt.svg)"]} + /> + <ConfettiComp + amount="40" + delay={[0, 500]} + size="15" + fallDistance="50px" + duration="1600" + colorArray={[ + "#FFD700", // Gold + "#FF6F61", // Coral + "#6BCB77", // Mint green + "#4D96FF", // Light blue + "#FF9CEE", // Light pink + "#FFD580", // Soft orange + "#87CEEB", // Sky blue + "#FFB6C1", // Light coral pink + "#C1C7FF", // Lavender + ]} + /> + {/if} </div> </div> |
