diff --git a/globalScript.js b/globalScript.js
index 02d0ffe..aac365f 100644
--- a/globalScript.js
+++ b/globalScript.js
@@ -1,11 +1,46 @@
function randomFloat(min, max) {
return Math.random() * (max - min) + min;
}
-
+
+
function randomIntFrom0(max) {
return Math.floor(Math.random() * max)
}
+
function randomInt(min, max) {
return Math.floor(Math.random() * (max - min) + min)
+}
+
+
+function showGrid() {
+ let canvasEl = document.createElement("canvas")
+ canvasEl.width = window.innerWidth
+ canvasEl.height = window.innerHeight
+ canvasEl.style.position = "absolute"
+ canvasEl.style.top = "0%"
+ canvasEl.style.left = "0%"
+ canvasEl.style.pointerEvents = "none"
+
+ let ctx = canvasEl.getContext("2d")
+
+ document.body.appendChild(canvasEl)
+
+ let repeatCountX = window.innerWidth / pxDensity
+ let repeatCountY = window.innerHeight / pxDensity
+
+ ctx.strokeStyle = "#ff0000"
+ ctx.beginPath()
+
+ for (x = 0; x < repeatCountX; x++) {
+ ctx.moveTo(x * pxDensity, 0)
+ ctx.lineTo(x * pxDensity, window.innerHeight)
+ }
+
+ for (y = 0; y < repeatCountY; y++) {
+ ctx.moveTo(0, y * pxDensity)
+ ctx.lineTo(window.innerWidth, y * pxDensity)
+ }
+
+ ctx.stroke()
}
\ No newline at end of file
diff --git a/globalStyle.css b/globalStyle.css
index 786ac93..09fd1b9 100644
--- a/globalStyle.css
+++ b/globalStyle.css
@@ -4,6 +4,7 @@
--navBarBtn_Inner: #474747;
--navBarBtn_Border: #232323;
--pxDensity: 1;
+ --pxDensityPx: 1px;
}
html {
diff --git a/index.html b/index.html
index ec777cb..c0310f0 100644
--- a/index.html
+++ b/index.html
@@ -52,9 +52,9 @@
-
+