0

CSS animation question

Hello, I was trying to make a website where you display an image. I wanted to have a sort of flip card flipping animation to show the rest of the images. The animation works but it’s a bit junky. If you could help, it would be very much appreciated. Here is the website I’ve been making: https://sololearn.com/compiler-playground/Wlxqk57g2B26/?ref=app Thank you

11th May 2025, 10:36 AM
The Coder
The Coder - avatar
8 Réponses
+ 2
The Coder why are you making it so complicated see only 3 line of js was needed:- https://sololearn.com/compiler-playground/WnU8LtQM8Aw3/?ref=app
11th May 2025, 11:22 AM
Alhaaz
Alhaaz - avatar
+ 2
I wanted to add more images in the div which the effects would apply to.
12th May 2025, 7:38 AM
The Coder
The Coder - avatar
+ 1
there is a way without using js, just use: img { content: url(); } img:hover { content: url(); }
11th May 2025, 4:06 PM
Mihaly Nyilas
Mihaly Nyilas - avatar
+ 1
Alhaaz Thanks but that wasn’t the effect I wanted. The effect I wanted was to make the image at the back goes to the front and replaces the front image.
12th May 2025, 7:36 AM
The Coder
The Coder - avatar
+ 1
Captain Thunder ⚡ Thank you for your comments. I did what you said but there wasn’t any visual difference.
12th May 2025, 7:37 AM
The Coder
The Coder - avatar
+ 1
Mihaly Nyilas Thanks but that wasn’t the effect I was looking for.
12th May 2025, 7:38 AM
The Coder
The Coder - avatar
0
The Coder Wrap the whole js code into window.onload =()=>{ // Your existing js code } It happens because the js code is running before the DOM or simply the window is loaded completely, Doing the above practice will remove the code as the js runs only after the window is loaded In Sololearn web preview, the JS part is not like a separate file , in that case you have to add a script tag of that js file into your HTML. Maybe this help
12th May 2025, 3:26 AM
Captain Thunder ⚡
Captain Thunder ⚡ - avatar
0
But this would create a whole new ui ... Maybe not what you needed, but cool enough and that ui is quite bit trending now
12th May 2025, 3:27 AM
Captain Thunder ⚡
Captain Thunder ⚡ - avatar