Created
October 28, 2014 08:41
-
-
Save IllusionMH/bbbfa9657ecd45b7aa7d to your computer and use it in GitHub Desktop.
Static interpolation via paused animations
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
/** | |
* Static interpolation via paused animations | |
* This technique becomes more useful if you need to interpolate more than 1 properties, and/or if you need multiple values in the spectrum | |
* Currently works in every modern browser except Safari | |
*/ | |
@keyframes foo { | |
from { background: red } | |
to { background: yellowgreen } | |
} | |
div { | |
display: inline-block; | |
width: 100px; height: 100px; | |
animation: foo 1s both linear; | |
animation-play-state: paused; | |
} | |
div:nth-of-type(2) { animation-delay: -.4s; } | |
div:nth-of-type(3) { animation-delay: -.4s; } | |
div:nth-of-type(4) { animation-delay: -.6s; } | |
div:nth-of-type(5) { animation-delay: -.8s; } | |
div:nth-of-type(6) { animation-delay: -1s; } |
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
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<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
// alert('Hello world!'); |
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","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment