JSFiddle - React, Tailwind, and code Playground
by timv88
HTML
<div class="animated_bg2">
content
</div>
<div class="animated_bg3">
content
</div>
CSS
div {
width: 300px;
height: 100px;
transition: background-color 500s linear;
}
.animated_bg2 {
-webkit-animation: animateBgColour2 2s infinite alternate;
animation: animateBgColour2 2s infinite alternate;
}
@-webkit-keyframes animateBgColour2 {
0% { background-color: #abebfe; }
33% { background-color: #aad667; }
66% { background-color: #57e6ee; }
100% { background-color: #ff7ebb; }
}
@keyframes animateBgColour2 {
0% { background-color: #abebfe; }
33% { background-color: #aad667; }
66% { background-color: #57e6ee; }
100% { background-color: #ff7ebb; }
}
.animated_bg3 {
-webkit-animation: animateBgColour3 6s infinite alternate;
animation: animateBgColour3 6s infinite alternate;
}
@-webkit-keyframes animateBgColour3 {
0% { background-color: #71a98b; }
20% { background-color: #b15c8e; }
40% { background-color: #dc6b68; }
60% { background-color: #6c5a94; }
80% { background-color: #b14c4e; }
100% { background-color: #736357; }
}
@keyframes animateBgColour3 {
0% { background-color: #71a98b; }
20% { background-color: #b15c8e; }
40% { background-color: #dc6b68; }
60% { background-color: #6c5a94; }
80% { background-color: #b14c4e; }
100% { background-color: #736357; }
}