Skip to content

Commit

Permalink
Add viewTransition
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoheiu committed Nov 10, 2023
1 parent a468f0e commit 428d1a0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<script>
import { Toaster } from 'svelte-french-toast';
import '../app.css';
import { onNavigate } from '$app/navigation';
onNavigate((navigation) => {
if (!document.startViewTransition) return;
return new Promise((resolve) => {
document.startViewTransition(async () => {
resolve();
await navigation.complete;
});
});
});
</script>

<Toaster />
Expand Down

0 comments on commit 428d1a0

Please sign in to comment.