Check out example codes for "animation direction css". It will help you in understanding the concepts better.

Code Example 1

div {
  animation-direction: alternate;

Code Example 2

animation-direction  can have the following values -
(1) normal : forward direction, this is the default value.
(2) reverse : the animation sets in the reverse direction ( backward ).
(3) alternate : the animation plays normal first and then reverse.
(4) alternate-reverse: the animation plays reverse first and then normal.

NOTE: animation-duration also matters in animation-direction.

Learn ReactJs, React Native from