@@ -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; 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 ="visibility: hidden; position: absolute; top: 0; left: 0; ">
785786 </ div >
786787 < br >
787788 < h2 class ="subtitle ">
@@ -2346,5 +2347,73 @@ <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 = 30 ; // 静态图片显示 3 秒
2364+
2365+ function showGif ( ) {
2366+ // GIF 显示,静态图片隐藏
2367+ methodGif . style . visibility = "visible" ;
2368+ methodStatic . style . visibility = "hidden" ;
2369+
2370+ // 清除之前的定时器
2371+ if ( staticTimer ) {
2372+ clearTimeout ( staticTimer ) ;
2373+ staticTimer = null ;
2374+ }
2375+
2376+ // GIF 播放完成后切换到静态图片
2377+ if ( gifTimer ) clearTimeout ( gifTimer ) ;
2378+ gifTimer = setTimeout ( ( ) => {
2379+ showStatic ( ) ;
2380+ } , GIF_DURATION * 1000 ) ;
2381+ }
2382+
2383+ function showStatic ( ) {
2384+ // 使用 visibility 而不是 display,这样 GIF 仍然占据空间,保持容器高度
2385+ // GIF 隐藏但占据空间,静态图片显示并覆盖在上面
2386+ methodGif . style . visibility = "hidden" ;
2387+ methodStatic . style . visibility = "visible" ;
2388+
2389+ // 清除之前的定时器
2390+ if ( gifTimer ) {
2391+ clearTimeout ( gifTimer ) ;
2392+ gifTimer = null ;
2393+ }
2394+
2395+ // 静态图片显示一段时间后重新播放 GIF
2396+ if ( staticTimer ) clearTimeout ( staticTimer ) ;
2397+ staticTimer = setTimeout ( ( ) => {
2398+ // 重新加载 GIF 以重新播放
2399+ const gifSrc = methodGif . src ;
2400+ methodGif . src = "" ;
2401+ setTimeout ( ( ) => {
2402+ methodGif . src = gifSrc ;
2403+ showGif ( ) ;
2404+ } , 100 ) ;
2405+ } , STATIC_DURATION * 1000 ) ;
2406+ }
2407+
2408+ // 监听 GIF 加载完成
2409+ if ( methodGif . complete ) {
2410+ showGif ( ) ;
2411+ } else {
2412+ methodGif . addEventListener ( "load" , ( ) => {
2413+ showGif ( ) ;
2414+ } ) ;
2415+ }
2416+ } ) ;
2417+ </ script >
23492418</ body >
23502419</ html >
0 commit comments