Skip to content

Instantly share code, notes, and snippets.

@oli
Created April 15, 2013 11:55
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 oli/5387570 to your computer and use it in GitHub Desktop.
Save oli/5387570 to your computer and use it in GitHub Desktop.
animating background colors
/* animating background colors
color animation happens in RGBa space, so you can’t e.g. animate from hsl(0,50%,45%) to hsl(360,50%,45%) to get every color */
body {
background: #f06;
animation: bg alternate 10s infinite;
min-height: 100%;
}
@keyframes bg {
0% {background: rgb(172, 57, 57);}
20% {background: rgb(172, 172, 57);}
40% {background: rgb(57, 172, 57);}
60% {background: rgb(57, 172, 172);}
80% {background: rgb(57, 57, 172);}
100% {background: rgb(172, 57, 172);}
}
<!-- content to be placed inside <body>…</body> -->
// alert('Hello world!');
{"view":"split-vertical","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