Created
July 14, 2013 17:07
-
-
Save jarrodmedrano/5994956 to your computer and use it in GitHub Desktop.
tetrahedron gallery (tested in Chrome)
This file contains hidden or 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
/** | |
* tetrahedron gallery (tested in Chrome) | |
*/ | |
* { margin: 0; padding: 0; } | |
.gallery { | |
position: absolute; | |
top: 50%; left: 50%; | |
margin: -10em; | |
width: 20em; height: 20em; | |
transform-style: preserve-3d; | |
transform: rotateZ(-5deg) rotateX(-5deg) rotateY(0deg); | |
list-style: none; | |
animation: rot 8s infinite linear; | |
} | |
@keyframes rot { to { transform: rotateZ(-5deg) rotateX(-5deg) rotateY(360deg); } } | |
.gallery li, .gallery a, .gallery img { height: 100%; } | |
.gallery li { | |
overflow: hidden; | |
position: absolute; | |
bottom: 6.7%; left: 0; | |
/**/ | |
backface-visibility: hidden; | |
/**/ | |
transform-style: preserve-3d; | |
} | |
.gallery li:first-child { | |
/* translate value should be l*sqrt(3)/6 = 20em*.288675 = 5.7735em */ | |
/* so why doesn't that work out right? */ | |
transform: rotateY(180deg) rotateX(19.471221deg) translateZ(2.62em); | |
} | |
.gallery li:nth-child(2) { | |
transform: rotateY(60deg) rotateX(19.471221deg) translateZ(2.62em); | |
} | |
.gallery li:nth-child(3) { | |
transform: rotateY(-60deg) rotateX(19.471221deg) translateZ(2.62em); | |
} | |
.gallery li:nth-child(4) { transform: rotateX(-90deg); } | |
.gallery li:after { | |
display: block; | |
position: absolute; | |
bottom: 0; width: 100%; | |
color: white; | |
/** | |
content: 'booooo'; | |
/**/ | |
} | |
.gallery a, .gallery img { | |
display: block; | |
} | |
.gallery a { | |
overflow: hidden; | |
transform: translateY(50%) rotate(30deg) skewY(30deg) scaleX(.866); | |
} | |
.gallery img { | |
transform: scaleX(1.155) skewY(-30deg) rotate(-30deg) translateY(-50%); | |
} |
This file contains hidden or 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
<ul class='gallery'> | |
<li><a href='#'><img src='http://imgsrc.hubblesite.org/hu/db/images/hs-2006-01-q-web.jpg'></a></li> | |
<li><a href='#'><img src='http://imgsrc.hubblesite.org/hu/db/images/hs-2011-11-a-web.jpg'></a></li> | |
<li><a href='#'><img src='http://imgsrc.hubblesite.org/hu/db/images/hs-2011-17-a-web.jpg'></a></li> | |
<!--<li><a href='#'><img src='http://imgsrc.hubblesite.org/hu/db/images/hs-2012-29-a-web.jpg'></a></li>--> | |
</ul> |
This file contains hidden or 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
{"view":"split-vertical","fontsize":"80","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment