pointerEvents: 'auto', }, ], { duration: FADE_OUT_DURATION_MS, fill: DEFAULT_FILL, easing: DEFAULT_EASING, } ); animation.pause(); return animation; } /** @param {HTMLElement} element */ function fadeOutDown(element) { var animation = element.animate( [ { transform: 'translateY(0)', opacity: 1, pointerEvents: 'none', }, { transform: 'translateY(20px)', opacity: 0, pointerEvents: 'auto', }, ], { duration: FADE_OUT_DURATION_MS, fill: DEFAULT_FILL, easing: DEFAULT_EASING, } ); animation.pause(); return animation; } function handleFadeInEnd() { onAnimationComplete(oldStep, newStep); } function handleFadeOutEnd() { oldStep.element.classList.remove(stepActiveClass); oldStep.element.classList.add(stepHiddenClass); animateStepIn(); } function animateStepIn() { if (!newStep) { onNewStepAnimationStart(oldStep, newStep); handleFadeInEnd(); return; } var animation; if (animationConfig.in === 'fade-with-move') { animation = fadeInUp(newStep.element); } else { animation = fadeIn(newStep.element); } animation.finished.then(handleFadeInEnd); newStep.element.classList.remove(stepHiddenClass); newStep.element.classList.add(stepActiveClass); animation.play(); onNewStepAnimationStart(oldStep, newStep); } function animateStepOut() { var animation; if (animationConfig.out === 'fade-with-move') { animation = fadeOutDown(oldStep.element); } else { animation = fadeOut(oldStep.element); } animation.finished.then(handleFadeOutEnd); animation.play(); } onAnimationStart(oldStep, newStep); if (oldStep) {