Clear thumb after load

This commit is contained in:
Jade Ellis 2024-07-16 22:12:06 +01:00
parent 8e3f5b7ca0
commit 85ffece367
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2

View file

@ -6,6 +6,7 @@
// console.log("imgcmp", thumb);
let className = "";
export { className as class };
let loaded = false
// console.log(src)
// import _PastedImage20240716123726Png from "./Pasted%20image%2020240716123726.png?meta";
</script>
@ -17,7 +18,8 @@
{title}
width={thumb?.originalWidth}
height={thumb?.originalHeight}
style:background-image="url('{thumb?.thumbSrc}')"
style:background-image={loaded ? "none" : `url('${thumb?.thumbSrc}')`}
on:load={() => loaded = true}
/>
{#if title}
<figcaption>{title}</figcaption>
@ -28,6 +30,7 @@
img {
max-height: 60vh;
background-size: cover;
background-repeat: no-repeat;
width: auto;
height: auto;
display: block;