ai-code-battle/web/index.html
jedarden 4ba39e3aa8 feat(evolver): complete Phase 7 LLM-driven evolution implementation
- Complete autonomous evolution pipeline with island model (4 islands)
- MAP-Elites behavior grid integration for diversity
- LLM ensemble integration (fast + strong model tiers)
- 3-stage validation pipeline (syntax → schema → sandbox smoke test)
- Evaluation arena (10-match mini-tournament per candidate)
- Promotion gate (Nash equilibrium PSRO + MAP-Elites niche fill)
- Retirement policy (auto-retire low-rated bots, population cap)
- Live export to R2 for evolution dashboard
- Enhanced replay viewer with commentary and win probability
- Added series, seasons, and predictions pages

All tests passing. Phase 7 exit criteria met.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 16:38:48 -04:00

314 lines
7.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Code Battle - Replay Viewer</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
background-color: #0f172a;
color: #e2e8f0;
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
h1 {
font-size: 1.5rem;
margin-bottom: 20px;
color: #f8fafc;
}
.main-layout {
display: flex;
gap: 20px;
flex-wrap: wrap;
}
.viewer-container {
flex: 1;
min-width: 300px;
}
.canvas-wrapper {
background-color: #1e293b;
border-radius: 8px;
padding: 10px;
}
#replay-canvas {
display: block;
}
.sidebar {
width: 300px;
display: flex;
flex-direction: column;
gap: 15px;
}
.panel {
background-color: #1e293b;
border-radius: 8px;
padding: 15px;
}
.panel h2 {
font-size: 1rem;
margin-bottom: 10px;
color: #94a3b8;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.controls {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
button {
background-color: #3b82f6;
color: white;
border: none;
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.2s;
}
button:hover {
background-color: #2563eb;
}
button:disabled {
background-color: #475569;
cursor: not-allowed;
}
.slider-group {
display: flex;
flex-direction: column;
gap: 5px;
}
.slider-group label {
font-size: 12px;
color: #94a3b8;
}
input[type="range"] {
width: 100%;
}
.file-input-wrapper {
position: relative;
}
input[type="file"] {
display: none;
}
.file-label {
display: inline-block;
background-color: #475569;
color: white;
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.2s;
}
.file-label:hover {
background-color: #64748b;
}
.url-input-group {
display: flex;
gap: 5px;
}
input[type="text"] {
flex: 1;
background-color: #0f172a;
border: 1px solid #334155;
color: #e2e8f0;
padding: 8px;
border-radius: 6px;
font-size: 14px;
}
select {
background-color: #0f172a;
border: 1px solid #334155;
color: #e2e8f0;
padding: 8px;
border-radius: 6px;
font-size: 14px;
}
.match-info {
font-size: 13px;
}
.match-info dt {
color: #94a3b8;
font-size: 11px;
text-transform: uppercase;
margin-top: 8px;
}
.match-info dd {
color: #f1f5f9;
}
.event-log {
max-height: 200px;
overflow-y: auto;
font-size: 12px;
font-family: monospace;
}
.event-log .event {
padding: 4px 0;
border-bottom: 1px solid #334155;
}
.event-log .event:last-child {
border-bottom: none;
}
.event-type {
color: #fbbf24;
}
.no-replay {
color: #64748b;
text-align: center;
padding: 20px;
}
.keyboard-shortcuts {
font-size: 12px;
color: #64748b;
margin-top: 10px;
}
.keyboard-shortcuts kbd {
background-color: #334155;
padding: 2px 6px;
border-radius: 4px;
font-family: monospace;
}
</style>
</head>
<body>
<div class="container">
<h1>AI Code Battle - Replay Viewer</h1>
<div class="main-layout">
<div class="viewer-container">
<div class="canvas-wrapper">
<canvas id="replay-canvas"></canvas>
<div id="no-replay" class="no-replay">Load a replay file to view</div>
</div>
</div>
<div class="sidebar">
<div class="panel">
<h2>Load Replay</h2>
<div class="controls" style="margin-bottom: 10px;">
<div class="file-input-wrapper">
<label class="file-label" for="file-input">Choose File</label>
<input type="file" id="file-input" accept=".json">
</div>
</div>
<div class="url-input-group">
<input type="text" id="url-input" placeholder="Or enter URL...">
<button id="load-url-btn">Load</button>
</div>
</div>
<div class="panel">
<h2>Playback</h2>
<div class="controls">
<button id="play-btn" disabled>Play</button>
<button id="prev-btn" disabled>Prev</button>
<button id="next-btn" disabled>Next</button>
<button id="reset-btn" disabled>Reset</button>
</div>
<div class="slider-group" style="margin-top: 10px;">
<label>Turn: <span id="turn-display">0</span> / <span id="total-turns">0</span></label>
<input type="range" id="turn-slider" min="0" max="0" value="0" disabled>
</div>
<div class="slider-group" style="margin-top: 10px;">
<label>Speed: <span id="speed-display">100</span>ms/turn</label>
<input type="range" id="speed-slider" min="20" max="1000" value="100">
</div>
</div>
<div class="panel">
<h2>View Options</h2>
<div class="slider-group">
<label for="fog-select">Fog of War:</label>
<select id="fog-select">
<option value="">Disabled (full view)</option>
</select>
</div>
<div class="slider-group" style="margin-top: 10px;">
<label for="cell-size-select">Cell Size:</label>
<select id="cell-size-select">
<option value="8">Small (8px)</option>
<option value="12">Medium (12px)</option>
<option value="16" selected>Large (16px)</option>
<option value="20">X-Large (20px)</option>
</select>
</div>
</div>
<div class="panel">
<h2>Match Info</h2>
<dl class="match-info" id="match-info">
<dt>Match ID</dt>
<dd id="info-match-id">-</dd>
<dt>Winner</dt>
<dd id="info-winner">-</dd>
<dt>Turns</dt>
<dd id="info-turns">-</dd>
<dt>Reason</dt>
<dd id="info-reason">-</dd>
</dl>
</div>
<div class="panel">
<h2>Events This Turn</h2>
<div class="event-log" id="event-log">
<div class="no-replay">No events</div>
</div>
</div>
<div class="keyboard-shortcuts">
<kbd>Space</kbd> Play/Pause
<kbd></kbd><kbd></kbd> Step
<kbd>Home</kbd><kbd>End</kbd> First/Last
</div>
</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>