DEV Community

Cover image for Rainbow Webpage
MAFEE7
MAFEE7

Posted on

Rainbow Webpage

Want To Add A Hidden Feature In Your Webpage For Users to Discover? Do This:

Rainbow Webpage

var i = 0; // Define varible "i"
setInterval(function(){
  document.body.style.filter = `hue-rotate(${i}deg)`; // Set Hue Of Page To i
  if(i == 360){ 
    i = 0; // Set i to 0
  } else{
    i = i + 2; // Change i by 2
  }
}, 60);
Enter fullscreen mode Exit fullscreen mode

enjoy!

Discussion (0)