update image and season interval on navigation
This commit is contained in:
		| @@ -8,11 +8,13 @@ | ||||
| 	import InstructionsPage from '$lib/components/InstructionsPage.svelte'; | ||||
| 	import IngredientsPage from '$lib/components/IngredientsPage.svelte'; | ||||
| 	import TitleImgParallax from '$lib/components/TitleImgParallax.svelte'; | ||||
| 	import { afterNavigate } from '$app/navigation'; | ||||
|     import {season} from '$lib/js/season_store'; | ||||
|  | ||||
|     	export let data: PageData; | ||||
|  | ||||
| 	const hero_img_src = "https://new.bocken.org/static/rezepte/full/" + data.short_name + ".webp" | ||||
| 	const placeholder_src = "https://new.bocken.org/static/rezepte/placeholder/" + data.short_name + ".webp" | ||||
| 	let hero_img_src = "https://new.bocken.org/static/rezepte/full/" + data.short_name + ".webp" | ||||
| 	let placeholder_src = "https://new.bocken.org/static/rezepte/placeholder/" + data.short_name + ".webp" | ||||
|     	export let months = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"] | ||||
| 	function season_intervals() { | ||||
| 		let interval_arr = [] | ||||
| @@ -48,6 +50,12 @@ | ||||
| 		return interval_arr | ||||
| 	} | ||||
| 	export let season_iv = season_intervals(); | ||||
|  | ||||
| 	afterNavigate(() => { | ||||
| 		hero_img_src = "https://new.bocken.org/static/rezepte/full/" + data.short_name + ".webp" | ||||
| 		placeholder_src = "https://new.bocken.org/static/rezepte/placeholder/" + data.short_name + ".webp" | ||||
| 		season_iv = season_intervals(); | ||||
| 	}) | ||||
| </script> | ||||
| <style> | ||||
| *{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user