-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (57 loc) · 1.84 KB
/
index.html
File metadata and controls
72 lines (57 loc) · 1.84 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>🐍Snake Game🐍</title>
<!-- Link to the external stylesheet -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<main class="page">
<div class="container">
<!-- Header / HUD area -->
<header class="hud">
<h1 class="title">🐍Snake Game🐍</h1>
<div class="score-row">
<div id="score" class="score">Score: 0</div>
<div class="hint">Use arrow keys (or on-screen buttons on mobile)</div>
</div>
</header>
<!-- Canvas wrapper to hold game and overlay -->
<div class="game-wrap">
<canvas id="game" width="600" height="600" aria-label="Snake game canvas"></canvas>
<!-- Overlay for Game Over state -->
<div id="overlay" class="overlay hidden" role="dialog" aria-hidden="true">
<div class="overlay-card">
<h2 id="gameoverText">Game Over</h2>
<p>Final score: <strong id="finalScore">0</strong></p>
<div class="controls">
<button id="restart" class="btn">Restart</button>
<button id="resume" class="btn ghost">Start / Resume</button>
</div>
</div>
</div>
</div>
<!-- Footer controls (Start/Restart + repo link) -->
<footer class="footer">
<div class="buttons">
<button id="startBtn" class="btn">Start / Resume</button>
<button id="pauseBtn" class="btn ghost">Pause</button>
</div>
</footer>
<!-- Simple mobile controls (will be hidden on desktop) -->
<nav class="mobile-controls" aria-hidden="true">
<button data-dir="up" class="m-btn">▲</button>
<div class="m-row">
<button data-dir="left" class="m-btn">◀</button>
<button data-dir="down" class="m-btn">▼</button>
<button data-dir="right" class="m-btn">▶</button>
</div>
</nav>
</div>
</main>
<!-- Link to the JavaScript file -->
<script src="script.js" defer></script>
</body>
</html>