npm.io
5.0.1 • Published 3 years ago

@zestia/animation-utils

Licence
MIT
Version
5.0.1
Deps
0
Size
3 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

@zestia/animation-utils

Utils for working with animations and transitions.

waitForAnimation

// Wait for animations to start and finish
await waitForAnimation(element);

// Wait for animations to finish, if there are any
await waitForAnimation(element, { maybe: true });

// Wait for animations to finish, including descendants
await waitForAnimation(element, { subtree: true });

// Wait for an animation to finish by name
await waitForAnimation(element, { animationName: 'fade-out' });

// Wait for a transition to finish by name
await waitForAnimation(element, { transitionProperty: 'margin-left' });

// Wait for an animation to finish by name, including descendants
await waitForAnimation(element, { subtree: true, animationName: 'move' });