You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
465 B
16 lines
465 B
const WIDTH = 4; //64;
|
|
const HEIGHT = 4; //32;
|
|
|
|
for(let y = 0; y < HEIGHT; y++) {
|
|
const row = document.createElement('div');
|
|
row.className = 'row';
|
|
for(let x = 0; x < WIDTH; x++) {
|
|
const pixel = document.createElement('div');
|
|
pixel.className = 'pixel';
|
|
pixel.addEventListener('click', () => {
|
|
pixel.style.backgroundColor = 'red';
|
|
});
|
|
row.appendChild(pixel);
|
|
}
|
|
document.body.appendChild(row);
|
|
} |