Skip to content

Instantly share code, notes, and snippets.

@bernard-leech
Forked from csssecrets/dabblet.css
Created September 14, 2016 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bernard-leech/c31ee1fa7de92bf009fcdcf0bd8e96bb to your computer and use it in GitHub Desktop.
Save bernard-leech/c31ee1fa7de92bf009fcdcf0bd8e96bb to your computer and use it in GitHub Desktop.
Static interpolation via paused animations
/**
* 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: -.2s; }
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; }
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
// alert('Hello world!');
{"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