|
@ -2,14 +2,6 @@ |
|
|
import { link } from "svelte-routing"; |
|
|
import { link } from "svelte-routing"; |
|
|
import selectionStore from "../stores/selection"; |
|
|
import selectionStore from "../stores/selection"; |
|
|
|
|
|
|
|
|
export let location: string = window.location.pathname.split("?")[0]; |
|
|
|
|
|
|
|
|
|
|
|
function updateLocation() { |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
location = window.location.pathname.split("?")[0]; |
|
|
|
|
|
}, 0); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$: selected = { |
|
|
$: selected = { |
|
|
home: $selectionStore.path === "/", |
|
|
home: $selectionStore.path === "/", |
|
|
goals: $selectionStore.path.startsWith("/goals"), |
|
|
goals: $selectionStore.path.startsWith("/goals"), |
|
@ -21,12 +13,12 @@ |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<nav> |
|
|
<nav> |
|
|
<a on:click={updateLocation} class:selected={selected.home} use:link href="/">Stufflog</a> |
|
|
|
|
|
<a on:click={updateLocation} class:selected={selected.goals} use:link href="/goals">Goals</a> |
|
|
|
|
|
<a class="desktop" on:click={updateLocation} class:selected={selected.questlog} use:link href="/questlog">Projects</a> |
|
|
|
|
|
<a class="mobile" on:click={updateLocation} class:selected={selected.projects} use:link href="/projects">Projects</a> |
|
|
|
|
|
<a on:click={updateLocation} class:selected={selected.items} use:link href="/items">Items</a> |
|
|
|
|
|
<a on:click={updateLocation} class:selected={selected.logs} use:link href="/logs">Logs</a> |
|
|
|
|
|
|
|
|
<a class:selected={selected.home} use:link href="/">Stufflog</a> |
|
|
|
|
|
<a class:selected={selected.goals} use:link href="/goals">Goals</a> |
|
|
|
|
|
<a class="desktop" class:selected={selected.questlog} use:link href="/questlog">Projects</a> |
|
|
|
|
|
<a class="mobile" class:selected={selected.projects} use:link href="/projects">Projects</a> |
|
|
|
|
|
<a class:selected={selected.items} use:link href="/items">Items</a> |
|
|
|
|
|
<a class:selected={selected.logs} use:link href="/logs">Logs</a> |
|
|
</nav> |
|
|
</nav> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|