-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
269 lines (265 loc) · 14.2 KB
/
index.html
File metadata and controls
269 lines (265 loc) · 14.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>ChessBased — Opening Trainer</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='6' fill='%231a1a2e'/><text x='16' y='23' font-size='20' text-anchor='middle' fill='%23c9a84c'>♞</text></svg>" />
<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=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap" rel="stylesheet" />
</head>
<body>
<div id="app" class="mode-play">
<div id="app-nav">
<div class="app-nav-brand">♞ ChessBased</div>
<div class="app-nav-tabs" role="tablist">
<button class="app-nav-tab selected" data-mode="play">Play</button>
<button class="app-nav-tab" data-mode="explore">Explore</button>
<button class="app-nav-tab" data-mode="report">Report</button>
<div class="app-nav-indicator"></div>
</div>
<div class="app-nav-actions">
<div id="nav-user-identity" class="nav-user-identity hidden">
<button class="btn sm nav-stats-btn hidden" data-action="stats" title="Game statistics">
<svg viewBox="0 0 24 24" width="14" height="14"><path fill="currentColor" d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"/></svg>
Stats
</button>
<button class="btn icon sm nav-user-action" data-action="clear" title="Clear imported games">
<svg viewBox="0 0 24 24" width="14" height="14"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>
</button>
<button class="btn icon sm nav-user-action" data-action="refresh" title="Refresh games">
<svg viewBox="0 0 24 24" width="14" height="14"><path fill="currentColor" d="M17.65 6.35A7.958 7.958 0 0012 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0112 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></svg>
</button>
<span class="nav-user-name"></span>
<span class="nav-user-count"></span>
</div>
<button id="nav-help-btn" class="btn icon" data-tooltip="Help & shortcuts">?</button>
</div>
</div>
<div id="app-content">
<div id="left-sidebar">
<div class="explore-only">
<div class="sidebar-section sidebar-section-openings">
<div class="sidebar-section-header">Openings</div>
<div id="system-picker"></div>
<div id="repertoire-actions"></div>
</div>
<div class="sidebar-section sidebar-section-games">
<div id="games-section-header" class="sidebar-section-header">Games</div>
<div id="recent-games-container"></div>
</div>
</div>
<div id="report-page" class="report-page report-only"></div>
</div>
<div id="board-column">
<div id="board-row">
<div id="eval-bar">
<div id="eval-fill"></div>
<div id="eval-label"></div>
</div>
<div id="board"></div>
<div id="board-overlay" class="hidden"></div>
</div>
<div id="board-opening-label"></div>
<div id="report-board-controls" class="report-only"></div>
<div id="board-scroll">
<div id="controls"></div>
<div id="alert-banner"></div>
<div id="history-toolbar">
<div id="history-lines-toggle" class="segment-picker">
<button class="segment-btn selected" data-history-lines-view="history" type="button">History</button>
<button class="segment-btn" data-history-lines-view="lines" type="button">Lines</button>
</div>
<div id="move-actions"></div>
</div>
<div id="history-lines-body">
<div id="moves"></div>
<div id="opening-lines" class="hidden">
<div id="opening-lines-pgn"></div>
</div>
</div>
</div>
<div id="mobile-tabs"></div>
<div id="mobile-panel-moves" class="mobile-panel"></div>
<div id="mobile-panel-explorer" class="mobile-panel"></div>
<div id="mobile-panel-repertoire" class="mobile-panel"></div>
</div>
<div id="right-sidebar">
<div class="play-only">
<div id="play-setup"></div>
<div id="play-settings" class="hidden"></div>
</div>
<div class="explore-only">
<div id="status"></div>
<div id="engine-lines" class="hidden"></div>
<div id="sidebar-tabs" class="segment-picker">
<button class="segment-btn selected" data-tab="database">Database</button>
<button class="segment-btn" data-tab="personal">My Games</button>
</div>
<div id="tab-explorer" class="tab-panel">
<div id="explorer-moves"></div>
</div>
</div>
<div id="report-detail" class="report-only"></div>
</div>
</div>
<div id="pgn-modal-overlay" class="drawer-overlay hidden"></div>
<div id="pgn-modal" class="pgn-modal hidden">
<div class="pgn-modal-header">
<h2>Import PGN</h2>
<button id="pgn-modal-close" class="btn icon ghost">×</button>
</div>
<div class="pgn-modal-body">
<div class="study-url-row">
<input id="study-url-input" type="text" placeholder="Lichess study URL (e.g. lichess.org/study/abc123)" />
<button id="study-fetch-btn" class="btn btn-primary">Fetch</button>
</div>
<div class="pgn-separator"><span>or paste PGN directly</span></div>
<textarea id="pgn-textarea" placeholder="Paste PGN here... Example: 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6"></textarea>
<div id="pgn-result" class="pgn-result"></div>
<div class="pgn-modal-actions">
<button id="pgn-import-btn" class="btn btn-primary">Import</button>
<button id="pgn-cancel-btn" class="btn">Cancel</button>
</div>
</div>
</div>
<div id="help-overlay" class="drawer-overlay hidden"></div>
<div id="help-modal" class="help-modal hidden">
<div class="help-modal-header">
<h2>How to use ChessBased</h2>
<button id="help-close" class="btn icon ghost">×</button>
</div>
<div class="help-modal-body">
<p>ChessBased is an opening repertoire trainer. Practice your openings against a bot that plays statistically realistic responses from real Lichess games.</p>
<h3>Quick Start</h3>
<ol>
<li>Choose <b>White</b> or <b>Black</b> to start practicing.</li>
<li>Play your moves on the board — the bot responds with popular moves from the database.</li>
<li>Lock moves you want to learn by clicking the lock icon in the explorer panel.</li>
<li>Start a <b>New Game</b> to practice your locked lines again.</li>
</ol>
<h3>Key Concepts</h3>
<ul>
<li><b>Locked moves</b> — moves saved in your repertoire. The lock icon in the explorer marks moves as "must learn".</li>
<li><b>Openings</b> — group locked moves into named openings. Use Browse or Import PGN to add lines.</li>
<li><b>Alerts</b> — colored banners warn about critical positions. Click an alert to see the best move arrow.</li>
<li><b>Explorer</b> — shows move statistics from millions of Lichess games. Click a move to play it.</li>
</ul>
<h3>Tips</h3>
<ul>
<li>Hover any explorer move to preview it as an arrow on the board.</li>
<li>Click alert banners to highlight the best move.</li>
<li><span class="help-color" style="background:var(--opportunity)"></span>Green moves match your repertoire, <span class="help-color" style="background:var(--danger)"></span>red means you deviated.</li>
<li>Use <b>Manual</b> mode to explore freely without a bot opponent.</li>
</ul>
<h3>Keyboard Shortcuts</h3>
<table class="help-shortcuts">
<tr><td><kbd>←</kbd> <kbd>→</kbd></td><td>Step through move history</td></tr>
<tr><td><kbd>↑</kbd> <kbd>↓</kbd></td><td>Jump to start / latest move</td></tr>
<tr><td><kbd>Space</kbd></td><td>Auto-play next move / Continue / New game</td></tr>
<tr><td><kbd>N</kbd></td><td>New game</td></tr>
<tr><td><kbd>F</kbd></td><td>Flip board</td></tr>
<tr><td><kbd>L</kbd></td><td>Lock / unlock the next move</td></tr>
<tr><td><kbd>E</kbd></td><td>Toggle engine eval bar</td></tr>
<tr><td><kbd>1</kbd></td><td>Trainer mode</td></tr>
<tr><td><kbd>2</kbd></td><td>Report mode</td></tr>
<tr><td><kbd>D</kbd></td><td>Database tab</td></tr>
<tr><td><kbd>G</kbd></td><td>My Games tab</td></tr>
<tr><td><kbd>?</kbd></td><td>Show this help</td></tr>
</table>
</div>
</div>
<div id="personal-import-overlay" class="drawer-overlay hidden"></div>
<div id="personal-import-modal" class="pgn-modal hidden">
<div class="pgn-modal-header">
<h2>Import My Games</h2>
<button id="personal-import-close" class="btn icon ghost">×</button>
</div>
<div class="pgn-modal-body">
<div class="personal-platform-toggle">
<div class="segment-picker">
<button class="segment-btn selected" data-platform="lichess">Lichess</button>
<button class="segment-btn" data-platform="chesscom">Chess.com</button>
</div>
</div>
<div class="personal-username-row">
<input id="personal-username" type="text" placeholder="Enter your chess username" autocomplete="off" data-1p-ignore />
<button id="personal-import-btn" class="btn btn-primary">Import</button>
</div>
<div id="personal-filters" class="personal-filters">
<div class="personal-filter-label">Time controls</div>
<div class="chip-grid personal-speed-chips">
<button class="chip selected" data-speed="bullet">Bullet</button>
<button class="chip selected" data-speed="blitz">Blitz</button>
<button class="chip selected" data-speed="rapid">Rapid</button>
<button class="chip" data-speed="classical">Classical</button>
</div>
</div>
<div id="personal-range-filters" class="personal-filters">
<div class="personal-filter-label">Import range</div>
<div class="import-range-row">
<div class="segment-picker segment-sm import-range-picker">
<button class="segment-btn selected" data-months="0">All time</button>
<button class="segment-btn" data-months="60">5y</button>
<button class="segment-btn" data-months="36">3y</button>
<button class="segment-btn" data-months="12">1y</button>
<button class="segment-btn" data-months="6">6m</button>
</div>
<span class="import-range-text">or</span>
<input id="personal-months-input" type="number" min="1" max="999" placeholder="Custom" class="personal-months-input" />
<span class="import-range-text">mo</span>
</div>
</div>
<div id="personal-import-progress" class="personal-import-progress hidden">
<div class="personal-progress-bar"><div class="personal-progress-fill"></div></div>
<div class="personal-progress-text"></div>
<button id="personal-import-cancel" class="btn">Cancel</button>
</div>
<div id="personal-import-result" class="pgn-result"></div>
</div>
</div>
<div id="library-overlay" class="drawer-overlay hidden"></div>
<div id="library-modal" class="library-modal hidden">
<div class="library-modal-header">
<h2>Opening Library</h2>
<button id="library-close" class="btn icon ghost">×</button>
</div>
<div class="library-modal-body">
<div id="library-list-area">
<input id="library-search" type="text" placeholder="Search openings..." />
<div id="library-results" class="library-results"></div>
<div id="library-status" class="library-status"></div>
</div>
<div id="library-detail" class="library-detail hidden">
<button id="library-detail-back" class="btn ghost">
<svg viewBox="0 0 24 24" width="16" height="16"><path fill="currentColor" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>
Back
</button>
<div class="library-detail-title" id="library-detail-name"></div>
<div class="library-detail-content">
<div id="library-detail-board" class="library-detail-board"></div>
<div class="library-detail-nav">
<button id="library-detail-start" class="btn icon" title="Start">
<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"/></svg>
</button>
<button id="library-detail-prev" class="btn icon" title="Previous">
<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>
</button>
<span id="library-detail-counter" class="library-detail-counter"></span>
<button id="library-detail-next" class="btn icon" title="Next">
<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>
</button>
<button id="library-detail-end" class="btn icon" title="End">
<svg viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"/></svg>
</button>
</div>
<button id="library-detail-add" class="btn">Add to repertoire</button>
</div>
</div>
</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>