From b65cba5ed2409ef19760ba34f8a5efe1c8b571bb Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Wed, 1 Apr 2026 23:24:17 -0400 Subject: [PATCH] wrapped room table in .room-table-scene div, built styles and scripts to ensure table scales w. available viewport or aperture space --- src/apps/epic/static/apps/epic/room.js | 20 ++++++++++++++++++ src/static_src/scss/_room.scss | 23 ++++++++++++++++----- src/templates/apps/gameboard/room.html | 28 ++++++++++++++------------ 3 files changed, 53 insertions(+), 18 deletions(-) diff --git a/src/apps/epic/static/apps/epic/room.js b/src/apps/epic/static/apps/epic/room.js index 39df1e7..2bbb665 100644 --- a/src/apps/epic/static/apps/epic/room.js +++ b/src/apps/epic/static/apps/epic/room.js @@ -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; diff --git a/src/static_src/scss/_room.scss b/src/static_src/scss/_room.scss index 4f8d81d..7828d3a 100644 --- a/src/static_src/scss/_room.scss +++ b/src/static_src/scss/_room.scss @@ -276,6 +276,7 @@ html:has(.gate-backdrop) { gap: 2rem; width: 100%; max-height: 80vh; + align-self: stretch; } // ─── Table hex + seat positions ──────────────────────────────────────────── @@ -415,7 +416,19 @@ html:has(.gate-backdrop) .position-strip .gate-slot button { pointer-events: aut display: flex; align-items: center; justify-content: center; - min-height: 300px; + min-height: 0; +} + +// Fixed design-size scene; JS scales it to fill .room-table via transform: scale(). +// Design dims: seat reach is ±110px H / ±95px V from centre + seat element size. +.room-table-scene { + width: 360px; + height: 300px; + position: relative; + display: flex; + align-items: center; + justify-content: center; + transform-origin: center center; } // Hex border: clip-path clips CSS borders, so the ring is a wrapper with the @@ -590,7 +603,7 @@ html:has(.gate-backdrop) .position-strip .gate-slot button { pointer-events: aut align-items: center; justify-content: center; border-radius: 6px; - border: 1px solid rgba(var(--secUser), 1); + border: 2px solid rgba(var(--quiUser), 1); background: rgba(var(--terUser), 1); cursor: default; transition: box-shadow 0.2s ease; @@ -669,9 +682,9 @@ $card-h: 120px; .card-back { transform: rotateY(0deg); font-size: 1.5rem; - color: rgba(var(--quaUser), 1); - background: rgba(var(--quiUser), 1); - border: 1px solid rgba(var(--terUser), 1); + color: rgba(var(--quiUser), 1); + background: rgba(var(--terUser), 1); + border: 2px solid rgba(var(--quiUser), 1); } .card-front { diff --git a/src/templates/apps/gameboard/room.html b/src/templates/apps/gameboard/room.html index 6f4da5a..6632462 100644 --- a/src/templates/apps/gameboard/room.html +++ b/src/templates/apps/gameboard/room.html @@ -9,22 +9,23 @@ {% if room.table_status %}data-select-role-url="{% url 'epic:select_role' room.id %}"{% endif %}>
-
-
-
- {% if room.table_status == "ROLE_SELECT" and card_stack_state %} -
- {% if card_stack_state == "ineligible" %} - +
+
+
+
+ {% if room.table_status == "ROLE_SELECT" and card_stack_state %} +
+ {% if card_stack_state == "ineligible" %} + + {% endif %} +
{% endif %}
- {% endif %} +
-
-
{% if room.table_status == "SIG_SELECT" and sig_seats %} {% for seat in sig_seats %}
@@ -49,6 +50,7 @@
{% endfor %} {% endif %} +