Skip to content

Instantly share code, notes, and snippets.

@modeverv
Created March 23, 2019 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modeverv/f3a56b30d5ed6940ef722b29c2e2c808 to your computer and use it in GitHub Desktop.
Save modeverv/f3a56b30d5ed6940ef722b29c2e2c808 to your computer and use it in GitHub Desktop.
change color
<script>
var bgcolor = 0x0;
var body = document.getElementsByTagName('body')
var interval = setInterval(function(){
var value = "#" + ('000000' + (bgcolor++).toString(16)).slice(-6);
console.log(value);
body[0].style.backgroundColor = value;
if(0xffffff < bgcolor){
bgcolor = 0x0;
}
},1);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment