(cells: Cell[], isReducedMotion: boolean)
| 206 | const cssCache = new WeakMap<object, string>(); |
| 207 | const reducedMotionCssCache = new WeakMap<object, string>(); |
| 208 | function keyframesFor(cells: Cell[], isReducedMotion: boolean): string { |
| 209 | let cache = isReducedMotion ? reducedMotionCssCache : cssCache; |
| 210 | let css = cache.get(cells); |
| 211 | if (css === undefined) { |
| 212 | const id = iconId(cells); |
| 213 | const total = loopFramesFor(cells); |
| 214 | css = |
| 215 | cells |
| 216 | .map( |
| 217 | (c, i) => |
| 218 | cellYKeyframes(`${id}-${i}-y`, c, total) + cellScaleKeyframes(`${id}-${i}-s`, c, total) |
| 219 | ) |
| 220 | .join('') + groupOpacityKeyframes(`${id}-group-o`, total, isReducedMotion); |
| 221 | cache.set(cells, css); |
| 222 | } |
| 223 | return css; |
| 224 | } |
| 225 | |
| 226 | export interface PixelLoaderProps { |
| 227 | /** |
no test coverage detected