re-add off-screen image hiding

This commit is contained in:
Tomáš Mládek 2025-07-29 09:02:32 +02:00
parent 576d3d1dcb
commit c9fc9451ee

View file

@ -107,6 +107,7 @@ export default defineComponent({
if (entry.isIntersecting) {
element.classList.add("visible");
if (!element.src && element.dataset.src) {
element.classList.add("displayed");
// Queue the image for loading through the global service
// Calculate the image's position to prioritize closer images
queueImageForLoading(
@ -122,6 +123,8 @@ export default defineComponent({
}
);
}
} else {
element.classList.remove("visible");
}
});
});
@ -177,6 +180,9 @@ export interface VideoScrollDef {
.video-scroll img.visible {
visibility: visible !important;
}
.video-scroll img.displayed {
opacity: 1 !important;
}