Created
October 22, 2012 12:56
-
-
Save fregante/3931373 to your computer and use it in GitHub Desktop.
CSS transition after animation
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
/** | |
* CSS transition after animation | |
*/ | |
div { | |
transition: transform 1s; | |
} | |
div:hover { | |
transform: rotate(45deg); | |
} | |
div:active { | |
animation: rotate 3s infinite; | |
} | |
@keyframes rotate { | |
100% { | |
transform: rotate(360deg); | |
} | |
} | |
/*demo styles*/ | |
div { | |
transition: transform 1s; | |
height: 100px; | |
width: 100px; | |
margin: auto; | |
background: red; | |
border-top-right-radius: 100%; | |
} |
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> | |
<p>Hover on shape: it <strong>transitions</strong> into a 45deg rotation. | |
<p>Click and hold: it starts rotating (<code>animation</code>). | |
<p>Release click: it <strong>jumps</strong> back to 45deg rather than <strong>transitioning</strong> back to it, even if <code>transition</code> is set. | |
<p>In your <a href="http://lab.simurai.com/icons/" target="_blank">demo</a>, the arrow on the cloud seems to always <strong>ease</strong> back into its original position rather than jumping into it. <strong>How did you manage to do that?</strong> I tried understanding your code but I didn't find anything different than what I do. |
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","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