Skip to content

Instantly share code, notes, and snippets.

@maxw3st
Forked from LeaVerou/dabblet.css
Created October 28, 2014 00:35
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 maxw3st/01755423328cad9f4cef to your computer and use it in GitHub Desktop.
Save maxw3st/01755423328cad9f4cef 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
*/
@keyframes foo {
from { background: red }
to { background: yellowgreen }
}
div {
display: inline-block;
width: 100px; height: 100px;
animation: foo 1s both linear infinite;
animation-play-state: running;
}
div:hover {
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