Created
January 21, 2012 16:13
-
-
Save geoffreycrofte/1653181 to your computer and use it in GitHub Desktop.
Animation values are strongest !
This file contains 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
/** | |
* Animation values are strongest ! | |
*/ | |
/* | |
* just hover the white space to stop the animation | |
* and and return the block to its original coordinates | |
*/ | |
html,body { height:100%; } | |
div { | |
position: absolute; | |
top:0; left:0; | |
width: 100px; height: 100px; | |
background: #999; | |
animation: 10s anim infinite; | |
transition: all 2s; /* see the block back to its original coordinates, and back again in last "animation" coordinates*/ | |
} | |
@keyframes anim { | |
0%, 100% { left: 0; top:0; } | |
25% { left: 200px; top:0 } | |
50% { left: 200px; top:200px } | |
75% { left:0; top:200px; } | |
} | |
body:hover div { | |
animation-play-state: paused; | |
top:0 !important; left:0 !important; | |
background: #ff9999; | |
} |
This file contains 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
<div> </div> |
This file contains 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","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment