wrapped room table in .room-table-scene div, built styles and scripts to ensure table scales w. available viewport or aperture space
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Disco DeDisco
2026-04-01 23:24:17 -04:00
parent afe79f1a48
commit b65cba5ed2
3 changed files with 53 additions and 18 deletions

View File

@@ -1,3 +1,23 @@
(function () {
var SCENE_W = 360, SCENE_H = 300;
function scaleTable() {
var scene = document.querySelector('.room-table-scene');
var container = document.getElementById('id_game_table');
if (!scene || !container) return;
var w = container.clientWidth, h = container.clientHeight;
if (!w || !h) return;
scene.style.transform = 'scale(' + Math.min(w / SCENE_W, h / SCENE_H) + ')';
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', scaleTable);
} else {
scaleTable();
}
window.addEventListener('resize', scaleTable);
}());
(function () {
const roomPage = document.querySelector('.room-page');
if (!roomPage) return;