I have this 3d rotating text css animation working on chrome desktop, but it won't work on mobile. I tried adding webkit prefixes but nothing will get it to work on iphone. Any obvious reasons why?
https://codepen.io/warpigs666/pen/bGqQbzL
@keyframes turn {
from { transform: rotate3d(0, 0, 0, 0); }
to { transform: rotate3d(1, 0, 0, 360deg); }
}
.container {
width: 2rem;
height: 2rem;
perspective: 1000px;
margin: 100px;
}
.cube {
position: relative;
width: 2rem;
height: 2rem;
transform-style: preserve-3d;
animation: turn 3s linear infinite;
}
.face {
height: 2rem;
background: white;
backface-visibility: hidden;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
font-family: Arial, sans-serif;
font-size: 2rem;
transition: transform 500ms;
}
.top {
transform: translateY(-1rem) rotateX(90deg);
}
.front {
transform: translateZ(1rem);
}
.bottom {
transform: translateY(1rem) rotateX(-90deg);
}
.back {
transform: translateZ(-1rem) rotateX(180deg);
}
@media (prefers-reduced-motion: reduce) {
.cube {
animation: none;
transform: rotate3d(1, 1, 0, 45deg);
}
}