From 1fb3c4d6b266406b4f3c0a631c639ba2e453707f Mon Sep 17 00:00:00 2001 From: KC Date: Fri, 10 Jun 2016 14:42:47 -0600 Subject: [PATCH] flashing colors next --- .DS_Store | Bin 0 -> 6148 bytes script.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..981613ea8386ccf3e7cc568a75e3c77020ea09aa GIT binary patch literal 6148 zcmeHKO-sW-5PhRPRK4`*agUw?{)14e;8p*Cwh^qPR;+@@{7nCizWGp0o1=)x4D7tg z?!4XPL3Vcl$n>Q-1ttK-Y>J}6fNA&O&|W0(6UF9uMTI*&V}*8LqQBUs?|z6S9?;+x z-`@YCT`%VCdd_hb=bY{2-HZ`%fG6hPkhLOK^i7{3mphCN7Gy2)NQElgW3$D0+hXWC zX{kUekP4&%slZPwz%yHIeB_uu6-WhAfiDGge<*BK3+6t YULDvu>MYuCbYflvOptV`z%MB90ddAPPXGV_ literal 0 HcmV?d00001 diff --git a/script.js b/script.js index 9233771b..f191149a 100644 --- a/script.js +++ b/script.js @@ -1 +1,53 @@ -// Your JS goes here \ No newline at end of file + + +//PART TWO + +for (var i = 0; i < 63; i++) { + +var div = document.createElement("div"); +div.style.width = "11.1%"; +// div.style.color = backgroundColor(); +div.style.float = "left"; +div.style.paddingBottom = "11.1%"; + +function getRandomColor() { + var letters = '0123456789ABCDEF'.split(''); + var color = '#'; + for (var i = 0; i < 6; i++ ) { + color += letters[Math.floor(Math.random() * 16)]; + } + return color; + }; + div.style.backgroundColor = getRandomColor(); + div.style.color = getRandomColor(); + document.body.appendChild(div); + } + + //PART ONE + +// for (var i = 0; i < 63; i++) { +// +// var div = document.createElement("div"); +// div.style.width = "11.1%"; +// div.style.background = "red"; +// div.style.color = "white"; +// div.style.float = "left"; +// div.style.paddingBottom = "11.1%"; +// +// document.body.appendChild(div); +// +// var div = document.createElement("div"); +// div.style.width = "11.1%"; +// div.style.background = "black"; +// div.style.color = "white"; +// div.style.float = "left"; +// div.style.paddingBottom = "11.1%"; +// +// document.body.appendChild(div); +// +// if(i % 2 == 0) { +// } +// else { +// +// } +// }