One of the optional animation properties that is very important to understand is animation-fill-mode. The values you can set this property to are
This property defines whether or not changes made to properties during the animation persist after the animation. The default is
none, which means any styles added during the animation go away once it ends.
animation-fill-mode: forwards; will ensure that any changes made during the animation persist after it.