JSFiddle - React, Tailwind, and code Playground

by christianmenz

HTML

<div class="canvas">
    <div class="side"></div>
</div>

CSS

@-webkit-keyframes spin-anim {
    from {
        -webkit-transform: translateZ(0);
    }
    to {
        -webkit-transform: translateZ(150px);
    }
}
@keyframes spin-anim {
    from {
        transform: translateZ(0px);
    }
    to {
        transform: translateZ(150px);
    }
}
.canvas {
    width:250px;
    height:250px;
    background-color:black;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    -webkit-perspective: 500px;
    perspective: 500px;
}
.side {
    margin:50px;
    background-color:blue;
    width:150px;
    height:150px;
    -webkit-animation: spin-anim 3s infinite linear;
    animation: spin-anim 10s infinite linear;
}