How to control infinite CSS animations

“How to Control Infinite CSS Animations” title with Temani Afif’s name and avatar in a cap, next to three circular loader spinners: sharp purple, blurred middle, and faded cyan.

In part 1 of 2, Temani Afif shows how to speed up, slow down, and reverse infinite CSS animations on demand. He uses animation-composition: add to layer two animations, CSS variables for duration and a speed factor, and abs() and sign() functions to control velocity and direction independently, without restarting the animation.

frontendmasters.com/blog/how-to-control-infinite-css-animations-part-1-of-2