fix: prevent large levels from overflowing the viewport

Add scrollable overflow to board wrapper, use safe centering to avoid
top-cropping, and lower minimum tile size from 16px to 10px.
This commit is contained in:
tiennm99 committed 2026-04-12 09:35:28 +07:00
1 parent 8a3d4b4a9d
commit d46ccb6d50
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -53,7 +53,7 @@ html, body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
align-items: safe center;
padding: 24px;
}
+4 -1
View File
@@ -37,7 +37,7 @@
function computeTileSize() {
if (!level) return 48;
const maxTile = 56;
const minTile = 16;
const minTile = 10;
const margin = 140; // header + hud + padding
const maxByWidth = Math.floor((window.innerWidth - 80) / level.width);
const maxByHeight = Math.floor((window.innerHeight - margin - 100) / level.height);
@@ -199,6 +199,9 @@
display: flex;
justify-content: center;
width: 100%;
overflow: auto;
max-height: calc(100vh - 140px);
max-width: calc(100vw - 48px);
}
.error {