How to make completely reverse the animation?

Good day.
Trying to do all the reverse animation.
Now, on button click, the first is the animation is dimmable, it lasts 0.3 sec. After a delay in the same 0.3 seconds starts the next animation, the animation leaving the window shape and last it is also 0
,3s. Faltered with a reverse animation. How to do the same thing but in reverse when hiding.
  1. Form crawls up along with the disappearance
  2. After completing the first animation, the second, the lightening of the background.

April 19th 20 at 12:04
1 answer
April 19th 20 at 12:06
Solution
Ashamed that I had not thought of. Thank You, Maxim. - caesar_Cartwrig commented on April 19th 20 at 12:09

Find more questions by tags HTMLJavaScriptCSS