mirror of
				https://github.com/bartvdbraak/hellob.art.git
				synced 2025-10-30 19:59:10 +00:00 
			
		
		
		
	feat: add transition to page routing
This commit is contained in:
		
							parent
							
								
									c380518eda
								
							
						
					
					
						commit
						fda17a78f0
					
				
					 2 changed files with 17 additions and 1 deletions
				
			
		|  | @ -5,6 +5,11 @@ | |||
| 	import Footer from '../lib/components/Footer.svelte'; | ||||
| 	import Navigation from '../lib/components/Navigation.svelte'; | ||||
| 	import Header from '$lib/components/Header.svelte'; | ||||
| 	import { fade } from 'svelte/transition'; | ||||
| 
 | ||||
| 	export let data; | ||||
| 
 | ||||
| 	$: ({ pathname } = data); | ||||
| 
 | ||||
| 	import { dev } from '$app/environment'; | ||||
| 	import { inject } from '@vercel/analytics'; | ||||
|  | @ -47,7 +52,11 @@ | |||
| 		<Header {progress} /> | ||||
| 	</svelte:fragment> | ||||
| 
 | ||||
| 	<slot /> | ||||
| 	{#key pathname} | ||||
| 		<div in:fade={{ duration: 300, delay: 400 }} out:fade={{ duration: 300 }}> | ||||
| 			<slot /> | ||||
| 		</div> | ||||
| 	{/key} | ||||
| 
 | ||||
| 	<svelte:fragment slot="pageFooter"> | ||||
| 		<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