Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Route transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Aug 19, 2022
1 parent 87f3db0 commit 93ac8a6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
2 changes: 0 additions & 2 deletions interface/components/navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
</svg>
Settings
</a>

<a href="/" class="menuButton mx-3 mt-0"> Landing </a>
</div>
</div>

Expand Down
10 changes: 10 additions & 0 deletions interface/components/routeTransition.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{#key $router.path}
<div in:fade={{ duration: 200 }}>
<slot />
</div>
{/key}

<script>
import { router } from "tinro"
import { fade, fly } from "svelte/transition"
</script>
21 changes: 10 additions & 11 deletions interface/layout/app.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<svelte:head>
<title>hi</title>
</svelte:head>

<div class="flex h-screen">
{#if $state.authenticated}
<Navigation />
Expand All @@ -11,14 +7,16 @@
<BuildNumber />
<div class="top" />

<Route path="/"><Landing /></Route>
<Route path="/confirm"><Confirm /></Route>
<RouteTransition>
<Route path="/"><Landing /></Route>
<Route path="/confirm"><Confirm /></Route>

<Route path="/codes"><Codes /></Route>
<Route path="/import"><Import /></Route>
<Route path="/export"><Export /></Route>
<Route path="/edit"><Edit /></Route>
<Route path="/settings"><Settings /></Route>
<Route path="/codes"><Codes /></Route>
<Route path="/import"><Import /></Route>
<Route path="/export"><Export /></Route>
<Route path="/edit"><Edit /></Route>
<Route path="/settings"><Settings /></Route>
</RouteTransition>
</div>
</div>

Expand All @@ -29,6 +27,7 @@
// import UpdateAlert from "../components/updateAlert.svelte"
import BuildNumber from "../components/buildNumber.svelte"
import RouteTransition from "../components/routeTransition.svelte"
import Landing from "../windows/landing/landing.svelte"
import Codes from "../windows/codes/codes.svelte"
Expand Down

0 comments on commit 93ac8a6

Please sign in to comment.