Skip to content

Instantly share code, notes, and snippets.

@mishunov
Created March 29, 2012 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mishunov/2243615 to your computer and use it in GitHub Desktop.
Save mishunov/2243615 to your computer and use it in GitHub Desktop.
Flipp down cell
/**
* Flipp down cell
*/
body {
background: Olive;
}
.cell {
background: #444;
width: 200px;
height: 200px;
position: relative;
text-align: center;
perspective: 1000px;
}
#flip-down {
width: 200px;
height: 200px;
background: Orange;
position: absolute;
bottom: 0;
left: 0;
transition: transform .5s ease-in;
transform-origin: 50% 100% 0;
perspective-origin: 0% 0%;
}
.back {
background: Black;
position: absolute;
bottom:0;
left: 0;
width: 200px;
height: 200px;
transition: transform .5s ease-in;
transform-origin: 50% 100% 0;
}
.cell:hover #flip-down,
.cell:hover .back,
#flip-down:hover,
#flip-down:hover + .back {
transform-style: preserve-3d;
transform: rotateX(-180deg);
transition: transform .3s cubic-bezier(.94,.66,.86,1.52);
}
.cell:hover #flip-down,
#flip-down:hover {
backface-visibility: hidden;
}
<div class="cell">Hello World!<div class="back"></div><div id="flip-down" class="front">just a test</div></div>
{"view":"split-vertical","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment