diff --git a/index.html b/index.html index 5e82cbe3..2dc0539e 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,10 @@ Checkerboard +
+ +
- \ No newline at end of file + diff --git a/script.js b/script.js index 9233771b..521367fa 100644 --- a/script.js +++ b/script.js @@ -1 +1,27 @@ -// Your JS goes here \ No newline at end of file +var divContainer = document.createElement('div'); + +function colorPicker (){ + var stri = 'ABCDEFGHIJKLMN'.split('') ; + var color = '#'; + for (var i=0; i<6; i++){ + color += stri[Math.floor(Math.random()*6)]; + } + return color; +}; + + +colorFlasher(); + + +function colorFlasher (){ + document.getElementsByTagName('body')[0].innerHTML = "" + for(var i = 0;i<63;i++){ + var divColor = document.createElement('div'); + divColor.style.backgroundColor= colorPicker(); + divColor.style.width = '11.1%' + divColor.style.paddingBottom = '11.1%'; + divColor.style.float = 'left'; + document.getElementsByTagName('body')[0].appendChild(divColor); + } +} +setInterval(colorFlasher, 2000);