In this survey form project, I want to add a popup saying “thank you” when the user fills the form and clicks the submit button (you are allowed to submit if you have checked agree and filled name, email, and postal code field ). PopUp should slide from top and stop in the middle of the page and remain there.
I have added pop-up using keyframe animations and a little javascript. Pop-up sits at the top in the<body>
and initially its is display:none
. When submit button is clicked pop display gets display:block
and animation class .pop-up-animation
is added to the pop-up using javascript.
The problem I am facing is that animation happens, however it does not retain its state when the animation ends. I have tried using animation-fill-mode: forwards;
(that is supposed to retain the last state of animation) but then no animation occurs at all.
link: code pen link
Please help!