Created
August 1, 2012 13:24
-
-
Save andrewdh/3226829 to your computer and use it in GitHub Desktop.
Animated CSS hover effect
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
/** | |
* Animated CSS hover effect | |
Replicate: | |
http://www.vanschneider.com/ */ | |
body { | |
background-color: #000; | |
} | |
a { | |
text-decoration: none; | |
background-color: #000; | |
float: left; | |
position: relative; | |
overflow :hidden; | |
} | |
a:before { | |
content: "+"; | |
font-size: 5rem; | |
text-align: center; | |
line-height: 7rem; | |
position: absolute; | |
z-index: 1; | |
width: 7rem; | |
height: 7rem; | |
border-radius: 50%; | |
bottom: 0; | |
left: 50%; | |
margin-left: -3.5rem; | |
margin-bottom: -3.5rem; | |
background: hsla(0,0%,0%,.8); | |
color: hsla(0,100%,100%,1); | |
opacity: 0; | |
transition: all 1s ease; | |
} | |
img { | |
opacity: 0.5; | |
display: block; | |
transition: all | |
.8s ease; | |
position: relative; | |
} | |
a:hover img { | |
opacity: 1; | |
} | |
a:hover:before { | |
bottom: 50%; | |
opacity: 1; | |
transform: rotate(180deg); | |
} | |
a > h2 { | |
font-family: serif; | |
font-size: 1.3em; | |
letter-spacing: 0.1em; | |
text-transform: uppercase; | |
font-weight: 400; | |
text-align: center; | |
width: 100%; | |
margin: 0; | |
padding: 1rem 0; | |
position: absolute; | |
bottom: 0; | |
z-index: 2; | |
background-color: hsla(0,0%,10%,1); | |
color: hsla(0,0%,85%,1); | |
} |
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
<a href="#"> | |
<img src="http://lorempixel.com/300/400/abstract/10"/> | |
<h2>Item Title</h2> | |
</a> |
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":"separate","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