diff --git a/.claude/skills/decomposing-ae/scripts/generate-hyperframes.py b/.claude/skills/decomposing-ae/scripts/generate-hyperframes.py index fa56abf2d8..b909e46022 100644 --- a/.claude/skills/decomposing-ae/scripts/generate-hyperframes.py +++ b/.claude/skills/decomposing-ae/scripts/generate-hyperframes.py @@ -319,26 +319,29 @@ def generate_html(data: dict) -> str: scene_name = layer.get("name", "") scene_comp = comp_by_name.get(scene_name) scene_start = layer.get("inPoint", 0) - scene_dur = layer.get("outPoint", 0) - if scene_dur <= scene_start: - scene_dur = scene_start + 5 + scene_duration = layer.get("outPoint", 0) + if scene_duration <= 0: + scene_duration = 5 + scene_end = scene_start + scene_duration scene_id = f"scene-{comp_idx}" comp_idx += 1 + initial_opacity = 1 if scene_start < 0.01 else 0 all_html.append( - f' ' + f' ' ) all_html.append( f'
' + f'overflow:hidden;opacity:{initial_opacity};">' ) # Scene fade in/out - all_gsap.append(f' /* {scene_name} */') - all_gsap.append(f' tl.to("#{scene_id}", {{ opacity: 1, duration: 0.01 }}, {round(scene_start, 4)});') + all_gsap.append(f' /* {scene_name} ({scene_start:.1f}-{scene_end:.1f}s) */') + if initial_opacity == 0: + all_gsap.append(f' tl.set("#{scene_id}", {{ opacity: 1 }}, {round(scene_start, 4)});') if scene_comp: # Process scene layers @@ -378,7 +381,7 @@ def generate_html(data: dict) -> str: all_gsap.append(line) # Scene fade out - fade_out_t = round(scene_dur - 0.3, 4) + fade_out_t = round(scene_end - 0.3, 4) all_gsap.append(f' tl.to("#{scene_id}", {{ opacity: 0, duration: 0.3 }}, {fade_out_t});') all_gsap.append("") diff --git a/examples/modern-fast-promo/index.html b/examples/modern-fast-promo/index.html index e158d3c398..b3c5f77cfc 100644 --- a/examples/modern-fast-promo/index.html +++ b/examples/modern-fast-promo/index.html @@ -22,8 +22,8 @@
- -
+ +
@@ -56,8 +56,8 @@
Photo/Video_08
- -
+ +
dynamic
@@ -83,8 +83,8 @@
Photo/Video_05
- -
+ +
Photo/Video_04
easy to use
easy to use
@@ -96,7 +96,7 @@
-
+
clean design
@@ -122,8 +122,8 @@ window.__timelines = window.__timelines || {}; var tl = gsap.timeline({ paused: true }); - /* Scene_04 */ - tl.to("#scene-0", { opacity: 1, duration: 0.01 }, 15.4488); + /* Scene_04 (15.4-16.3s) */ + tl.set("#scene-0", { opacity: 1 }, 15.4488); tl.set("#c1-l3", { scale: 1.0 }, 15.4488); tl.to("#c1-l3", { scale: 0.76, duration: 2.636, ease: "power2.inOut" }, 15.4488); tl.set("#c1-l5", { scale: 1.0 }, 15.4488); @@ -140,10 +140,10 @@ tl.set("#c1-l22", { scale: 1.0 }, 15.7491); tl.to("#c1-l22", { scale: 1.2, duration: 0.1001, ease: "none" }, 15.7491); tl.to("#c1-l22", { scale: 0.9, duration: 0.367, ease: "none" }, 15.8492); - tl.to("#scene-0", { opacity: 0, duration: 0.3 }, 20.1488); + tl.to("#scene-0", { opacity: 0, duration: 0.3 }, 16.033); - /* Scene_03 */ - tl.to("#scene-1", { opacity: 1, duration: 0.01 }, 8.642); + /* Scene_03 (8.6-12.8s) */ + tl.set("#scene-1", { opacity: 1 }, 8.642); tl.set("#c2-l14", { scale: 1.0 }, 8.8088); tl.to("#c2-l14", { scale: 1.2, duration: 0.1669, ease: "none" }, 8.8088); tl.to("#c2-l14", { scale: 1.0, duration: 0.1668, ease: "none" }, 8.9757); @@ -172,10 +172,10 @@ tl.to("#c2-l22", { scale: 1.0, duration: 0.6673, ease: "power2.inOut" }, 8.642); tl.set("#c2-l22", { opacity: 0.0 }, 8.642); tl.to("#c2-l22", { opacity: 1.0, duration: 0.3337, ease: "power2.inOut" }, 8.642); - tl.to("#scene-1", { opacity: 0, duration: 0.3 }, 13.342); + tl.to("#scene-1", { opacity: 0, duration: 0.3 }, 12.4711); - /* Scene_02 */ - tl.to("#scene-2", { opacity: 1, duration: 0.01 }, 5.8725); + /* Scene_02 (5.9-9.0s) */ + tl.set("#scene-2", { opacity: 1 }, 5.8725); tl.set("#c3-l0", { scale: 1.0 }, 8.3083); tl.to("#c3-l0", { scale: 1.2, duration: 0.6673, ease: "power2.inOut" }, 8.3083); tl.set("#c3-l1", { scale: 0.8 }, 5.8725); @@ -185,10 +185,9 @@ tl.to("#c3-l1", { scale: 1.15, duration: 1.1011, ease: "power2.inOut" }, 6.9402); tl.set("#c3-l5", { scale: 1.0 }, 8.3083); tl.to("#c3-l5", { scale: 1.2, duration: 0.6673, ease: "power2.inOut" }, 8.3083); - tl.to("#scene-2", { opacity: 0, duration: 0.3 }, 10.5725); + tl.to("#scene-2", { opacity: 0, duration: 0.3 }, 8.709); - /* Scene_01 */ - tl.to("#scene-3", { opacity: 1, duration: 0.01 }, 0.0); + /* Scene_01 (0.0-6.6s) */ tl.set("#c4-l0", { scale: 0.0 }, 0.0); tl.to("#c4-l0", { scale: 1.0, duration: 0.6673, ease: "power2.inOut" }, 0.0); tl.to("#c4-l0", { scale: 1.0, duration: 0.0334, ease: "power2.inOut" }, 0.6673);