Cube shading
Test, pure css / pseudo-element
<div class="container">
<div class="container">
<ul class="cube">
<li>
<h1>:hover</h1>
</li>
<li></li>
<li></li>
<li></li>
<li>
<h1>hi</h1>
</li>
<li></li>
</ul>
</div>
// VAR
// VAR
#39ed39;:
10em;:
10em;:
10em;:
.container{
position: absolute;
top: 50%;
left: 50%;
margin-top: -( /2);
margin-left: -( /2);
width: ;
height: ;
perspective: 500;
}
.cube{
cursor: pointer;
display:block;
width: 100%;
height: 100%;
transform-style: preserve-3d;
transform: rotate3d(0,1,0,0deg);
transition: transform 400ms ease-in-out;
}
.cube:hover {
transform: rotate3d(0,1,0,-75deg);
}
.cube:hover > li:nth-child(1)::after {
left: -30%;
right: 0;
transform: rotate3d(0,0,1,-90deg);
}
.cube:hover > li:nth-child(5)::after {
left: -25%;
right: 30%;
transform: rotate3d(0,0,1,-30deg);
}
.cube:hover > li:nth-child(2){
box-shadow: -1em -5em 15em 0em #666,
0 0 1.2em 0.1em #333;
}
li{
display:block;
position:absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
li:nth-child(1){
background:rgba(245,235,235,1);
transform:rotate(0deg) translateZ( /2);
}
li:nth-child(1)::after {
background-image: -webkit-linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(250,250,250,0) 80%);
content:"";
position: absolute;
top: -50%;
left: -100%;
right: -50%;
bottom: -50%;
transform: rotate3d(0,0,1,-45deg);
transition: all 300ms;
}
li:nth-child(2){
//background:rgba(0,0,0,1);
box-shadow: -4em -0.5em 10em 0em #999,
-0.2em 0 2em 0em #333;
transform:rotateX(-90deg) translateZ( /2);
transition: box-shadow 600ms;
}
li:nth-child(3){
background:rgba(255,255,255,1);
transform:rotateX(90deg) translateZ( /2);
}
li:nth-child(4){
background:rgba(255,255,255,1);
transform:rotateY(-90deg) translateZ( /2);
}
li:nth-child(5){
background:rgba(245,235,235,1);
transform:rotateY(90deg) translateZ( /2);
}
li:nth-child(5)::after {
background-image: -webkit-linear-gradient(0deg, rgba(0,0,0,0.5) 0%, rgba(250,250,250,0) 80%);
content:"";
position: absolute;
top: -50%;
left: -200%;
right: -50%;
bottom: -50%;
transform: rotate3d(0,0,1,0deg);
transition: all 300ms;
}
li:nth-child(6){
background:rgba(255,255,255,1);
transform:rotateY(180deg) translateZ( /2);
}
* {
margin: 0;
padding: 0;
}
html {
font-size: 100%;
}
ul{
list-style-type:none;
margin:0;
padding:0;
}
h1 {
color: rgb(162,123,204);
font-family: "Helvetica", Arial, sans-serif;
font-size: 95%;
text-align: center;
line-height: ;
width: 100%;
}