| 118 | } |
| 119 | |
| 120 | function isPositionTween(anim: GsapAnimation): boolean { |
| 121 | if (anim.propertyGroup === "position") return true; |
| 122 | const has = (p: Record<string, number | string> | undefined) => !!p && ("x" in p || "y" in p); |
| 123 | if (has(anim.properties) || has(anim.fromProperties)) return true; |
| 124 | return (anim.keyframes?.keyframes ?? []).some( |
| 125 | (kf) => "x" in kf.properties || "y" in kf.properties, |
| 126 | ); |
| 127 | } |
| 128 | |
| 129 | // The rest-state value for an animated property (what GSAP animates to/from when |
| 130 | // the other endpoint is the element's natural pose): 1 for scale/opacity, 0 for |