Created
December 2, 2013 03:24
-
-
Save switchtrue/7744515 to your computer and use it in GitHub Desktop.
JavaScript to randomly make part of the screen comic sans and different colours. Purely used to annoy people that hate comic sans.
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
document.onclick = function () { | |
// get random table cells | |
var tdList = document.getElementsByTagName("td"); | |
var i = 0; | |
while ( i != tdList.length ) | |
{ | |
if ( Math.floor(Math.random() * 20) == 0 ) | |
{ | |
// PRETTIFY! | |
tdList[i].style.color = '#ff00ff'; | |
tdList[i].style.fontFamily = "Comic Sans MS"; | |
if ( tdList[i].innerHTML.indexOf(">") == -1 ) | |
{ | |
var newTag = '<marquee>' + tdList[i].innerText + '</marquee>'; | |
tdList[i].innerHTML = newTag; | |
} | |
} | |
i++; | |
} | |
var aList = document.getElementsByTagName("a"); | |
i = 0; | |
while ( i != aList.length ) | |
{ | |
if ( Math.floor(Math.random() * 5) == 0 ) | |
{ | |
// make "dynamic" | |
if ( aList[i].innerHTML.indexOf(">") == -1 ) | |
{ | |
var newTag = '<marquee>' + aList[i].innerText + '</marquee>'; | |
aList[i].innerHTML = newTag; | |
} | |
} | |
i++; | |
} | |
var buttonList = document.getElementsByTagName("input"); | |
i = 0; | |
while ( i != buttonList.length ) | |
{ | |
if ( Math.floor(Math.random() * 2) == 0 ) | |
{ | |
// make "clearer" | |
buttonList[i].style.padding = Math.ceil(Math.random()*50) + 'px' + ' ' + Math.ceil(Math.random()*50) + 'px'; | |
} | |
i++; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment