aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/lib/components/Navigation.svelte
blob: b058c1d7e326d6501c3ac4e4dfa19bb5e7be773b (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script lang="ts">
  import { page } from '$app/stores'
  import { base } from "$app/paths";

  import "iconify-icon";

  import { AppRail, AppRailAnchor, getDrawerStore } from '@skeletonlabs/skeleton'

  const drawerStore = getDrawerStore()

  function drawerClose(): void {
    drawerStore.close()
  }

  /**
   * If the menu prop is true, then the close menu button will be rendered.
   */
  export let menu = false
</script>

<AppRail>
  <svelte:fragment slot="lead">
    {#if menu}
      <AppRailAnchor on:click={drawerClose} title="Close Menu" value={0} href="javascript:;">
        <svelte:fragment slot="lead">
          <iconify-icon icon="carbon:menu" width="25" />
        </svelte:fragment>
        Close Menu
      </AppRailAnchor>
    {/if}
  </svelte:fragment>
  <AppRailAnchor
    href="{base}"
    selected={$page.url.pathname === base}
    on:click={drawerClose}
    title="Homepage"
  >
    <svelte:fragment slot="lead">
      <iconify-icon icon="carbon:home" width="35" />
    </svelte:fragment>
    Home!
  </AppRailAnchor>
  <AppRailAnchor
    href="{base}/truncate"
    selected={$page.url.pathname === base + '/truncate'}
    on:click={drawerClose}
    title="Truncate Files"
  >
    <svelte:fragment slot="lead">
      <iconify-icon icon="carbon:page-break" width="35" />
    </svelte:fragment>
    Truncate!
  </AppRailAnchor>
  <svelte:fragment slot="trail">
    <AppRailAnchor
      href="https://github.com/rosstheross/random-stuff"
      rel="noreferrer"
      on:click={drawerClose}
      title="Source Code"
    >
      <svelte:fragment slot="lead">
        <iconify-icon icon="carbon:logo-github" width="35" />
      </svelte:fragment>
      Source!
    </AppRailAnchor>
  </svelte:fragment>
</AppRail>