From 94848e505fe7c1d13017cc39199602fdac721ed2 Mon Sep 17 00:00:00 2001 From: AlexBocken Date: Thu, 13 Jul 2023 17:18:09 +0200 Subject: [PATCH] update image and season interval on navigation --- src/routes/rezepte/[name]/+page.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/routes/rezepte/[name]/+page.svelte b/src/routes/rezepte/[name]/+page.svelte index 52b0c57..18720a2 100644 --- a/src/routes/rezepte/[name]/+page.svelte +++ b/src/routes/rezepte/[name]/+page.svelte @@ -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(); + })