body {
    background-color: #DDD;
    margin: 0;
}

.bar-wrapper {
    perspective: 1000px;
    perspective-origin: 50% 50%;
    backface-visibility: visible;
    width: 400px;
    margin: auto;
}

.bar {
    position: relative;
    height: 100px;
    transition: all .3s ease-in-out;
    transform: rotateX(60deg);
    transform-style: preserve-3d;
}

.state,
.bar .face.left {
    background-color: rgba(0, 236, 105, .6);
}

.bar .face{
    position: relative;
    width: 100%;
    height: 64px;
    background-color: rgba(156, 147, 147, 0.2);
}

.state {
    width: 1%;
    height: 64px;
    transition: all .3s ease-in-out;
}

.bar .top {
    transform: translateY(128px) translateZ(64px);
}
.bar .back {
    transform: translateY(34px) translateZ(34px) rotateX(90deg);
}

.bar .left {
    transform: rotateX(90deg) rotateY(-90deg) translateX(64px) translateY(32px) translateZ(32px);
}

.bar .left,
.bar .right {
    width: 64px;
}

.bar .right {
    transform: rotateX(90deg) rotateY(-90deg) translateX(128px) translateY(32px) translateZ(-368px);
}

.bar .front {
    transform: rotateX(90deg) rotateY(0) translateX(0) translateY(32px) translateZ(162px);
}