Skip to content

Commit 95b01de

Browse files
committed
update gif
1 parent bdc5b0d commit 95b01de

File tree

1 file changed

+68
-2
lines changed

1 file changed

+68
-2
lines changed

public/WholeBodyVLA/index.html

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,9 @@ <h2 class="subtitle">
780780
<div class="container is-max-desktop">
781781
<div class="hero-body">
782782
<h1 class="title is-2" style="text-align: center; padding-bottom: 10px;">Method Overview</h1>
783-
<div align="center">
784-
<img src="https://assets.kinetixai.cn/WholeBodyVLA/20251217-123804.gif" alt="WholeBodyVLA Method" width="100%">
783+
<div align="center" style="position: relative; display: inline-block; width: 100%;">
784+
<img id="method-gif" src="https://assets.kinetixai.cn/WholeBodyVLA/20251217-123804.gif" alt="WholeBodyVLA Method" width="100%" style="display: block;">
785+
<img id="method-static" src="https://assets.kinetixai.cn/WholeBodyVLA/method_wbvla.png" alt="WholeBodyVLA Method" width="100%" style="display: none; position: absolute; top: 0; left: 0;">
785786
</div>
786787
<br>
787788
<h2 class="subtitle">
@@ -2346,5 +2347,70 @@ <h2 class="section-title" id="whats-more">What's More</h2>
23462347
video.addEventListener("click", enableControlsOnce);
23472348
});
23482349
</script>
2350+
<script>
2351+
// Method GIF 播放控制:播放完成后切换到静态图片,然后循环
2352+
document.addEventListener("DOMContentLoaded", () => {
2353+
const methodGif = document.getElementById("method-gif");
2354+
const methodStatic = document.getElementById("method-static");
2355+
2356+
if (!methodGif || !methodStatic) return;
2357+
2358+
let gifTimer = null;
2359+
let staticTimer = null;
2360+
2361+
// 估计 GIF 播放时长(秒),可以根据实际 GIF 时长调整
2362+
const GIF_DURATION = 8; // 假设 GIF 播放时长为 8 秒,你可以根据实际调整
2363+
const STATIC_DURATION = 3; // 静态图片显示 3 秒
2364+
2365+
function showGif() {
2366+
methodGif.style.display = "block";
2367+
methodStatic.style.display = "none";
2368+
2369+
// 清除之前的定时器
2370+
if (staticTimer) {
2371+
clearTimeout(staticTimer);
2372+
staticTimer = null;
2373+
}
2374+
2375+
// GIF 播放完成后切换到静态图片
2376+
if (gifTimer) clearTimeout(gifTimer);
2377+
gifTimer = setTimeout(() => {
2378+
showStatic();
2379+
}, GIF_DURATION * 1000);
2380+
}
2381+
2382+
function showStatic() {
2383+
methodGif.style.display = "none";
2384+
methodStatic.style.display = "block";
2385+
2386+
// 清除之前的定时器
2387+
if (gifTimer) {
2388+
clearTimeout(gifTimer);
2389+
gifTimer = null;
2390+
}
2391+
2392+
// 静态图片显示一段时间后重新播放 GIF
2393+
if (staticTimer) clearTimeout(staticTimer);
2394+
staticTimer = setTimeout(() => {
2395+
// 重新加载 GIF 以重新播放
2396+
const gifSrc = methodGif.src;
2397+
methodGif.src = "";
2398+
setTimeout(() => {
2399+
methodGif.src = gifSrc;
2400+
showGif();
2401+
}, 100);
2402+
}, STATIC_DURATION * 1000);
2403+
}
2404+
2405+
// 监听 GIF 加载完成
2406+
if (methodGif.complete) {
2407+
showGif();
2408+
} else {
2409+
methodGif.addEventListener("load", () => {
2410+
showGif();
2411+
});
2412+
}
2413+
});
2414+
</script>
23492415
</body>
23502416
</html>

0 commit comments

Comments
 (0)