animate-sequence.mjs 532 B

12345678910111213
  1. import { GroupAnimationWithThen } from 'motion-dom';
  2. import { createAnimationsFromSequence } from '../../sequence/create.mjs';
  3. import { animateElements } from './animate-elements.mjs';
  4. function animateSequence(definition, options) {
  5. const animations = [];
  6. createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => {
  7. animations.push(...animateElements(element, keyframes, transition));
  8. });
  9. return new GroupAnimationWithThen(animations);
  10. }
  11. export { animateSequence };