JSFiddle - React, Tailwind, and code Playground
by moob
HTML
<div class="bounds">
<ul class="container">
<li></li>
<li></li>
<li></li>
<li tabindex="1">Hi</li>
</ul>
</div>
CSS
body {
width:100%;
height:100vh;
background:#eee;
}
.bounds {
margin:0;
padding:0;
width:100%;
height:100vh;
display: flex;
justify-content: center;
align-items: center;
}
.container {
position:relative;
width:360px;
height:600px;
background:rgba(0,0,0,.05);
transform-style: preserve-3d;
transform: rotate(-30deg) skew(25deg) scale(0.8);
transition:0.5s;
list-style-type:none;
margin:150px 0 0 0;
padding:0;
}
.container li {
position:absolute;
width:100%;
height:100%;
transition:0.5s;
background: #00617f;
background: -moz-linear-gradient(top, #00617f 0%, #46014f 100%);
background: -webkit-linear-gradient(top, #00617f 0%,#46014f 100%);
background: linear-gradient(to bottom, #00617f 0%,#46014f 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00617f', endColorstr='#46014f',GradientType=0 );
font-family:sans-serif;
font-size:2em;
color:white;
display: flex;
justify-content: center;
align-items: center;
}
.container:hover li:nth-child(4){
transform: translate(160px, -160px);
opacity:1;
}
.container:hover li:nth-child(3){
transform: translate(120px, -120px);
opacity:.8;
}
.container:hover li:nth-child(2){
transform: translate(80px, -80px);
opacity:.6;
}
.container:hover li:nth-child(1){
transform: translate(40px, -40px);
opacity:.4;
}
.container:hover li:focus{
transform: translate(160px, -160px) rotate(0deg) skew(0deg) scale(1.1)!important
}