mirror of
https://github.com/10h30/odin-etch-a-sketch.git
synced 2026-07-17 13:43:20 +09:00
Make Grid
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
const container = document.querySelector(".container")
|
||||
const containerWidth = document.querySelector(".container").clientWidth;
|
||||
console.log(containerWidth)
|
||||
|
||||
for (let i=0; i < 16*16; i++) {
|
||||
const squareBox = document.createElement("div")
|
||||
container.appendChild(squareBox)
|
||||
squareBox.setAttribute('class', 'grid')
|
||||
squareBox.style.width= containerWidth / 16 + "px";;
|
||||
squareBox.style.height= containerWidth / 16 + "px";;
|
||||
}
|
||||
Reference in New Issue
Block a user