From 34c67622825702fb0b09576d2ebd5269a10e23bc Mon Sep 17 00:00:00 2001 From: WHYSOSERIOUS1234 <103112614+WHYSOSERIOUS1234@users.noreply.github.com> Date: Mon, 5 Sep 2022 13:47:04 -0700 Subject: [PATCH 1/3] pixel update' --- pixel.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pixel.js diff --git a/pixel.js b/pixel.js new file mode 100644 index 00000000..3639dada --- /dev/null +++ b/pixel.js @@ -0,0 +1,27 @@ + +let cont = document.querySelector('.container') +let currentColor = document.querySelector('.colorMe').value +let eraseMe = document.querySelector('.eraseMe') + + + +function grid(size) { + for(let i = 0; i < size * size; i++) { + let pixel = document.createElement('div') + pixel.classList.add('pixels') + pixel.addEventListener('click', () => { + pixel.style.backgroundColor = currentColor + }) + + cont.appendChild(pixel) + eraseMe.addEventListener('click' ,() => { + pixel.style.backgroundColor = "white" + }) + + } +} +grid(32.01) + + + + From 3427e1c25e363938f972b2bf3aaab9792bb1a386 Mon Sep 17 00:00:00 2001 From: WHYSOSERIOUS1234 <103112614+WHYSOSERIOUS1234@users.noreply.github.com> Date: Mon, 5 Sep 2022 13:49:16 -0700 Subject: [PATCH 2/3] pixel update2 --- index.html | 22 ++++++++++++++++++++++ pixel.css | 30 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 pixel.css diff --git a/index.html b/index.html index e69de29b..840f14bd 100644 --- a/index.html +++ b/index.html @@ -0,0 +1,22 @@ + + +
+ + + +