diff --git a/flashing.js b/flashing.js new file mode 100644 index 00000000..5ca8de28 --- /dev/null +++ b/flashing.js @@ -0,0 +1,30 @@ + + + +var flashing = document.getElementsByTagName('div') + + +function getRandomColor() { + var letters = '0123456789ABCDEF'.split(''); + var color = '#'; + for (var i = 0; i < 6; i++ ) { + color += letters[Math.floor(Math.random() * 16)]; + } + return color + } + +setInterval(function(){ + for (var i = 0; i < flashing.length; i++) { + flashing[i].style.backgroundColor = getRandomColor(); + } + }, 100); + + +for (var i = 0; i < 72; i++){ + var div = document.createElement('div'); + div.style.backgroundColor = getRandomColor(); + div.style.width = '11.1%' + div.style.float = 'left' + div.style.paddingBottom = '11.1%' + body.appendChild(div); +} diff --git a/index.html b/index.html index 5e82cbe3..5fd3f580 100644 --- a/index.html +++ b/index.html @@ -6,5 +6,9 @@
+ + -