From 8a7d50ceb76c2abfa7fdfe02a74fead7d8d8b5ec Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Wed, 31 Dec 2025 17:37:25 +0100 Subject: [PATCH] fix duplicate image IDs and migrate TitleImgParallax to Svelte 5 runes Replace id="image" with class="image" in both Card and TitleImgParallax components to prevent duplicate IDs when multiple instances appear on the same page. Update TitleImgParallax to use Svelte 5 $props() and $state() runes instead of legacy export let syntax, and modernize event handlers to use onload/onclick attributes. --- src/lib/components/Card.svelte | 6 ++--- src/lib/components/TitleImgParallax.svelte | 28 ++++++++++++---------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/lib/components/Card.svelte b/src/lib/components/Card.svelte index 0b7d3ea..22ff3fe 100644 --- a/src/lib/components/Card.svelte +++ b/src/lib/components/Card.svelte @@ -95,7 +95,7 @@ const img_name = $derived(imageShortName + ".webp?v=" + recipe.dateModified); z-index: 5; text-decoration: none; } -#image{ +.image{ width: 300px; height: 255px; object-fit: cover; @@ -259,9 +259,9 @@ const img_name = $derived(imageShortName + ".webp?v=" + recipe.dateModified);
- {recipe.alt} isloaded=true}/> + {recipe.alt} isloaded=true}/>
{#if showFavoriteIndicator && isFavorite} diff --git a/src/lib/components/TitleImgParallax.svelte b/src/lib/components/TitleImgParallax.svelte index 9d554f9..41e9981 100644 --- a/src/lib/components/TitleImgParallax.svelte +++ b/src/lib/components/TitleImgParallax.svelte @@ -1,12 +1,14 @@