(name: string, stops: Stop[])
| 69 | type Stop = {f: number; decl: string; ease?: readonly number[] | null}; |
| 70 | |
| 71 | function emitKeyframes(name: string, stops: Stop[]) { |
| 72 | let body = ''; |
| 73 | let lastPct: string | null = null; |
| 74 | for (const s of stops) { |
| 75 | const p = pct(s.f); |
| 76 | if (p === lastPct) continue; |
| 77 | lastPct = p; |
| 78 | const ease = s.ease ? `animation-timing-function:${cb(s.ease)};` : ''; |
| 79 | body += `${p}{${s.decl}${ease}}`; |
| 80 | } |
| 81 | return `@keyframes ${name}{${body}}`; |
| 82 | } |
| 83 | |
| 84 | const ty = v => `transform:translateY(${v}px);`; |
| 85 | const op = v => `opacity:${v};`; |
no test coverage detected