I'm trying to create a 3 sided pyramid using CSS. I'm not sure if this even possible!
I can create a 4 sided normal pyramid like the one below but I am stuck with the 3 sided and I have no idea how to do this.
This is what i have so far:
@-webkit-keyframes spin {
from { -webkit-transform: rotateY(0); }
to { -webkit-transform: rotateY(360deg); }
}
.pyramid-gyro {
position: absolute;
top: 100px;
left: 50%;
margin-left: -100px;
-webkit-perspective: 1000px;
-webkit-perspective-origin: 50% 100px;
}
.pyramid-axis {
position: relative;
width: 200px;
-webkit-transform-style: preserve-3d;
-webkit-animation: spin 16s infinite linear;
}
.pyramid-wall {
position: absolute;
border: 100px solid transparent;
}
.front {
bottom: -20px;
border-bottom: 200px solid red;
-webkit-transform: translateZ(25px) rotateX(30deg);
}
.back {
bottom: -20px;
border-bottom: 200px solid blue;
-webkit-transform: translateZ(-25px) rotateY(180deg) rotateX(30deg);
}
.left {
bottom: -20px;
left: 75px;
border-bottom: 200px solid green;
-webkit-transform: rotateY(270deg) translateX(-100px) rotateX(30deg);
-webkit-transform-origin: center left;
}
.right {
bottom: -40px;
right: 150px;
border-bottom: 200px solid orange;
-webkit-transform: rotateY(-270deg) translateX(100px) rotateX(30deg);
-webkit-transform-origin: top right;
}
.bottom {
width: 200px;
height: 200px;
background: #eec26f;
-webkit-transform: rotateX(90deg) translateY(100px);
-webkit-transform-origin: bottom center;
}
.shadow {
position: absolute;
top: 250px;
width: 0;
height: 0;
box-shadow: 0 0 50px 100px rgba(0,0,0,0.5);
-webkit-transform: rotateX(90deg) translateX(100px);
}
<div class="pyramid-gyro">
<div class="pyramid-axis">
<div class="pyramid-wall front"></div>
<div class="pyramid-wall back"></div>
<div class="pyramid-wall left"></div>
<div class="pyramid-wall right"></div>
<div class="bottom"></div>
<div class="shadow"></div>
</div>
</div>
Could someone please advice on this issue or point me in a right direction?
Thanks in advance.