mirror of
https://github.com/OpenVGLab/OmniLottie.git
synced 2026-09-16 23:26:26 +00:00
update gallery
This commit is contained in:
+4
-5
@@ -653,7 +653,6 @@
|
|||||||
<section class="panel">
|
<section class="panel">
|
||||||
<div class="section-head">
|
<div class="section-head">
|
||||||
<h2>Generated Lottie Gallery</h2>
|
<h2>Generated Lottie Gallery</h2>
|
||||||
<!-- <p>3 行反向流式跑马灯 · Hover 即暂停</p> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div id="lottieStatus" class="status">Loading...</div>
|
<div id="lottieStatus" class="status">Loading...</div>
|
||||||
<div id="lottieRows" class="lottie-rows"></div>
|
<div id="lottieRows" class="lottie-rows"></div>
|
||||||
@@ -893,7 +892,7 @@
|
|||||||
track,
|
track,
|
||||||
laneIndex,
|
laneIndex,
|
||||||
direction,
|
direction,
|
||||||
speed: 0.34 + laneIndex * 0.08,
|
speed: (0.34 + laneIndex * 0.08) * 1.5,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
paused: false,
|
paused: false,
|
||||||
gap: 10
|
gap: 10
|
||||||
@@ -935,7 +934,7 @@
|
|||||||
let last = state.track.lastElementChild;
|
let last = state.track.lastElementChild;
|
||||||
while (last) {
|
while (last) {
|
||||||
const width = last.getBoundingClientRect().width + state.gap;
|
const width = last.getBoundingClientRect().width + state.gap;
|
||||||
if (state.offset < width) break;
|
if (state.offset < 1) break;
|
||||||
state.track.insertBefore(last, state.track.firstElementChild);
|
state.track.insertBefore(last, state.track.firstElementChild);
|
||||||
state.offset -= width;
|
state.offset -= width;
|
||||||
last = state.track.lastElementChild;
|
last = state.track.lastElementChild;
|
||||||
@@ -958,8 +957,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rows = [[], [], []];
|
const rows = [[], [], [], [], []];
|
||||||
files.forEach((file, index) => rows[index % 3].push(file));
|
files.forEach((file, index) => rows[index % 5].push(file));
|
||||||
|
|
||||||
rows.forEach((rowFiles, laneIndex) => {
|
rows.forEach((rowFiles, laneIndex) => {
|
||||||
rowsEl.appendChild(createLane(rowFiles, baseDir, laneIndex));
|
rowsEl.appendChild(createLane(rowFiles, baseDir, laneIndex));
|
||||||
|
|||||||
Reference in New Issue
Block a user