Skip to content

Commit

Permalink
Improve download page
Browse files Browse the repository at this point in the history
  • Loading branch information
MineGame159 committed Oct 5, 2023
1 parent daa931f commit 7320489
Showing 1 changed file with 39 additions and 24 deletions.
63 changes: 39 additions & 24 deletions src/routes/download/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@
onMount(() => {
const w: any = window;
(w.adsbygoogle = w.adsbygoogle || []).push({});
(w.adsbygoogle = w.adsbygoogle || []).push({});
setInterval(() => {
const interval = setInterval(() => {
timer--;
if (timer == 0) {
if ($page.url.searchParams.has("devBuild"))
goto("/api/download?devBuild=latest");
else
goto("/api/download");
clearInterval(interval);
}
}, 1000);
});
Expand All @@ -27,31 +30,43 @@
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8546584413187411"crossorigin="anonymous"></script>
</svelte:head>

{#if browser}
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8546584413187411"
data-ad-slot="5754111941"
data-ad-format="auto"
data-full-width-responsive="true">
</ins>
{/if}

<p>Download will start in {timer} seconds</p>

{#if browser}
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8546584413187411"
data-ad-slot="5754111941"
data-ad-format="auto"
data-full-width-responsive="true">
</ins>
{/if}
<div>
{#if browser}
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8546584413187411"
data-ad-slot="5754111941"
data-ad-format="auto"
data-full-width-responsive="true">
</ins>
{/if}

{#if timer > 1}
<p>Download will start in {timer} seconds</p>
{:else if timer > 0}
<p>Download will start in 1 second</p>
{:else}
<p>Download started</p>
{/if}

{#if browser}
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8546584413187411"
data-ad-slot="5754111941"
data-ad-format="auto"
data-full-width-responsive="true">
</ins>
{/if}
</div>

<style>
p {
margin: 4rem;
div {
margin: 2rem;
text-align: center;
}
p {
margin: 2rem 0;
}
</style>

0 comments on commit 7320489

Please sign in to comment.