You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

4 years ago
4 years ago
4 years ago
4 years ago
  1. <script lang="ts">
  2. import { link } from "svelte-routing";
  3. import selectionStore from "../stores/selection";
  4. $: selected = {
  5. home: $selectionStore.path === "/",
  6. goals: $selectionStore.path.startsWith("/goals"),
  7. questlog: $selectionStore.path.startsWith("/questlog"),
  8. projects: $selectionStore.path.startsWith("/projects"),
  9. items: $selectionStore.path.startsWith("/items"),
  10. logs: $selectionStore.path.startsWith("/logs"),
  11. }
  12. </script>
  13. <nav>
  14. <a class:selected={selected.home} use:link href="/">Stufflog</a>
  15. <a class:selected={selected.goals} use:link href="/goals">Goals</a>
  16. <a class:selected={selected.questlog} use:link href="/questlog">Projects</a>
  17. <a class:selected={selected.items} use:link href="/items">Items</a>
  18. <a class:selected={selected.logs} use:link href="/logs">Logs</a>
  19. </nav>
  20. <style>
  21. nav {
  22. margin: 0;
  23. text-align: center;
  24. }
  25. a {
  26. display: inline-block;
  27. padding: 0.25em;
  28. color: #555;
  29. font-size: 1em;
  30. }
  31. a.selected {
  32. color: #AAA;
  33. }
  34. </style>