Created
October 19, 2016 02:06
-
-
Save nathancyam/23635f84632fff5dfdb5617158e472ad to your computer and use it in GitHub Desktop.
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
function disco() { | |
function randomElement(arr) { | |
return arr[Math.floor(Math.random() * (arr.length - 1))]; | |
} | |
var blocks = Array.prototype.slice.call(document.querySelectorAll("#wallboard .build > .result")); | |
var colours = ["pink", "blue", "white", "purple", "grey", "red", "yellow"]; | |
var randomBlock = randomElement(blocks) | |
randomBlock.style.background = randomElement(colours); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment