← All elements
<div class="pc-cube" role="status" aria-label="Loading">
<i></i><i></i><i></i><i></i><i></i><i></i>
</div>About this animation
A glassy cube loader built from six transformed faces that turns in 3D with one keyframe animation.
How it works
Six square faces are placed around a centre point with rotateX and rotateY plus translateZ of half the cube size, which builds a cube. The parent has transform-style: preserve-3d so the faces stay in 3D space, and a single keyframe rotates the whole cube a full turn around its vertical axis with a perspective.
Ways to customise it
- Change --pc-s to scale the cube.
- Edit the rgba fill and border colours for another look.
- Change the 6s duration to spin faster or slower.
Good to know
The role=status label says it is loading, but add a visible message where you can. Spinning 3D shapes should respect prefers-reduced-motion, so consider pausing the animation for users who ask for less motion.
Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.