Created
April 25, 2018 14:23
-
-
Save koenverburg/954055611bd2c096b1195e4e02e7fc2d to your computer and use it in GitHub Desktop.
Tripping
This file contains hidden or 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
(function() { | |
var ds = []; | |
function addtods(nodes) { | |
for (var i in nodes) { | |
ds.push(nodes[i]); | |
} | |
} | |
setInterval(function () { | |
ds = []; | |
addtods(document.getElementsByTagName('div')); | |
addtods(document.getElementsByTagName('span')); | |
addtods(document.getElementsByTagName('a')); | |
addtods(document.getElementsByTagName('li')); | |
addtods(document.getElementsByTagName('ul')); | |
addtods(document.getElementsByTagName('textarea')); | |
addtods(document.getElementsByTagName('input')); | |
document.body.style.backgroundColor = '#' + (Math.random() * 0xFFFFFF << 0).toString(16); | |
document.body.style.color = '#' + (Math.random() * 0xFFFFFF << 0).toString(16); | |
for (var i in ds) { | |
if (ds[i] && ds[i].style) { | |
ds[i].style.backgroundColor = '#' + (Math.random() * 0xFFFFFF << 0).toString(16); | |
ds[i].style.color = '#' + (Math.random() * 0xFFFFFF << 0).toString(16); | |
ds[i].style.borderColor = '#' + (Math.random() * 0xFFFFFF << 0).toString(16); | |
} | |
} | |
}, 10); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment