add optimizeSpeed image-rendering attr, formatting
This commit is contained in:
parent
4531d12671
commit
fee57e4b3b
1 changed files with 3 additions and 6 deletions
|
@ -36,11 +36,11 @@ export default defineComponent({
|
|||
onMounted(() => {
|
||||
const observer = new IntersectionObserver((entries, observer) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting){
|
||||
if (entry.isIntersecting) {
|
||||
const element = entry.target as HTMLImageElement;
|
||||
element.src = element.dataset.src!;
|
||||
}
|
||||
})
|
||||
});
|
||||
}, {rootMargin: "100px"});
|
||||
Array.from((root.value as Element).children).forEach((el) => {
|
||||
observer.observe(el);
|
||||
|
@ -84,9 +84,6 @@ function getMeta(url: string): Promise<HTMLImageElement> {
|
|||
<style scoped>
|
||||
.video-scroll img {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.initial {
|
||||
background: red;
|
||||
image-rendering: optimizeSpeed;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in a new issue