aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/LandingHeader.svelte24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte
index a875e80a..febfc7fd 100644
--- a/src/components/LandingHeader.svelte
+++ b/src/components/LandingHeader.svelte
@@ -9,9 +9,13 @@
howItWorks = undefined,
faq = undefined,
about = undefined,
- user = undefined,
}: any = $props();
+ function startNow() {
+ const match = document.cookie.match(/(?:^|;\s*)username=([^;]*)/);
+ goto(match ? `/${decodeURIComponent(match[1])}` : "/login");
+ }
+
let header = $state();
</script>
@@ -32,21 +36,9 @@
<button class="hover:opacity-80" onclick={() => scroll(faq)}>{$t("faq.header")}</button>
<button class="hover:opacity-80" onclick={() => scroll(about)}>{$t("about.header")}</button>
{/if}
- {#if user}
- <button class="btn !w-auto !rounded-full" onclick={() => goto(`/${user.username}`)}>
- {$t("nav.home")}
- </button>
- <button class="btn !w-auto !rounded-full" onclick={() => goto("/logout")}>
- {$t("nav.signOut")}
- </button>
- {:else}
- <button class="btn btn-accent !w-auto !rounded-full" onclick={() => goto("/register")}>
- {$t("nav.register")}
- </button>
- <button class="btn !w-auto !rounded-full" onclick={() => goto("/login")}>
- {$t("nav.signIn")}
- </button>
- {/if}
+ <button class="btn btn-accent !w-auto !rounded-full" onclick={startNow}>
+ {$t("nav.startInSeconds")}
+ </button>
</div>
</nav>