In the process of enhancing a website, I am interested in incorporating a feature that involves multiple cards with both front and back sides (each containing separate images). Initially, the plan is to display only the front side of the card. Upon clicking on the card, the goal is to make it rotate 360 degrees multiple times between the front and back before eventually showcasing the front side as a modal. It is also desired for this animation to reverse when the modal is closed.
Here is an example of what I am aiming for =>
Below is the basic HTML structure of the card:
<div class="card">
<a class="card-img card-img-front" href="front.jpg">
<img src="front.jpg" alt="Front of card">
</a>
<a class="card-img card-img-back" href="back.jpg">
<img src="back.jpg" alt="Back of card">
</a>
</div>
I am open to utilizing libraries for this task. Any suggestions or ideas on how to approach this?
My attempt using the Fancybox library was successful in creating the modal upon clicking the front part of the image, but I encountered challenges when trying to implement the back side, specifically the 360 rotation animation.