From 6aaf4ecfb42b676ab9cd1f569c83304d91fa3aa9 Mon Sep 17 00:00:00 2001 From: AlexBocken Date: Wed, 12 Jul 2023 12:44:44 +0200 Subject: [PATCH] reliably unblur, only use unblur if image not already loaded --- src/lib/components/Card.svelte | 8 ++++++++ src/lib/components/TitleImgParallax.svelte | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/components/Card.svelte b/src/lib/components/Card.svelte index b8d5f0d..a0f3aac 100644 --- a/src/lib/components/Card.svelte +++ b/src/lib/components/Card.svelte @@ -11,6 +11,14 @@ if(icon_override){ } let isloaded = false + +import { onMount } from "svelte"; + onMount(() => { + const el = document.querySelector("img") + if(el.complete){ + isloaded = true + } + })