remove ineffective optimization (hide !isIntersecting images)
This commit is contained in:
parent
452cb267fb
commit
70759c7a69
1 changed files with 0 additions and 7 deletions
|
@ -60,7 +60,6 @@ export default defineComponent({
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
const element = entry.target as HTMLImageElement;
|
const element = entry.target as HTMLImageElement;
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
element.classList.add("visible");
|
|
||||||
if (!element.src) {
|
if (!element.src) {
|
||||||
element.src = element.dataset.src!;
|
element.src = element.dataset.src!;
|
||||||
if (element.dataset.direction == "left" || element.dataset.direction == "right") {
|
if (element.dataset.direction == "left" || element.dataset.direction == "right") {
|
||||||
|
@ -72,8 +71,6 @@ export default defineComponent({
|
||||||
element.classList.add("loaded");
|
element.classList.add("loaded");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
element.classList.remove("visible");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -113,14 +110,10 @@ export interface VideoScrollDef {
|
||||||
image-rendering: optimizeSpeed;
|
image-rendering: optimizeSpeed;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity .5s;
|
transition: opacity .5s;
|
||||||
visibility: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.loaded {
|
.loaded {
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.visible {
|
|
||||||
visibility: visible !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue