Loaders & patterns
Flipping loader
Pure CSSThe classic square loader: half a turn on X, then half a turn on Y.
Three nested rings, each spinning on a different axis — the rotations compound.
Your edited version
transform-style: preserve-3d or the chain flattens there.nested preserve-3done axis per leveldifferent durations<div class="scene">
<div class="gyro">
<div>
<div>
<b></b>
</div>
</div>
</div>
</div>
.scene {
perspective: 800px;
}
.gyro,
.gyro div {
display: grid;
place-items: center;
border: 4px solid #8b6cff;
border-radius: 50%;
transform-style: preserve-3d;
}
.gyro {
width: 220px;
height: 220px;
animation: gyro-x 6s linear infinite;
}
.gyro div {
width: 84%;
height: 84%;
}
.gyro > div {
border-color: #2ee6d6;
animation: gyro-y 4s linear infinite;
}
.gyro > div > div {
border-color: #ff4d9d;
animation: gyro-x 2.6s linear infinite reverse;
}
.gyro b {
width: 34%;
height: 34%;
border-radius: 50%;
background: radial-gradient(circle at 35% 35%, #fff, #ffb547 60%);
box-shadow: 0 0 22px #ffb547;
}
@keyframes gyro-x { to { transform: rotateX(360deg); } }
@keyframes gyro-y { to { transform: rotateY(360deg); } }
.d-gyro {
width: 170px;
height: 170px;
animation: d-gyro-x 6s linear infinite;
&,
div {
display: grid;
place-items: center;
border: 4px solid var(--accent);
border-radius: 50%;
transform-style: preserve-3d;
}
// Each level spins on its own axis, inside the already-spinning level above it.
div {
width: 84%;
height: 84%;
}
> div {
border-color: var(--accent-2);
animation: d-gyro-y 4s linear infinite;
> div {
border-color: var(--hot);
animation: d-gyro-x 2.6s linear infinite reverse;
}
}
b {
width: 34%;
height: 34%;
border-radius: 50%;
background: radial-gradient(circle at 35% 35%, #fff, var(--warm) 60%);
box-shadow: 0 0 22px var(--warm);
}
}
@keyframes d-gyro-x {
to {
transform: rotateX(360deg);
}
}
@keyframes d-gyro-y {
to {
transform: rotateY(360deg);
}
}