I am trying to trigger an animation with a single class, and then have that animation play in reverse when the class is removed.
To better explain, I have created a CodePen example of my current progress.
In the CodePen, you can see that when the class .zoom
is removed from the element #box
, it simply disappears. Instead, I want the animation to play in reverse when the class is removed.
Is there a way to smoothly transition between the animation playing forward and in reverse using just one animation class? Typically, I would use transitions, but they don't work with transforms.