-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
216 lines (198 loc) · 8 KB
/
Copy pathindex.html
File metadata and controls
216 lines (198 loc) · 8 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
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>Four Connect</title>
<link rel="stylesheet" href="./style/style.css" />
</head>
<body>
<!-- Site Header -->
<header class="site-header" role="banner">
<nav class="nav container" aria-label="Primary">
<a href="#" class="brand" aria-label="Four Connect Home">
<span class="disc-icon red">🔴</span>
<span class="disc-icon yellow">🟡</span>
<span class="brand-text">Four Connect</span>
</a>
<div class="nav-actions">
<button id="themeToggle" class="btn tertiary" type="button">🌙 Dark</button>
</div>
</nav>
</header>
<main class="game-container container" role="main">
<!-- Hero / Header Section -->
<header class="game-header">
<div class="header-decoration">
<span class="disc-icon red">🔴</span>
<span class="disc-icon yellow">🟡</span>
</div>
<h1 class="title">Four Connect</h1>
<p class="subtitle">Classic strategy game • Connect four discs to win</p>
<!-- Settings Summary + Quick open -->
<div class="settings-summary" aria-live="polite">
<button id="openSettings" class="chip action" type="button">⚙️ Settings</button>
<span class="chip"><strong>Mode:</strong> <span id="summary-mode">Two Players</span></span>
<span class="chip"><strong>Board:</strong> <span id="summary-board">7×6</span></span>
<span id="chip-diff" class="chip"><strong>AI:</strong> <span id="summary-difficulty">Medium</span></span>
<span id="chip-play" class="chip"><strong>You:</strong> <span id="summary-playas">🔴 Red</span></span>
</div>
<!-- Controls Toolbar -->
<div class="toolbar">
<div class="toolbar-left">
<button id="reset" class="btn primary" type="button">
<span class="btn-icon">🔁</span><span>Restart</span>
</button>
<button id="undo" class="btn secondary" type="button" aria-label="Undo last move">
<span class="btn-icon">↩️</span><span>Undo</span>
</button>
<button id="redo" class="btn secondary" type="button" aria-label="Redo last undone move">
<span class="btn-icon">↪️</span><span>Redo</span>
</button>
</div>
<div class="toolbar-right controls-hint">
<span class="hint-icon">⌨️</span>
<span>Mouse or ←/→ to move • Space/Enter to drop • 1–9 quick drop</span>
</div>
</div>
</header>
<!-- Status -->
<div id="status" class="status" role="status" aria-live="polite" aria-atomic="true">
Player 1's Turn (🔴 Red)
</div>
<div id="thinking" class="thinking" aria-live="polite" aria-atomic="true" hidden>🤖 AI thinking…</div>
<!-- Game Board -->
<div
id="board"
class="board"
role="grid"
aria-label="Connect Four board, 7 columns by 6 rows. Click or use arrow keys to choose a column."
aria-rowcount="6"
aria-colcount="7"
aria-describedby="sr-instructions"
tabindex="0"
></div>
<p id="sr-instructions" class="visually-hidden">
Use left and right arrow keys to choose a column, Enter to drop. You can also press a number key from 1 to 9 to drop immediately. Use Control or Command plus Z to undo, Control plus Y or Control plus Shift plus Z to redo.
</p>
<!-- Scoreboard -->
<section class="scoreboard card" aria-live="polite" aria-atomic="true">
<div class="scoreboard-header">
<h2>Match Score</h2>
</div>
<div class="scoreline">
<div class="score-item">
<span id="score-red-name" class="player-name">Red</span>
<span id="score-red" class="badge red-badge">0</span>
</div>
<div class="score-item draws">
<span class="player-name">Draws</span>
<span id="score-draws" class="badge draw-badge">0</span>
</div>
<div class="score-item">
<span id="score-yellow-name" class="player-name">Yellow</span>
<span id="score-yellow" class="badge yellow-badge">0</span>
</div>
</div>
<div class="score-actions">
<button id="scoreReset" class="btn tertiary small" type="button">
<span class="btn-icon">🔄</span>
<span>Reset Score</span>
</button>
</div>
</section>
<!-- Settings Panel -->
<section class="panel card">
<details id="settings-panel">
<summary>
<span class="summary-icon">⚙️</span>
<span>Game Settings</span>
</summary>
<div class="settings-content">
<div class="settings-grid">
<div class="field">
<label for="mode">
<span class="label-icon">🎮</span>
<span>Game Mode</span>
</label>
<select id="mode">
<option value="pvp">Two Players</option>
<option value="pva">Solo vs AI</option>
</select>
</div>
<div class="field">
<label for="difficulty">
<span class="label-icon">🎯</span>
<span>AI Difficulty</span>
</label>
<select id="difficulty">
<option value="easy">Easy</option>
<option value="medium">Medium</option>
</select>
</div>
<div class="field">
<label for="playAs">
<span class="label-icon">🎭</span>
<span>Play As</span>
</label>
<select id="playAs">
<option value="red">🔴 Red (first)</option>
<option value="yellow">🟡 Yellow (second)</option>
</select>
</div>
<div class="field">
<label for="nameRed">
<span class="label-icon">👤</span>
<span>Red Player Name</span>
</label>
<input id="nameRed" type="text" placeholder="Player 1" maxlength="24">
</div>
<div class="field">
<label for="nameYellow">
<span class="label-icon">👤</span>
<span>Yellow Player Name</span>
</label>
<input id="nameYellow" type="text" placeholder="Player 2" maxlength="24">
</div>
<div class="field">
<label>
<span class="label-icon">📐</span>
<span>Board Size</span>
</label>
<div class="size-row">
<input id="colsInput" type="number" min="4" max="12" value="7" aria-label="Columns">
<span class="size-separator">×</span>
<input id="rowsInput" type="number" min="4" max="12" value="6" aria-label="Rows">
</div>
<div class="size-presets">
<button class="chip" data-preset="7x6" type="button">7×6 Classic</button>
<button class="chip" data-preset="7x7" type="button">7×7</button>
<button class="chip" data-preset="8x8" type="button">8×8</button>
</div>
</div>
<div class="field full">
<button id="apply" class="btn primary full-width" type="button">
<span class="btn-icon">✓</span>
<span>Apply & New Game</span>
</button>
</div>
</div>
</div>
</details>
</section>
</main>
<!-- Page Footer -->
<footer class="site-footer">
<div class="container footer-inner">
<div class="footer-left">
<span class="brand-mini">🔴🟡 Four Connect</span>
<span class="sep"></span>
</div>
<div class="footer-right">
<span>Made with Saurav ❤️ · Theme: <span id="footer-theme-label">Dark</span></span>
</div>
</div>
</footer>
<script src="./script/script.js" defer></script>
</body>
</html>