(anim: GsapAnimation)
| 142 | // element's rest pose so the surfaced keyframes are uniform. `from()` goes |
| 143 | // fromProperties → base; `to()` goes base → properties. |
| 144 | function flatKeyframes(anim: GsapAnimation): KeyframePoint[] { |
| 145 | if (anim.method === "fromTo") { |
| 146 | return [ |
| 147 | { pct: 0, time: 0, properties: anim.fromProperties ?? {} }, |
| 148 | { pct: 100, time: 0, properties: anim.properties ?? {} }, |
| 149 | ]; |
| 150 | } |
| 151 | // to()/from() vars both live in anim.properties; from() plays them in reverse |
| 152 | // against the element's rest pose. |
| 153 | const vars = anim.properties ?? {}; |
| 154 | const base = baseProps(vars); |
| 155 | return anim.method === "from" |
| 156 | ? [ |
| 157 | { pct: 0, time: 0, properties: vars }, |
| 158 | { pct: 100, time: 0, properties: base }, |
| 159 | ] |
| 160 | : [ |
| 161 | { pct: 0, time: 0, properties: base }, |
| 162 | { pct: 100, time: 0, properties: vars }, |
| 163 | ]; |
| 164 | } |
| 165 | |
| 166 | // Studio-internal markers that aren't user motion: the position-hold `set` GSAP |
| 167 | // runs before a keyframed position tween (`data: "hf-hold"`). |
no test coverage detected