.scene1 { position: relative; transform-style: preserve-3d; animation: rotateScene 15s infinite linear; }
.floor1 { position: absolute; top: 1em; transform: translate(-50%, -50%) rotateX(90deg); height: 15em; width: 15em; background-image: repeating-conic-gradient(from 45deg, #111 0deg 90deg, #222 90deg 180deg); background-size: 1em 1em; }
.scene2 { position: absolute; left: -1.5em; bottom: 1.5em; transform: translateY(50%); transform-style: preserve-3d; }
.cube { width: 200px; height: 200px; position: relative; transform-style: preserve-3d; transform: translateY(90deg); transition: transform 1s; }
.cube_face { position: absolute; width: 200px; height: 200px; border: 2px solid black; line-height: 200px; font-size: 40px; font-weight: bold; color: white; text-align: center; }
.front { background: hsla(0, 100%, 50%, 0.7); transform: rotateY(0deg) translateZ(100px); } .back { background: hsla(120, 100%, 50%, 0.7); transform: rotateY(180deg) translateZ(100px); } .right { background: hsla(60, 100%, 50%, 0.7); transform: rotateY(90deg) translateZ(100px); } .left { background: hsla(180, 100%, 50%, 0.7); transform: rotateY(-90deg) translateZ(100px); } .top { background: hsla(240, 100%, 50%, 0.7); transform: rotateX( 90deg) translateZ(100px); } .bottom { background: hsla(300, 100%, 50%, 0.7); transform: rotateX(-90deg) translateZ(100px); }
@keyframes rotateScene { to {transform: rotateY(360deg)} }