Created
March 28, 2012 13:55
-
-
Save dziudek/2226388 to your computer and use it in GitHub Desktop.
Rotating elements :)
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 :) | |
*/ | |
body > div { | |
background: #eee; | |
} | |
div > div { | |
width: 100px; | |
height: 100px; | |
background: #a00; | |
animation-name: rotateback; | |
animation-iteration-count: 1; | |
animation-duration: 0.5s; | |
animation-direction: alternate; | |
animation-fill-mode: both; | |
} | |
div:hover > div, | |
div > div.active { | |
animation-name: rotate; | |
animation-iteration-count: 1; | |
animation-duration: 0.5s; | |
animation-direction: alternate; | |
animation-fill-mode: both; | |
} | |
div:hover > div.active { | |
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> --> | |
<div> | |
<div class="activ">Lorem</div> | |
</div> |
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":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment