wregwre
This commit is contained in:
parent
ac96e554f4
commit
c8c5b38bfa
File diff suppressed because one or more lines are too long
@ -208,31 +208,5 @@
|
|||||||
r.readAsDataURL(file);
|
r.readAsDataURL(file);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
</body>
|
||||||
<script>
|
|
||||||
function scaleBoard() {
|
|
||||||
const board = document.querySelector(".board");
|
|
||||||
|
|
||||||
const baseWidth = 1800;
|
|
||||||
const baseHeight = 900;
|
|
||||||
|
|
||||||
const scaleX = window.innerWidth / baseWidth;
|
|
||||||
const scaleY = window.innerHeight / baseHeight;
|
|
||||||
|
|
||||||
const scale = Math.max(Math.min(scaleX, scaleY), 1);
|
|
||||||
|
|
||||||
board.style.transform = `scale(${scale})`;
|
|
||||||
|
|
||||||
const offsetX = (window.innerWidth - baseWidth * scale) / 2;
|
|
||||||
const offsetY = (window.innerHeight - baseHeight * scale) / 2;
|
|
||||||
|
|
||||||
board.style.left = offsetX + "px";
|
|
||||||
board.style.top = offsetY + "px";
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("resize", scaleBoard);
|
|
||||||
window.addEventListener("load", scaleBoard);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user