Files
ai-chess/public/menu.html
T
ai-chess e23a07f07b 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.
2026-05-15 04:10:46 +03:00

176 lines
6.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<title>ai-chess</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@200;400;700;800&family=Major+Mono+Display&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/static/menu.css" />
</head>
<body>
<div class="grain"></div>
<header class="topbar">
<div class="brand">AI·CHESS</div>
<div class="topbar-meta">
<span>two llm. one crown.</span>
<span class="sep">·</span>
<span>stockfish-judged</span>
<span class="sep">·</span>
<span class="ver">v0.1</span>
</div>
</header>
<main class="hero">
<div class="badge-row">
<span class="badge-line"></span>
<span class="badge">UNDERGROUND TOURNAMENT</span>
<span class="badge-line"></span>
</div>
<h1 class="title">
<span class="t1">AI</span><span class="t-dot">·</span><span class="t2">CHESS</span>
</h1>
<p class="tagline">две LLM выходят на доску. одна возвращается. без подсказок, без коучей, всё — на трэш-токе.</p>
<!-- 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>
<div class="mode-desc">Две модели режутся за тебя. Выбираешь персонажей, ставишь на коне, смотришь.</div>
<div class="mode-tag tag-gold">LIVE</div>
</button>
<button class="mode" data-mode="human_vs_ai" type="button">
<div class="mode-num">02</div>
<div class="mode-name">HUMAN <span class="x">×</span> AI</div>
<div class="mode-desc">Сам садишься напротив. Шах, мат и в чате её мордой по доске.</div>
<div class="mode-tag tag-crimson">FIGHT</div>
</button>
<a class="mode mode-link" href="/games">
<div class="mode-num">03</div>
<div class="mode-name">GAMES <span class="x">·</span> STATS</div>
<div class="mode-desc">Архив прошлых драк, лидерборд персонажей, реплеи с эвалами.</div>
<div class="mode-tag tag-neutral">ARCHIVE</div>
</a>
</section>
<section class="setup" id="setup" hidden>
<div class="setup-head">
<span class="setup-step">step 02</span>
<span class="setup-title" id="setup-title">configure the fight</span>
<div class="setup-tools">
<button id="btn-swap" type="button" class="tool">⇄ swap</button>
<button id="btn-random" type="button" class="tool">🎲 random</button>
</div>
</div>
<div class="sides">
<fieldset class="side side-white" data-side="white">
<legend><span class="legend-pip"></span>WHITE</legend>
<label class="field">
<span>agent</span>
<select name="agent"></select>
</label>
<label class="field" data-when="ai">
<span>model</span>
<select name="model"></select>
</label>
<label class="field" data-when="ai">
<span>persona</span>
<select name="prompt"></select>
</label>
<p class="persona-desc" data-when="ai"></p>
<p class="human-note" data-when="human" hidden>controlled by you — moves via the board, no trash-talk wiring (yet).</p>
</fieldset>
<div class="vs">VS</div>
<fieldset class="side side-black" data-side="black">
<legend><span class="legend-pip"></span>BLACK</legend>
<label class="field">
<span>agent</span>
<select name="agent"></select>
</label>
<label class="field" data-when="ai">
<span>model</span>
<select name="model"></select>
</label>
<label class="field" data-when="ai">
<span>persona</span>
<select name="prompt"></select>
</label>
<p class="persona-desc" data-when="ai"></p>
<p class="human-note" data-when="human" hidden>controlled by you — moves via the board, no trash-talk wiring (yet).</p>
</fieldset>
</div>
<div id="setup-warning" hidden>
⚠ A game is currently in progress.
<button type="button" id="abort-current" class="link-abort">abort it</button>
to start a new one.
</div>
<div class="setup-foot">
<a class="back" href="#" id="back-link">← change mode</a>
<button id="start-btn" class="start" type="button">
<span>START</span>
<span class="kbd">↵</span>
</button>
</div>
</section>
<footer class="hud">
<span class="hud-cell">tmux: <code id="hud-tmux">…</code></span>
<span class="hud-cell">stockfish: <code id="hud-sf">…</code></span>
<span class="hud-cell">games played: <code id="hud-games">…</code></span>
</footer>
</main>
<script src="/static/menu.js" type="module"></script>
</body>
</html>