JSFiddle - React, Tailwind, and code Playground
CSS
body {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
transition: all 1s ease;
}
JavaScript
var c = ["#81d8d0", "#ffea64", "#89bc84", "#e5cb47", "#9d549c"];
var i = 0;
var myVar = setInterval(function () { myTimer() }, 1500);
function myTimer() {
document.getElementsByTagName('body')[0].style.background = c[i];
i = i + 1;
if (i >= c.length) i = 0;
}