(name: string, stops: Stop[], total: number)
| 105 | type Stop = {f: number; decl: string; ease?: readonly number[] | null}; |
| 106 | |
| 107 | function emitKeyframes(name: string, stops: Stop[], total: number) { |
| 108 | let body = ''; |
| 109 | let lastPct: string | null = null; |
| 110 | for (const s of stops) { |
| 111 | const p = pct(s.f, total); |
| 112 | if (p === lastPct) continue; |
| 113 | lastPct = p; |
| 114 | const ease = s.ease ? `animation-timing-function:${cb(s.ease)};` : ''; |
| 115 | body += `${p}{${s.decl}${ease}}`; |
| 116 | } |
| 117 | return `@keyframes ${name}{${body}}`; |
| 118 | } |
| 119 | |
| 120 | // Use the individual `translate`/`scale` transform properties so the drop and |
| 121 | // the pop can animate on the same element without clobbering one another. |
no test coverage detected