@proyecto26/animatable-component
Version:
Animate once, use Everywhere! 💫
20 lines (19 loc) • 595 B
JavaScript
import { ANIMATIONS } from './common';
import ANIMATE from './animate';
import ANIMISTA from './animista';
export const ANIMATION_KEY_ERROR = 'Animation not supported';
export { ANIMATIONS };
export const KEYFRAMES = Object.assign(Object.assign({ [ANIMATIONS.NONE]: [] }, ANIMATE), ANIMISTA);
/**
* Get the keyframes of the animation
* @param animation - Name of the animation.
*/
export function getKeyFramesByAnimation(animation) {
const keyFrames = KEYFRAMES[animation];
if (keyFrames !== undefined) {
return keyFrames;
}
else {
throw new Error(ANIMATION_KEY_ERROR);
}
}