The animation-direction property defines whether or not the animation should play in reverse on some or all cycles.
object.style.animationDirection = "value";
<'animation-direction'> = <single-animation-direction>#
<single-animation-direction> = normal | reverse | alternate | alternate-reverse
All iterations of the animation are played as specified. Intial.
All iterations of the animation are played in the reverse direction from the way they were specified.
The animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction.
The animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction.
World Wide Web Consortium (W3C)