From 0b05981b49015c6aa80e65585bb8329083584328 Mon Sep 17 00:00:00 2001 From: Ku6epXBOCTuK Date: Tue, 23 Jun 2026 22:31:14 +0500 Subject: [PATCH] fix: resolve preview size issue --- js/preview.js | 6 +++++- style.css | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/js/preview.js b/js/preview.js index 8a9cd3d..8b33d36 100644 --- a/js/preview.js +++ b/js/preview.js @@ -7,7 +7,11 @@ export function updateLivePreview(state) { const cw = container.clientWidth; if (cw <= 0) return; - const scale = cw / state.fieldW; + const maxH = window.innerHeight - 140; + const scaleW = cw / state.fieldW; + const scaleH = maxH / state.fieldH; + const scale = Math.min(scaleW, scaleH); + const field = $('field'); field.style.width = state.fieldW + 'px'; field.style.height = state.fieldH + 'px'; diff --git a/style.css b/style.css index ec8dec4..ff59016 100644 --- a/style.css +++ b/style.css @@ -441,7 +441,9 @@ main { } #field { - position: relative; + position: absolute; + top: 0; + left: 0; transform-origin: 0 0; background: #0c1018; } @@ -502,7 +504,6 @@ body.mode-preview .right-col { } body.mode-preview .left-col { - max-width: 900px; width: 100%; }