diff --git a/global/globalScript.js b/global/globalScript.js index c404ea3..747b11e 100644 --- a/global/globalScript.js +++ b/global/globalScript.js @@ -72,7 +72,7 @@ function debugPrint(title, value) { } } -function toggleGrid() { +function toggleGrid(offX = 0, offY = 0) { if (gridVisible) { document.getElementById("gridCanvas").remove() gridVisible = false @@ -84,8 +84,8 @@ function toggleGrid() { canvasEl.width = window.innerWidth canvasEl.height = window.innerHeight canvasEl.style.position = "absolute" - canvasEl.style.top = "0%" - canvasEl.style.left = "0%" + canvasEl.style.top = `${offY * pxDensity}px` + canvasEl.style.left = `${offX * pxDensity}px` canvasEl.style.pointerEvents = "none" let ctx = canvasEl.getContext("2d") diff --git a/global/globalStyle.css b/global/globalStyle.css index 5126dcb..f6f82e4 100644 --- a/global/globalStyle.css +++ b/global/globalStyle.css @@ -68,8 +68,8 @@ canvas { .switch { position: relative; display: inline-block; - width: 60px; - height: 34px; + width: calc(8px * var(--pxDensity)); + height: calc(4px * var(--pxDensity)); } .switch input { display: none; @@ -87,10 +87,10 @@ canvas { .switchDecor:before { position: absolute; content: ""; - height: 26px; - width: 26px; - left: 4px; - bottom: 4px; + height: calc(2px * var(--pxDensity)); + width: calc(2px * var(--pxDensity)); + left: calc(1px * var(--pxDensity)); + bottom: calc(1px * var(--pxDensity)); background-color: var(--navBarBtn_Inner); transition: 0.2s steps(2, end); } @@ -98,5 +98,5 @@ canvas { background-color: var(--brightBlue); } .switch input:checked + .switchDecor:before { - transform: translateX(26px); + transform: translateX(calc(4px * var(--pxDensity))); } \ No newline at end of file diff --git a/toys/license/options.css b/toys/license/options.css index 155fb23..569b56c 100644 --- a/toys/license/options.css +++ b/toys/license/options.css @@ -72,7 +72,6 @@ height: calc(3px * var(--pxDensity)); } .sliderDiv { - display: inline-block; background-color: var(--navBarBtn_Inner); box-shadow: calc(1px * var(--pxDensity)) 0px var(--navBarBtn_Border), calc(-1px * var(--pxDensity)) 0px var(--navBarBtn_Border),