From 2bb620517749eefaa19e5fefbb2a85b9d6f538b8 Mon Sep 17 00:00:00 2001 From: tianma-if <1245207870@qq.com> Date: Tue, 28 Jul 2026 18:10:39 +0800 Subject: [PATCH] fix(registry): register device timeline synchronously (#2546) --- .../vfx-iphone-device/vfx-iphone-device.html | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/registry/blocks/vfx-iphone-device/vfx-iphone-device.html b/registry/blocks/vfx-iphone-device/vfx-iphone-device.html index 4902b729e..62703ceef 100644 --- a/registry/blocks/vfx-iphone-device/vfx-iphone-device.html +++ b/registry/blocks/vfx-iphone-device/vfx-iphone-device.html @@ -614,14 +614,8 @@ }); function onReady() { - requestAnimationFrame(function () { - requestAnimationFrame(function () { - paintReady = true; - captureScreens(); - window.__timelines = window.__timelines || {}; - window.__timelines["devices-canvas"] = tl; - }); - }); + paintReady = true; + captureScreens(); } // ── Cubic Bezier Implementation ──────────────────────────────────── @@ -757,8 +751,9 @@ } // ── GSAP Timeline — Product Review Edit ──────────────────────────── - // __timelines created in onReady() after GLTF models load var tl = gsap.timeline({ paused: true }); + window.__timelines = window.__timelines || {}; + window.__timelines["devices-canvas"] = tl; tl.to(S, { p: 1, drift: 15, duration: 15, ease: "none", onUpdate: render }, 0); @@ -812,8 +807,6 @@ // Scroll on MacBook reveal tl.to(S, { scroll: 0.8, duration: 3, ease: breatheEase }, 9.5); tl.to(S, { scroll: 0.3, duration: 2, ease: driftEase }, 13); - - // __timelines registered in onReady() after GLTF models load