feat(menu): in-progress game card replaces mode picker

When /api/state shows a live game, the home page now hides the mode
cards + setup form and shows an 'active-card' instead: ROUND IN
PROGRESS header with pulsing crimson dot, a diagonal 'LIVE' stamp,
white/black seat panels (agent / model / persona), VS divider with
'who's thinking' status, a gold WATCH LIVE button that routes to
/ai-vs-ai (or /play if either side is human), and a crimson ABORT
CURRENT ROUND escape hatch. menu.js polls every 3s so the meta strip
(move count, current thinker) stays fresh and the picker comes back as
soon as the game ends.

CSS housekeeping:
- Global [hidden] { display: none !important } — without it CSS rules
  like .modes { display: grid } override the HTML hidden attribute and
  the picker bled through the active-card.
- New tokens reuse the existing palette: gold for the watch CTA + meta,
  crimson for the LIVE stamp + abort, dashed rule + bone tones for
  seat borders. No new fonts or colors introduced — matches the
  Major Mono Display / JetBrains Mono tournament-bulletin style.
This commit is contained in:
ai-chess
2026-05-15 04:10:46 +03:00
parent 2038ec95c9
commit e23a07f07b
3 changed files with 249 additions and 3 deletions
+44 -1
View File
@@ -34,7 +34,50 @@
</h1>
<p class="tagline">две LLM выходят на доску. одна возвращается. без подсказок, без коучей, всё — на трэш-токе.</p>
<section class="modes">
<!-- Shown when a game is currently in progress: skip the picker and
offer to drop into the live view. -->
<section class="active-card" id="active-card" hidden>
<header class="active-head">
<span class="active-pulse"></span>
<span class="active-label">ROUND IN PROGRESS</span>
<span class="active-meta" id="active-meta"></span>
</header>
<div class="active-vs">
<div class="seat seat-white">
<div class="seat-pip">●</div>
<div class="seat-name" id="active-white-agent">…</div>
<div class="seat-sub" id="active-white-model">…</div>
<div class="seat-persona" id="active-white-persona">…</div>
</div>
<div class="active-divider">
<span class="active-vs-label">VS</span>
<span class="active-turn" id="active-turn">…</span>
</div>
<div class="seat seat-black">
<div class="seat-pip">○</div>
<div class="seat-name" id="active-black-agent">…</div>
<div class="seat-sub" id="active-black-model">…</div>
<div class="seat-persona" id="active-black-persona">…</div>
</div>
</div>
<div class="active-actions">
<a class="watch-btn" id="watch-btn" href="/ai-vs-ai">
<span>WATCH LIVE</span>
<span class="kbd">↩</span>
</a>
<button type="button" class="active-abort" id="active-abort">
abort current round
</button>
</div>
<p class="active-foot">
новая партия откроется когда эта закончится — мат / резигн / абort.
</p>
</section>
<section class="modes" id="modes">
<button class="mode" data-mode="ai_vs_ai" type="button">
<div class="mode-num">01</div>
<div class="mode-name">AI <span class="x">×</span> AI</div>