body { background-color: black; } #loadingDiv { box-sizing: border-box; font-family: "Open Sans", sans-serif; font-size: 1.4rem; color: lightsteelblue; text-align: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .scene { width: 200px; height: 200px; margin: auto; perspective: 200px; } .cube { width: 40px; height: 40px; position: relative; transform-style: preserve-3d; transform: translateZ(20px); left: 80px; top: 80px; } .cube.is-spinning { animation: spinCube 5s infinite ease-in-out; } @keyframes spinCube { 0% { transform: translateZ(20px) rotateX( 0deg) rotateY( 0deg); } 100% { transform: translateZ(20px) rotateX(360deg) rotateY(360deg); } } .face { position: absolute; width: 40px; height: 40px; padding: 0; background: hsla(240, 100%, 0%, 0.4); border: 1px solid hsla(240, 100%, 70%, 0.6); } .front { transform: rotateY( 0deg) translateZ(20px); } .right { transform: rotateY( 90deg) translateZ(20px); } .back { transform: rotateY(180deg) translateZ(20px); } .left { transform: rotateY(-90deg) translateZ(20px); } .top { transform: rotateX( 90deg) translateZ(20px); } .bottom { transform: rotateX(-90deg) translateZ(20px); } .cube.is-backface-hidden .face { backface-visibility: hidden; } .mino0 { left: -40px; top: -20px; } .mino1 { left: 0px; top: -20px; } .mino2 { left: 40px; top: -20px; } .mino3 { left: 0px; top: 20px; }