|
|
@ -7,6 +7,9 @@ for(let y = 0; y < HEIGHT; y++) { |
|
|
|
for(let x = 0; x < WIDTH; x++) { |
|
|
|
for(let x = 0; x < WIDTH; x++) { |
|
|
|
const pixel = document.createElement('div'); |
|
|
|
const pixel = document.createElement('div'); |
|
|
|
pixel.className = 'pixel'; |
|
|
|
pixel.className = 'pixel'; |
|
|
|
|
|
|
|
pixel.addEventListener('click', () => { |
|
|
|
|
|
|
|
pixel.style.backgroundColor = 'red'; |
|
|
|
|
|
|
|
}); |
|
|
|
row.appendChild(pixel); |
|
|
|
row.appendChild(pixel); |
|
|
|
} |
|
|
|
} |
|
|
|
document.body.appendChild(row); |
|
|
|
document.body.appendChild(row); |
|
|
|