Created
March 28, 2012 14:13
-
-
Save dziudek/2226522 to your computer and use it in GitHub Desktop.
Rotating elements - list :)
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
/** | |
* Rotating elements - list :) | |
*/ | |
ul { | |
margin:0; | |
padding:0; | |
} | |
ul li { | |
float:left; | |
list-style-type:none; | |
margin-right: 20px; | |
} | |
ul li span { | |
display:block; | |
text-align: center; | |
padding: 10px 0; | |
} | |
ul li div { | |
width: 100px; | |
height: 100px; | |
background: #a00; | |
animation-name: rotateback; | |
animation-iteration-count: 1; | |
animation-duration: 0.65s; | |
animation-direction: alternate; | |
animation-fill-mode: both; | |
text-indent: -9999px; | |
border-radius: 50%; | |
} | |
ul li:hover div, | |
ul li.active div { | |
animation-name: rotate; | |
animation-iteration-count: 1; | |
animation-duration: 0.65s; | |
animation-direction: alternate; | |
animation-fill-mode: both; | |
} | |
ul li.active:hover div { | |
animation-duration: 0s; | |
} | |
@keyframes rotate { | |
from { transform: rotateY(0deg); background: #a00; } | |
49% { background: #a00; } | |
50% { transform: rotateY(90deg); background: #0a0; } | |
to { transform: rotateY(0deg); background: #0a0; } | |
} | |
@keyframes rotateback { | |
from { transform: rotateY(0deg); background: #0a0; } | |
49% { transform: rotateY(90deg); background: #0a0; } | |
50% { background: #a00; } | |
to { transform: rotateY(0deg); background: #a00; } | |
} |
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
<!-- content to be placed inside <body>…</body> --> | |
<ul> | |
<li class="active"><div>Icon</div><span>Lorem</span></li> | |
<li><div>Icon</div><span>Ipsum</span></li> | |
<li><div>Icon</div><span>Dolor</span></li> | |
<li><div>Icon</div><span>Sit</span></li> | |
<li><div>Icon</div><span>Amet</span></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","seethrough":"","prefixfree":"1","page":"html"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment