Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vtbag/utensil-drawer.
Pull out just the functions you need to craft seamless view transitions! vtbag.dev/tools/utensil-drawer
Something went wrong. Try again.
123456789101112131415161718192021222324export function pauseAllAnimations(scope: HTMLElement | Document) { (scope !== document ? scope.getAnimations({ subtree: true }) : scope.getAnimations()).forEach( (animation) => { const effect = animation.effect; const pseudo = effect?.pseudoElement; if (effect instanceof KeyframeEffect && pseudo?.startsWith('::view-transition-group')) { animation.pause(); } } );}
export function unPauseAllAnimations(scope: HTMLElement | Document) { (scope !== document ? scope.getAnimations({ subtree: true }) : scope.getAnimations()).forEach( (animation) => { const effect = animation.effect; const pseudo = effect?.pseudoElement; if (effect instanceof KeyframeEffect && pseudo?.startsWith('::view-transition-group')) { animation.play(); } } );}