Created
November 17, 2017 00:49
-
-
Save anonymous/02a50b247bc4702bed34a1d30e2fbd80 to your computer and use it in GitHub Desktop.
Running a script to change the web page color at each refresh interval. Using Easy Auto Refresh https://chrome.google.com/webstore/detail/easy-auto-refresh/aabcgdmkeabbnleenpncegpcngjpnjkc
This file contains 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
document.querySelector('body'); | |
function getRandomColor() { | |
var letters = '0123456789ABCDEF'; | |
var color = '#'; | |
for (var i = 0; i < 6; i++) { | |
color += letters[Math.floor(Math.random() * 16)]; | |
} | |
return color; | |
} | |
setTimeout(() => { | |
document.querySelector('body').style.background = getRandomColor(); | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment