<link href='https://fonts.googleapis.com/css?family=Gafata|Roboto:700' rel='stylesheet' type='text/css'>
<div class="scene">
<div class="cube">
<span class="side top">Top</span>
<span class="side front">Front</span>
</div>
</div>
body {
background: #222229;
}
.scene {
perspective: 1000;
width: 10em;
position: absolute;
top: 50%;
left: 50%;
margin-left: -5em;
margin-top: -5em;
}
.cube {
color: #ccc;
cursor: pointer;
font-family: 'Roboto', sans-serif;
transition: all 0.85s cubic-bezier(.17,.67,.14,.93);
transform-style: preserve-3d;
transform-origin: 100% 50%;
width: 10em;
height: 4em;
&:hover {
transform: rotateX(-90deg);
}
}
.side {
box-sizing: border-box;
position: absolute;
display: inline-block;
height: 4em;
width: 10em;
text-align: center;
text-transform: uppercase;
padding-top: 1.5em;
}
.top {
background: #fff;
color: #222229;
transform: rotateX(90deg) translate3d(0, 0, 2em);
}
.front {
background: #222229;
color: #fff;
box-shadow: inset 0 0 0 5px #fff;
transform: translate3d(0, 0, 2em);
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.