1,409 bytes added
, 04:01, 4 November 2022
{{#css:
.scene {
width: 200px;
height: 200px;
perspective: 600px;
margin: 100px;
}
.cube {
width: 100%;
height: 100%;
position: relative;
transform-style: preserve-3d;
animation: rotatey 5s linear infinite;
}
.cube-face {
position: absolute;
width: 200px;
height: 200px;
}
.face-front { transform: rotateY( 0deg) translateZ(100px); }
.face-right { transform: rotateY( 90deg) translateZ(100px); }
.face-back { transform: rotateY(180deg) translateZ(100px); }
.face-left { transform: rotateY(-90deg) translateZ(100px); }
.face-top { transform: rotateX( 90deg) translateZ(100px); }
.face-bottom { transform: rotateX(-90deg) translateZ(100px); }
@keyframes rotatey {
0% { transform: rotate3d(0, 0, 1, 0deg); }
100% { transform: rotate3d(1, 0, 1, 360deg); }
}
/* most of the css was taken from https://3dtransforms.desandro.com/cube */
}}
<div class="scene">
<div class="cube">
<div class="cube-face face-front">[[File:Chickensquare.png|frameless|200x200px]]</div>
<div class="cube-face face-back">[[File:Chickensquare.png|frameless|200x200px]]</div>
<div class="cube-face face-right">[[File:Chickensquare.png|frameless|200x200px]]</div>
<div class="cube-face face-left">[[File:Chickensquare.png|frameless|200x200px]]</div>
<div class="cube-face face-top">[[File:Chickensquare.png|frameless|200x200px]]</div>
<div class="cube-face face-bottom">[[File:Chickensquare.png|frameless|200x200px]]</div>
</div>