aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/lib/svelte/Navigation.svelte
blob: 6a4d76a73854af52ae29a2f27097070d5944998e (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
<script lang="ts">
  import { page } from '$app/stores';
  import Icon from '@iconify/svelte';
  import { AppRail, AppRailAnchor, getDrawerStore } from '@skeletonlabs/skeleton';

  const drawerStore = getDrawerStore();

  function drawerClose(): void {
    drawerStore.close();
  }
</script>

<AppRail>
  <svelte:fragment slot="lead"></svelte:fragment>
  <AppRailAnchor href="/" selected={$page.url.pathname === '/'} on:click={drawerClose}>
    <svelte:fragment slot="lead">
      <Icon icon="carbon:home" width="35" />
    </svelte:fragment>
    Home!
  </AppRailAnchor>
  <AppRailAnchor
    href="/truncate"
    selected={$page.url.pathname === '/truncate'}
    data-sveltekit-reload
    on:click={drawerClose}
  >
    <svelte:fragment slot="lead">
      <Icon icon="carbon:page-break" width="35" />
    </svelte:fragment>
    Truncate!
  </AppRailAnchor>
  <svelte:fragment slot="trail">
    <AppRailAnchor
      href="https://github.com/rosstheross/rosstheross.github.io"
      rel="noreferrer"
      target="_blank"
      on:click={drawerClose}
    >
      <svelte:fragment slot="lead">
        <Icon icon="carbon:logo-github" width="35" />
      </svelte:fragment>
      Source!
    </AppRailAnchor>
  </svelte:fragment>
</AppRail>