I've made some adjustments to your code for better clarity and functionality.
To streamline the code, I removed non-essential elements like titles, videos, and most images unrelated to the Y-axis flipping problem.
For demonstration purposes, I utilized placeholder.com's image placeholders of varying resolutions.
The structure of the elements was altered significantly. Here is a snippet comparing the old and new versions:
<div class="album">
<img class="album-photos" src="Images/Photos/pic1.jpg" onclick="flip(this)">
...
</div>
was transformed into this:
<div class="album">
<div class="imgContainer">
<div class="imgHolder" onclick="flip(this)">
<img class="album-photos" src="https://via.placeholder.com/350x650">
<div class="infoHolder flipped"&rt;Lorem ipsum<br&rt;2022-12-20</div>
</div>
</div>
.....
</div>
This rearrangement allows for maintaining existing CSS while introducing a simulated 'back' to the images using div.infoHolder
.
Furthermore, the JavaScript was updated to handle toggling the .flipped
class for both the image and its corresponding information container simultaneously.
While the example provided may not be perfect, it serves as a good starting point for implementing similar functionality in your project.
Refer to this Stack Overflow answer for a more advanced illustration of image flipping on hover.