Pixel grid

This commit is contained in:
rachel.koldenhoven 2018-06-10 12:29:56 +05:30 committed by Brent Gardner
parent fe80bf0448
commit 6de40658a0
2 changed files with 27 additions and 1 deletions

View File

@ -1 +1,13 @@
document.body.innerHTML = "Hello world!";
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';
row.appendChild(pixel);
}
document.body.appendChild(row);
}

View File

@ -0,0 +1,14 @@
body {
display: flex;
flex-direction: column;
}
.row {
display: flex;
}
.pixel {
width: 14px;
height: 14px;
border: 1px solid rgb(229, 229, 229);
}