From e6fde2104877d98f40f051663305e0211f12dd69 Mon Sep 17 00:00:00 2001 From: Miguel Angel Simon Sierra Date: Fri, 10 Jul 2026 13:08:19 -0400 Subject: [PATCH] fix(registry): reveal caption-clip-wipe group-final words lost to staggered exit add The exit wipe used one multi-target add with delay: anime.stagger(40). For any word whose reveal window overlaps the group exit window (the last words of each caption group), anime bakes a duplicate exit tween node into the word's reveal child with the implicit 'from' resolved to the PRE-REVEAL hidden state (inset right 100%), and that node clobbers the reveal -- the word never appears ('starts' stayed invisible through t=0.85-1.15s while the GSAP baseline shows it wiping in; verified via anime internals dump: duplicate clip-path node from [0,100,0,0] at st=120 inside the reveal child). Replace the staggered add with a per-word loop at explicit positions (g.end - 0.2 + i*40), which produces correctly chained tweens. Probed computed clip-paths now match GSAP math exactly: w3 inset right 25.4% at t=0.96 (was 100%), w23 exit left inset 17.56% = inCubic(0.56) at t=6.69, w24 overlap blend matches GSAP replace values. Applied to both twins. Residual damaged checkpoints at t=5.58/6.13-6.21 are sub-200ms group-exit transients right before the group visibility cut, not missing content. --- .../caption-clip-wipe/caption-clip-wipe.html | 27 ++++++++++++------- .../components/caption-clip-wipe/demo.html | 27 ++++++++++++------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/registry/components/caption-clip-wipe/caption-clip-wipe.html b/registry/components/caption-clip-wipe/caption-clip-wipe.html index 776ebb8cde..21d6cecd16 100644 --- a/registry/components/caption-clip-wipe/caption-clip-wipe.html +++ b/registry/components/caption-clip-wipe/caption-clip-wipe.html @@ -247,17 +247,24 @@ ); }); + /* Exit wipe. One staggered multi-target add (delay: anime.stagger(40)) + makes anime bake a duplicate exit tween node into any word whose + reveal overlaps the exit window (last words of a group), with the + implicit "from" resolved to the pre-reveal hidden state -- that + node clobbers the reveal and the word never appears. A per-word + loop with explicit positions produces correctly chained tweens. */ var wordEls = grp.querySelectorAll(".wp-word"); - tl.add( - wordEls, - { - clipPath: "inset(0 0% 0 100%)", - duration: 250, - delay: anime.stagger(40), - ease: "inCubic", - }, - toMs(g.end - 0.2), - ); + for (var xi = 0; xi < wordEls.length; xi++) { + tl.add( + wordEls[xi], + { + clipPath: "inset(0 0% 0 100%)", + duration: 250, + ease: "inCubic", + }, + toMs(g.end - 0.2) + xi * 40, + ); + } tl.add( grp, { diff --git a/registry/components/caption-clip-wipe/demo.html b/registry/components/caption-clip-wipe/demo.html index c8fc844554..39a3a1e390 100644 --- a/registry/components/caption-clip-wipe/demo.html +++ b/registry/components/caption-clip-wipe/demo.html @@ -245,17 +245,24 @@ ); }); + /* Exit wipe. One staggered multi-target add (delay: anime.stagger(40)) + makes anime bake a duplicate exit tween node into any word whose + reveal overlaps the exit window (last words of a group), with the + implicit "from" resolved to the pre-reveal hidden state -- that + node clobbers the reveal and the word never appears. A per-word + loop with explicit positions produces correctly chained tweens. */ var wordEls = grp.querySelectorAll(".wp-word"); - tl.add( - wordEls, - { - clipPath: "inset(0 0% 0 100%)", - duration: 250, - delay: anime.stagger(40), - ease: "inCubic", - }, - toMs(g.end - 0.2), - ); + for (var xi = 0; xi < wordEls.length; xi++) { + tl.add( + wordEls[xi], + { + clipPath: "inset(0 0% 0 100%)", + duration: 250, + ease: "inCubic", + }, + toMs(g.end - 0.2) + xi * 40, + ); + } tl.add( grp, {