Skip to content

Write HTML. Render video. Built for agents.

fix(registry): stop gsap tweens from clobbering baked-in css transforms (#4090)

Miguel Ángela2a5af8e199f
diff --git a/registry/blocks/transitions-cover/transitions-cover.html b/registry/blocks/transitions-cover/transitions-cover.html
index 1d03ae644b..7a551e0957 100644
--- a/registry/blocks/transitions-cover/transitions-cover.html
+++ b/registry/blocks/transitions-cover/transitions-cover.html
@@ -189,26 +189,8 @@
</div>
<!-- Staggered Blocks Wipes -->
- <div
- id="wipe-a"
- style="
- position: absolute;
- inset: 0;
- background: #f72585;
- z-index: 50;
- transform: translateX(-1920px);
- "
- ></div>
- <div
- id="wipe-b"
- style="
- position: absolute;
- inset: 0;
- background: #7209b7;
- z-index: 49;
- transform: translateX(-1920px);
- "
- ></div>
+ <div id="wipe-a" style="position: absolute; inset: 0; background: #f72585; z-index: 50"></div>
+ <div id="wipe-b" style="position: absolute; inset: 0; background: #7209b7; z-index: 49"></div>
<!-- Horizontal Blinds Container -->
<div
@@ -281,6 +263,10 @@
window.__timelines = window.__timelines || {};
window.__timelines["main"] = tl;
+ // Own the full transform via GSAP from the start (not CSS), so the
+ // later x tweens below don't clobber a value GSAP never tracked.
+ gsap.set(["#wipe-a", "#wipe-b"], { x: -1920 });
+
// Transition demos config
var demos = [
{ label: "STAGGERED BLOCKS", desc: "Use a staggered color blocks transition" },
diff --git a/registry/blocks/transitions-other/transitions-other.html b/registry/blocks/transitions-other/transitions-other.html
index cc905c4caf..d59bafea3e 100644
--- a/registry/blocks/transitions-other/transitions-other.html
+++ b/registry/blocks/transitions-other/transitions-other.html
@@ -196,7 +196,6 @@
width: 50px;
height: 50px;
border-radius: 50%;
- transform: translate(-50%, -50%) scale(0);
z-index: 50;
opacity: 0;
pointer-events: none;
@@ -250,6 +249,10 @@
var tl = gsap.timeline({ paused: true });
var t = 0;
+ // Own the full transform via GSAP from the start (not CSS), so the
+ // later scale tween below doesn't clobber the centering it never tracked.
+ gsap.set("#morph-circle", { xPercent: -50, yPercent: -50, scale: 0 });
+
// === TITLE CARD (3s) ===
tl.to("#title-label", { opacity: 1, y: 0, duration: 0.4, ease: "power2.out" }, t + 0.3);
tl.fromTo(
diff --git a/registry/blocks/us-map-bubble/us-map-bubble.html b/registry/blocks/us-map-bubble/us-map-bubble.html
index 943269a942..77f748573c 100644
--- a/registry/blocks/us-map-bubble/us-map-bubble.html
+++ b/registry/blocks/us-map-bubble/us-map-bubble.html
@@ -115,7 +115,6 @@
stroke: #ffffff;
stroke-width: 1;
transform-origin: center center;
- transform: scale(0);
}
#us-map-bubble .city-pulse {
@@ -357,6 +356,9 @@
function buildTimeline(projectedCities, pulseCircle) {
var statePaths = statesGroup.querySelectorAll(".state-path");
var bubbles = bubblesGroup.querySelectorAll(".city-bubble");
+ // Own the full transform via GSAP from the start (not CSS), so the
+ // scale tween below doesn't clobber a value GSAP never tracked.
+ gsap.set(bubbles, { scale: 0 });
var callouts = calloutsGroup.querySelectorAll(".callout-group");
var connections = connectionsGroup.querySelectorAll(".connection-line");