timered-counter
Version:
Make the value change more vivid and natural
19 lines • 651 B
JavaScript
export function polyfillKeyframes(keyframes) {
if (Array.isArray(keyframes)) {
return keyframes;
}
const properties = Object.keys(keyframes);
const length = Math.max(...properties.map(property => keyframes[property].length));
const result = [];
for (let i = 0; i < length; i++) {
const frame = {};
properties.forEach(property => {
const values = keyframes[property];
frame[property] =
values[i] !== undefined ? values[i] : values[values.length - 1];
});
result.push(frame);
}
return result;
}
//# sourceMappingURL=polyfill-keyframes.js.map