Created
July 1, 2014 19:46
-
-
Save anonymous/b55bd85ea3faf18faf6d to your computer and use it in GitHub Desktop.
A Pen by Lionel T.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.base | |
-(1..9).each do |i| | |
.cube |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$red : #f66; | |
$blue: #05afd1; | |
$c: $blue; // Main color | |
$size: 12px; | |
body { | |
background-color: #dedede; | |
font-size: $size; | |
} | |
.base { | |
height: 9em; | |
left: 50%; | |
margin: -7.5em; | |
padding: 3em; | |
position: absolute; | |
top: 50%; | |
width: 9em; | |
transform: rotateX(45deg) rotateZ(45deg); | |
transform-style: preserve-3d; | |
} | |
.cube, | |
.cube:after, | |
.cube:before { | |
content: ''; | |
float: left; | |
height: 3em; | |
position: absolute; | |
width: 3em; | |
} | |
/* Top */ | |
.cube { | |
background-color: $c; | |
position: relative; | |
transform: translateZ(3em); | |
transform-style: preserve-3d; | |
transition: .25s; | |
box-shadow:13em 13em 1.5em rgba(0,0,0,0.1); | |
&:after { // Left | |
background-color: shade($c, 10); | |
transform: rotateX(-90deg) translateY(3em); | |
transform-origin: 100% 100%; | |
} | |
&:before { // Right | |
background-color: shade($c, 20); | |
transform: rotateY(90deg) translateX(3em); | |
transform-origin: 100% 0; | |
} | |
animation: anim 1s infinite; | |
@for $i from 1 to 10 { | |
&:nth-child(#{$i}){ | |
animation-delay:#{$i * .05s} | |
} | |
} | |
} | |
@keyframes anim { | |
50% { transform: translateZ(0.5em); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment