Compare commits
2 Commits
0e5e39b0dc
...
b65cba5ed2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b65cba5ed2 | ||
|
|
afe79f1a48 |
@@ -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 () {
|
(function () {
|
||||||
const roomPage = document.querySelector('.room-page');
|
const roomPage = document.querySelector('.room-page');
|
||||||
if (!roomPage) return;
|
if (!roomPage) return;
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ html:has(.gate-backdrop) {
|
|||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-height: 80vh;
|
max-height: 80vh;
|
||||||
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Table hex + seat positions ────────────────────────────────────────────
|
// ─── Table hex + seat positions ────────────────────────────────────────────
|
||||||
@@ -302,14 +303,20 @@ $pos-d-x: round($pos-d * 0.5); // 55px
|
|||||||
$pos-d-y: round($pos-d * 0.866); // 95px
|
$pos-d-y: round($pos-d * 0.866); // 95px
|
||||||
|
|
||||||
// ─── Position strip ────────────────────────────────────────────────────────
|
// ─── Position strip ────────────────────────────────────────────────────────
|
||||||
// Numbered gate-slot circles rendered above the backdrop (z 130 > overlay 120
|
// Numbered gate-slot circles sit above the gate backdrop/overlay (z 130 > 120
|
||||||
// > backdrop 100). .room-page is position:relative with no z-index, so its
|
// > 100) but below the role-select fan (z 200), tray (310), and menus (310+).
|
||||||
// absolute children share the root stacking context with the fixed overlays.
|
// .room-page is position:relative with no z-index, so its absolute children
|
||||||
// When role-select is open, suppress pointer events so the strip doesn't
|
// share the root stacking context with the fixed overlays.
|
||||||
// intercept clicks on cards (landscape: strip overlaps centered card fan).
|
// When the gate modal or role-select fan is open, suppress pointer events so
|
||||||
|
// the strip doesn't intercept clicks or hover effects on the modal beneath it
|
||||||
|
// (landscape: strip overlaps centered card fan too).
|
||||||
// Must target .gate-slot directly — it has an explicit pointer-events: auto
|
// Must target .gate-slot directly — it has an explicit pointer-events: auto
|
||||||
// override that wins over a rule on the parent .position-strip alone.
|
// override that wins over a rule on the parent .position-strip alone.
|
||||||
|
html:has(.gate-backdrop) .position-strip .gate-slot,
|
||||||
html:has(.role-select-backdrop) .position-strip .gate-slot { pointer-events: none; }
|
html:has(.role-select-backdrop) .position-strip .gate-slot { pointer-events: none; }
|
||||||
|
// Re-enable clicks on confirm/reject/drop-token forms inside slots
|
||||||
|
html:has(.gate-backdrop) .position-strip .gate-slot form,
|
||||||
|
html:has(.gate-backdrop) .position-strip .gate-slot button { pointer-events: auto; }
|
||||||
|
|
||||||
.position-strip {
|
.position-strip {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -409,7 +416,19 @@ html:has(.role-select-backdrop) .position-strip .gate-slot { pointer-events: non
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: 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
|
// Hex border: clip-path clips CSS borders, so the ring is a wrapper with the
|
||||||
@@ -584,7 +603,7 @@ html:has(.role-select-backdrop) .position-strip .gate-slot { pointer-events: non
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border: 1px solid rgba(var(--secUser), 1);
|
border: 2px solid rgba(var(--quiUser), 1);
|
||||||
background: rgba(var(--terUser), 1);
|
background: rgba(var(--terUser), 1);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
transition: box-shadow 0.2s ease;
|
transition: box-shadow 0.2s ease;
|
||||||
@@ -608,7 +627,7 @@ html:has(.role-select-backdrop) .position-strip .gate-slot { pointer-events: non
|
|||||||
.role-select-backdrop {
|
.role-select-backdrop {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
z-index: 100;
|
z-index: 200;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -663,9 +682,9 @@ $card-h: 120px;
|
|||||||
.card-back {
|
.card-back {
|
||||||
transform: rotateY(0deg);
|
transform: rotateY(0deg);
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
color: rgba(var(--quaUser), 1);
|
color: rgba(var(--quiUser), 1);
|
||||||
background: rgba(var(--quiUser), 1);
|
background: rgba(var(--terUser), 1);
|
||||||
border: 1px solid rgba(var(--terUser), 1);
|
border: 2px solid rgba(var(--quiUser), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-front {
|
.card-front {
|
||||||
|
|||||||
@@ -9,22 +9,23 @@
|
|||||||
{% if room.table_status %}data-select-role-url="{% url 'epic:select_role' room.id %}"{% endif %}>
|
{% if room.table_status %}data-select-role-url="{% url 'epic:select_role' room.id %}"{% endif %}>
|
||||||
<div class="room-shell">
|
<div class="room-shell">
|
||||||
<div id="id_game_table" class="room-table">
|
<div id="id_game_table" class="room-table">
|
||||||
<div class="table-hex-border">
|
<div class="room-table-scene">
|
||||||
<div class="table-hex">
|
<div class="table-hex-border">
|
||||||
<div class="table-center">
|
<div class="table-hex">
|
||||||
{% if room.table_status == "ROLE_SELECT" and card_stack_state %}
|
<div class="table-center">
|
||||||
<div class="card-stack" data-state="{{ card_stack_state }}"
|
{% if room.table_status == "ROLE_SELECT" and card_stack_state %}
|
||||||
data-starter-roles="{{ starter_roles|join:',' }}"
|
<div class="card-stack" data-state="{{ card_stack_state }}"
|
||||||
data-user-slots="{{ user_slots|join:',' }}"
|
data-starter-roles="{{ starter_roles|join:',' }}"
|
||||||
data-active-slot="{{ active_slot }}">
|
data-user-slots="{{ user_slots|join:',' }}"
|
||||||
{% if card_stack_state == "ineligible" %}
|
data-active-slot="{{ active_slot }}">
|
||||||
<i class="fa-solid fa-ban"></i>
|
{% if card_stack_state == "ineligible" %}
|
||||||
|
<i class="fa-solid fa-ban"></i>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% if room.table_status == "SIG_SELECT" and sig_seats %}
|
{% if room.table_status == "SIG_SELECT" and sig_seats %}
|
||||||
{% for seat in sig_seats %}
|
{% for seat in sig_seats %}
|
||||||
<div class="table-seat{% if seat == sig_active_seat %} active{% endif %}" data-role="{{ seat.role }}" data-slot="{{ seat.slot_number }}">
|
<div class="table-seat{% if seat == sig_active_seat %} active{% endif %}" data-role="{{ seat.role }}" data-slot="{{ seat.slot_number }}">
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user