aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/LandingHeader.svelte
blob: a8d68462d10f2b3a50f3e3a2f1139503c48c5c2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script>
	import { goto } from '$app/navigation';
	import { scroll } from '$lib/utils';
	import { Icon } from '$comp';
	import { user } from '$lib/store';

	export let howItWorks;
	export let faq;
	export let about;
</script>

<header class="w-full lg:w-5/6 pt-10 mx-auto">
	<nav class="block xl:flex flex-wrap justify-between items-center">
		<a href="/">
			<Icon icon="logo" style="mx-auto mb-5 xl:mb-0" />
		</a>

		<div class="hidden space-x-10 md:flex flex-wrap justify-center items-center font-bold">
			<button on:click={() => scroll(howItWorks)}>How It Works</button>
			<button on:click={() => scroll(faq)}>FAQ</button>
			<button on:click={() => scroll(about)}>About</button>
			{#if !$user}
				<button class="border rounded-full px-6 py-2 font-bold" on:click={() => goto('/register')}
					>Start in Seconds
				</button>
				<button
					class="bg-black text-white border rounded-full px-6 py-2 font-bold"
					on:click={() => goto('/login')}
				>
					Sign in
				</button>
			{:else}
				<button
					class="border rounded-full px-6 py-2 font-bold"
					on:click={() => goto(`/${$user.username}/dashboard`)}
					>Account
				</button>
				<button
					class="bg-black text-white border rounded-full px-6 py-2 font-bold"
					on:click={() => goto('/logout')}
				>
					Sign out
				</button>
			{/if}
		</div>
	</nav>
</header>