After much searching and failed attempts, I am determined to create a stationary cube-shaped bookcase using CSS. Can anyone offer some guidance on how I can achieve this? I have included an image of the design I want to replicate.
Thank you
.scene {
margin: 100px;
width: 150px;
height: 150px;
perspective: 600px;
}
.cube {
position: relative;
width: inherit;
height: inherit;
transform-style: preserve-3d;
transform: rotateY(180deg);
}
.cube-face {
width: inherit;
height: inherit;
position: absolute;
background: red;
opacity: 0.8;
}
.cube-face-front {
background: yellow;
transform: translate3d(0, 0, 150px/2);
}
.cube-face-back {
background: orange;
transform: rotateY(180deg) translate3d(0, 0, 150px/2);
}
.cube-face-left {
background: green;
transform: rotateY(-90deg) translate3d(0, 0, 150px/2);
}
.cube-face-right {
background: magenta;
transform: rotateY(90deg) translate3d(0, 0, 150px/2);
}
.cube-face-top {
background: blue;
transform: rotateX(90deg) translate3d(0, 0, 150px/2);
}
.cube-face-bottom {
background: red;
transform: rotateX(-90deg) translate3d(0, 0, 150px/2);
}
<div id="bookshelf" class="container-fluid">
<div class="scene">
<div class="cube">
<div class="cube-face cube-face-front"></div>
<div class="cube-face cube-face-back"></div>
<div class="cube-face cube-face-left"></div>
<div class="cube-face cube-face-right"></div>
<div class="cube-face cube-face-top"></div>
<div class="cube-face cube-face-bottom"></div>
</div>
</div>
</div>