<section id="message">
<h1>Rainbow<br/>Goodness</h1>
<p>So this is currently set to color cycle every 175 seconds, which is the same as 60 seconds per color divided by two, or 30 seconds per color, assuming roygbiv, even though I only programmed Red, Green, and Blue. The timing itself should actually make it so that each color gets its time, as no color should be a rest, anyhow. Arguably I should have done more to get the full rainbow. We hardly touched the luminosity spectrum, although I think some of that does make it in.</p>
<p>The font color looping is based on a Cyan-Magenta-Yellow loop, as the opposite of RGB.</p></section>
body {
animation: colorchange 175s linear 1s infinite; /* animation-name followed by duration in seconds*/
/* you could also use milliseconds (ms) or something like 2.5s */
-webkit-animation: colorchange 175s linear 0s infinite alternate; /* Chrome and Safari */
}
@keyframes colorchange
{
0% {background: red; color: cyan;}
33% {background: green; color: magenta;}
66% {background: blue; color: yellow;}
100% {background: red; color: cyan;}
}
@-webkit-keyframes colorchange /* Safari and Chrome - necessary duplicate */
{
0% {background: red; color: cyan;}
33% {background: green; color: magenta;}
66% {background: blue; color: yellow;}
100% {background: red; color: cyan;}
}
section {
width: 33vw;
margin: 0 auto;
}
#message {
text-align: center;
color: inherit;
opacity: 75%;
mix-blend-mode: difference;
font-family: Cooper Black, Helvetica, Arial;
}
h1 {
font-size: 4.69em;
}
p {
font-size: 1.6em;
font-family: Helvetica Neue, Helvetica, Arial;
}
This Pen doesn't use any external CSS resources.