hide 'main' when playing games

This commit is contained in:
Chris Wanstrath 2025-09-29 15:07:33 -07:00
parent 0c4c6fe58c
commit 2f4f756a91
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
main.game {
display: none;
}
canvas {
display: block;
}

View File

@ -64,6 +64,7 @@ function createCanvas(): HTMLCanvasElement {
canvas.tabIndex = 0
const main = document.querySelector("main")
main?.classList.add("game")
main?.parentNode?.insertBefore(canvas, main)
return canvas
@ -143,6 +144,9 @@ function endGame() {
if (oldMode === "tall") browserCommands.mode?.()
const main = document.querySelector("main")
main?.classList.remove("game")
canvas.classList.remove("active")
canvas.style.height = HEIGHT / 2 + "px"
canvas.style.width = WIDTH / 2 + "px"