2023-11-09 14:15:23 -07:00
|
|
|
const container = document.querySelector(".container");
|
|
|
|
|
const conWidth = container.clientWidth;
|
|
|
|
|
const conHeight = container.clientHeight
|
|
|
|
|
const grid = document.createElement("div");
|
|
|
|
|
let numGrid = 16;
|
2023-11-09 15:14:02 -07:00
|
|
|
const gridArea = numGrid ** 2;
|
2023-11-09 14:15:23 -07:00
|
|
|
const gridWidth = conWidth / numGrid;
|
2023-11-09 15:14:02 -07:00
|
|
|
const gridHeight = conHeight / numGrid;
|
|
|
|
|
|
|
|
|
|
grid.classList.add("grid");
|
|
|
|
|
grid.style.width = gridWidth + 'px';
|
|
|
|
|
grid.style.height = gridHeight + 'px';
|
|
|
|
|
|
2023-11-09 15:37:47 -07:00
|
|
|
for (let i = 0; i < gridArea; i++){
|
2023-11-09 15:14:02 -07:00
|
|
|
container.appendChild(grid.cloneNode(true));
|
|
|
|
|
}
|