From f074c0af089d74884023144ea8bc6bef0e41544b Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Tue, 17 Feb 2026 18:33:03 +0100 Subject: [PATCH] recipes: drop opacity transition from TitleImgParallax hero image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the opacity 0→1 fade-in transition — it's annoying when the image is already cached. The dominant color background handles the loading state, so no transition needed. --- .../recipes/TitleImgParallax.svelte | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/lib/components/recipes/TitleImgParallax.svelte b/src/lib/components/recipes/TitleImgParallax.svelte index 125d101..909eb06 100644 --- a/src/lib/components/recipes/TitleImgParallax.svelte +++ b/src/lib/components/recipes/TitleImgParallax.svelte @@ -3,14 +3,9 @@ let { src, color = '', alt = "", children } = $props(); - let isloaded = $state(false); let isredirected = $state(false); onMount(() => { - const el = document.querySelector("img") - if(el?.complete){ - isloaded = true - } fetch(src, { method: 'HEAD' }) .then(response => { isredirected = response.redirected @@ -21,9 +16,7 @@ if(isredirected){ return } - if(document.querySelector("img").complete){ - document.querySelector("#img_carousel").showModal(); - } + document.querySelector("#img_carousel").showModal(); } function close_dialog_img(){ document.querySelector("#img_carousel").close(); @@ -95,8 +88,6 @@ position: absolute; top: 0; width: min(1000px, 100dvw); - opacity: 0; - transition: var(--transition-normal); height: max(60dvh,600px); object-fit: cover; object-position: 50% 20%; @@ -112,9 +103,6 @@ :global(h1){ width: 100%; } -.unblur.image{ - opacity: 1; -} /* DIALOG */ dialog{ @@ -155,13 +143,13 @@ dialog button{
-
+
- {isloaded=true}} {alt}/> +
@@ -170,7 +158,7 @@ dialog button{ - +