Skip to content

Commit

Permalink
add banner requesting users to move to new domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliapixel committed Aug 21, 2024
1 parent 394cf9a commit a6d4109
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<script lang="ts">
import { browser } from "$app/environment";
import { replaceState } from "$app/navigation";
import { page } from "$app/stores";
import Leaderboards from "$lib/Leaderboards.svelte";
import Meta from "$lib/Meta.svelte";
import { onMount } from "svelte";
Expand All @@ -20,27 +23,27 @@
let params = new URLSearchParams(window.location.search);
params.set("channel", this.value);
let url = window.location.pathname + "?" + String(params);
window.history.replaceState(null, "", url);
replaceState(url, $page.state);
}
function storeChannel(this: HTMLSelectElement) {
localStorage.setItem("channel", this.value);
}
/** only those which have individual leadeboards */
const channels = [
"global",
"breadworms",
"psp1g",
"julialuxel",
"ovrht",
"omie",
"vaiastol"
];
const channels = ["global", "breadworms", "psp1g", "julialuxel", "ovrht", "omie", "vaiastol"];
// should be removed in the future
const isOldDomain = browser ? window.location.hostname !== "gofish.lol" : false;
</script>

<Meta description="Leaderboards for gofish" title="gofish leaderboards" image="/favicon.png" />

{#if isOldDomain}
<header class="p-4 text-3xl text-center bg-neutral-800">
Please use the new domain: <a href="https://gofish.lol/">https://gofish.lol/</a>
</header>
{/if}
<div class="ml-8 mr-8 lg:ml-32 lg:mr-32">
<h1 class="mb-4 mt-8">gofish leaderboards! 🎣 🤩 🏆</h1>
<span>channel: </span>
Expand Down

0 comments on commit a6d4109

Please sign in to comment.