From 732048995607ca08ae9a1eb94769cae14637274b Mon Sep 17 00:00:00 2001 From: MineGame159 Date: Thu, 5 Oct 2023 15:12:26 +0200 Subject: [PATCH] Improve download page --- src/routes/download/+page.svelte | 63 ++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte index 68d1bf9..3c85055 100644 --- a/src/routes/download/+page.svelte +++ b/src/routes/download/+page.svelte @@ -9,8 +9,9 @@ onMount(() => { const w: any = window; (w.adsbygoogle = w.adsbygoogle || []).push({}); + (w.adsbygoogle = w.adsbygoogle || []).push({}); - setInterval(() => { + const interval = setInterval(() => { timer--; if (timer == 0) { @@ -18,6 +19,8 @@ goto("/api/download?devBuild=latest"); else goto("/api/download"); + + clearInterval(interval); } }, 1000); }); @@ -27,31 +30,43 @@ -{#if browser} - - -{/if} - -

Download will start in {timer} seconds

- -{#if browser} - - -{/if} +
+ {#if browser} + + + {/if} + + {#if timer > 1} +

Download will start in {timer} seconds

+ {:else if timer > 0} +

Download will start in 1 second

+ {:else} +

Download started

+ {/if} + + {#if browser} + + + {/if} +
\ No newline at end of file