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(() => {
|
onMounted(() => {
|
||||||
const observer = new IntersectionObserver((entries, observer) => {
|
const observer = new IntersectionObserver((entries, observer) => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
if (entry.isIntersecting){
|
if (entry.isIntersecting) {
|
||||||
const element = entry.target as HTMLImageElement;
|
const element = entry.target as HTMLImageElement;
|
||||||
element.src = element.dataset.src!;
|
element.src = element.dataset.src!;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}, {rootMargin: "100px"});
|
}, {rootMargin: "100px"});
|
||||||
Array.from((root.value as Element).children).forEach((el) => {
|
Array.from((root.value as Element).children).forEach((el) => {
|
||||||
observer.observe(el);
|
observer.observe(el);
|
||||||
|
@ -84,9 +84,6 @@ function getMeta(url: string): Promise<HTMLImageElement> {
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.video-scroll img {
|
.video-scroll img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
image-rendering: optimizeSpeed;
|
||||||
|
|
||||||
.initial {
|
|
||||||
background: red;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue