MCPcopy Create free account
hub / github.com/adobe/react-spectrum / emitKeyframes

Function emitKeyframes

packages/@react-spectrum/ai/src/loader/react.tsx:71–82  ·  view source on GitHub ↗
(name: string, stops: Stop[])

Source from the content-addressed store, hash-verified

69type Stop = {f: number; decl: string; ease?: readonly number[] | null};
70
71function 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
84const ty = v => `transform:translateY(${v}px);`;
85const op = v => `opacity:${v};`;

Callers 2

cellYKeyframesFunction · 0.85
cellOpacityKeyframesFunction · 0.85

Calls 2

pctFunction · 0.85
cbFunction · 0.70

Tested by

no test coverage detected