From 7ec94246f032db26c55d107d980300ba4a721dee Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 22 Jan 2024 14:13:56 +0100 Subject: [PATCH] Card is now fully loaded in itself No longer do we have this weird shift of the description to the right of the Card until some magical JS is loaded to fix it. Not yet perfect: The now wrapping a-tag is for some reason still weirdly sent to client until some js cleans it up. Currently results in a too large gap which is fixed by local js. Still TODO: do not blur images if no js present --- src/lib/components/Card.svelte | 71 +++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/src/lib/components/Card.svelte b/src/lib/components/Card.svelte index ea2ad87..616287b 100644 --- a/src/lib/components/Card.svelte +++ b/src/lib/components/Card.svelte @@ -14,22 +14,27 @@ if(icon_override){ let isloaded = false import { onMount } from "svelte"; - onMount(() => { - isloaded = document.querySelector("img")?.complete ? true : false - }) + +onMount(() => { + isloaded = document.querySelector("img")?.complete ? true : false +}) + - -
-
+ +
+
+
{recipe.alt} isloaded=true}/>
{#if icon_override || recipe.season.includes(current_month)}
{recipe.icon} {/if} - -
+
{recipe.category}
{@html recipe.name}
@@ -184,4 +190,5 @@ import { onMount } from "svelte"; {/each}
+