mirror of
https://github.com/bartvdbraak/hellob.art.git
synced 2025-06-28 23:39:11 +00:00
feat: add transition to page routing
This commit is contained in:
parent
0b92f62b22
commit
6286479aa6
2 changed files with 17 additions and 1 deletions
|
@ -7,6 +7,11 @@
|
||||||
import Footer from '../lib/components/Footer.svelte';
|
import Footer from '../lib/components/Footer.svelte';
|
||||||
import Navigation from '../lib/components/Navigation.svelte';
|
import Navigation from '../lib/components/Navigation.svelte';
|
||||||
import Header from '$lib/components/Header.svelte';
|
import Header from '$lib/components/Header.svelte';
|
||||||
|
import { fade } from 'svelte/transition';
|
||||||
|
|
||||||
|
export let data;
|
||||||
|
|
||||||
|
$: ({ pathname } = data);
|
||||||
|
|
||||||
import { dev } from '$app/environment';
|
import { dev } from '$app/environment';
|
||||||
import { inject } from '@vercel/analytics';
|
import { inject } from '@vercel/analytics';
|
||||||
|
@ -49,7 +54,11 @@
|
||||||
<Header {progress} />
|
<Header {progress} />
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
|
|
||||||
|
{#key pathname}
|
||||||
|
<div in:fade={{ duration: 300, delay: 400 }} out:fade={{ duration: 300 }}>
|
||||||
<slot />
|
<slot />
|
||||||
|
</div>
|
||||||
|
{/key}
|
||||||
|
|
||||||
<svelte:fragment slot="pageFooter">
|
<svelte:fragment slot="pageFooter">
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|
7
src/routes/+layout.ts
Normal file
7
src/routes/+layout.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
export const load = ({ url }) => {
|
||||||
|
const { pathname } = url;
|
||||||
|
|
||||||
|
return {
|
||||||
|
pathname
|
||||||
|
};
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue