It seems like there is a lot of code to analyze, but I can give you some insight on how to reverse an animation. In the example provided:
@keyframes resizeCircle {
0% {
width: 60px;
}
100% {
width: 300px;
}
}
This code defines an animation that starts at a width of 60px and ends at 300px. To reverse this animation, one approach is to tie it to a temporary state like hovering:
element:hover {
animation:resizeCircle 1s all;
}
In this case, the animation will only occur when the element is being hovered over. Alternatively, you can create a separate animation with reverse property values:
@keyframes resizeCircle2 {
0% {
width: 300px;
}
100% {
width: 60px;
}
}
This new animation can be applied to a trigger selector:
element:target {
animation:resizeCircle2 1s all;
}
When the element is clicked (in this scenario), the reverse animation will take effect.