JSFiddle - React, Tailwind, and code Playground

HTML

<div class="tile out">
</div>
<div class="tile in-top">
</div>
<div class="tile in-bottom">
</div>

CSS

.tile {
    position:absolute;
    width:200px;
    height:100px;
    margin:20px;
    top: 150px;
}

.out {
     background:red;  
    z-index: 1;
     -webkit-animation: open-card 0.75s ease 0s infinite alternate;
}

.in-top {
background: yellow;    
      z-index: -1;
}

.in-bottom {
 background: blue;   
    z-index: -1;
}

@-webkit-keyframes open-card {
    from {
       -webkit-transform: perspective(10000) rotateX(0deg);
       -webkit-transform-origin: 0% 0%;
    }
    to {
       -webkit-transform: perspective(10000) rotateX(180deg);
        -webkit-transform-origin: 0% 0%;
    }
}