I'm trying to create a CSS animation that looks like a rotation around a picture or another div object around the "X" axis.
I managed to create a rough idea of it at: Codepen , but the animated div doesn’t have the rotation effect I'm looking for.
I think I need to add rotateX () to some element in order to convert and add perspective, but I just can’t understand what combination is needed. I attached an approximate image of such an animation, which I am trying to get.
Here is my current animation code:
@keyframes moveBack { 0%{transform:translateY(0); z-index:10;} 25%{transform:translateY(435px); z-index:10;} 26%{z-index:0;} 50%{transform:translateY(0) scale(.8); z-index:0;} 75%{transform:translateY(-435px); z-index:0;} 76%{z-index:10;} 100%{transform:translateY(0); z-index:10;} } Source: 3D Transform around the X axis
You can try to use the effect of CSS3 - 3D rotation, for example: transform:rotateX(-100deg); here's a link for more information - w3schools.com @ Kyle Pastor
