Created
December 5, 2012 19:40
-
-
Save dziudek/4218826 to your computer and use it in GitHub Desktop.
Image :hover animation II
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
/** | |
* Image :hover animation II | |
*/ | |
figure { | |
height: 300px; | |
overflow: hidden; | |
perspective: 600; | |
position: relative; | |
width: 400px; | |
} | |
figure img { | |
transform: rotateX(0deg) scale(1.0); | |
transition: transform 0.3s ease-out; | |
} | |
figure figcaption { | |
background: #212121; | |
color: #fff; | |
display: block; | |
font-family: Georgia, serif; | |
font-size: 28px; | |
height: 300px; | |
left: 0; | |
line-height: 300px; | |
position: absolute; | |
text-align: center; | |
top: 0; | |
transition: transform 0.3s ease-out; | |
transform: rotateX(-95deg) scale(0.5); | |
transform-origin: 50% 100%; | |
width: 400px; | |
} | |
/* :hover state */ | |
figure:hover img { | |
transform: rotateX(25deg) scale(0.9); | |
} | |
figure:hover figcaption { | |
transform: rotateX(0deg) scale(1.0); | |
} |
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
<figure> | |
<img src="http://placekitten.com/400/300" /> | |
<figcaption>Lorem ipsum dolor sit amet</figcaption> | |
</figure> |
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
// alert('Hello world!'); |
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","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment