"pre-load" first image

This commit is contained in:
Tomáš Mládek 2021-01-10 00:10:49 +01:00
parent b2f2420df9
commit 18e43839d1

View file

@ -1,10 +1,18 @@
<template>
<div class="video-scroll" ref="root">
<img v-for="(file, idx) in definition.files"
<img class="visible loaded"
:src="definition.files[0]"
:style="{
top: `${Math.round(definition.top)}px`,
left:`${Math.round(definition.left)}px`,
}"
/>
<img v-for="(file, idx) in definition.files.slice(1)"
:data-src="file"
:style="{
top: `${Math.round(definition.top)}px`,
left: `${Math.round(definition.left) + width * idx}px`,
left: `${Math.round(definition.left) + width * (idx + 1)}px`,
}"
/>