Last active
March 3, 2016 17:38
-
-
Save UVLabs/c09014208c33c6752820 to your computer and use it in GitHub Desktop.
Automatically cycle css colors. Property used here was color for text color. Could be replaced with "background" for background color of an element.
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
.element{ | |
animation: colorchange 5s linear infinite; /* animation-name followed by duration in seconds*/ | |
/* you could also use milliseconds (ms) or something like 2.5s */ | |
-webkit-animation: colorchange 5s linear infinite; /* Chrome and Safari */ | |
-moz-animation: colorchange 5s linear infinite; /* Firefox */ | |
-o-animation: colorchange 5s linear infinite; /* Opera */ | |
} | |
@keyframes colorchange | |
{ | |
0% {color: yellow;} | |
25% {color: lime;} | |
50% {color: yellow;} | |
75% {color: #F05458;} | |
100% {color: yellow;} | |
} | |
@-webkit-keyframes colorchange /* Safari and Chrome - necessary duplicate */ | |
{ | |
0% {color: yellow;} | |
25% {color: lime;} | |
50% {color: yellow;} | |
75% {color: #F05458;} | |
100% {color: yellow;} | |
} | |
@-moz-keyframes colorchange /* Firefox - necessary duplicate */ | |
{ | |
0% {color: yellow;} | |
25% {color: lime;} | |
50% {color: yellow;} | |
75% {color: #F05458;} | |
100% {color: yellow;} | |
} | |
@-o-keyframes colorchange /* Opera - necessary duplicate */ | |
{ | |
0% {color: yellow;} | |
25% {color: lime;} | |
50% {color: yellow;} | |
75% {color: #F05458;} | |
100% {color: yellow;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment