I have a keyframe animation with multiple steps:
@keyframes rotateLeftSideCustom {
0% {
}
40% {
-webkit-transform: rotateY(-15deg);
transform: rotateY(-15deg);
opacity: .8;
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
100% {
-webkit-transform: scale(0.8) translateZ(-200px);
transform: scale(0.8) translateZ(-200px);
opacity: 0;
}
}
.section-animation {
-webkit-transform-origin: 100% 50%;
transform-origin: 100% 50%;
-webkit-animation: rotateLeftSideCustom 0.6s both ease-in;
animation: rotateLeftSideCustom 0.6s both ease-in;
}
Is there any way I can use JavaScript to set the progress of the animation?
Eg:
document.querySelector('.section-animation').animationState('40%');
Context: I'm trying to build a draggable interface where I need to align the progress of the animation with the amount of dragging the user does.