Clear thumb after load

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