Skip to content

Instantly share code, notes, and snippets.

@dantz
Created October 5, 2012 10:15
Show Gist options
  • Select an option

  • Save dantz/3839069 to your computer and use it in GitHub Desktop.

Select an option

Save dantz/3839069 to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.browser {
width: 200px;
height: 150px;
position: relative;
perspective: 1000;
margin-top: 50px;
margin-left: 50px;
}
.browser div {
position: absolute;
width: 100%;
height: 100%;
-webkit-transform-style: preserve-3d;
transition: all 500ms ease-out;
}
.browser:hover div:nth-child(1) {
transform: rotateY(45deg) translateZ(0px);
}
.browser:hover div:nth-child(2) {
transform: rotateY(45deg) translateZ(80px);
}
.browser:hover div:nth-child(3) {
transform: rotateY(45deg) translateZ(160px);
}
.browser:hover div:nth-child(4) {
transform: rotateY(45deg) translateZ(240px);
}
<div class="browser">
<div style="background-color: #f00"></div>
<div style="background-color: #0f0"></div>
<div style="background-color: #00f"></div>
<div style="background-color: #f0f"></div>
</div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment