-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
76 lines (64 loc) · 2.37 KB
/
index.html
File metadata and controls
76 lines (64 loc) · 2.37 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="description" content="Classic Snake Game">
<meta name="author" content="JJTeoh, Gemini 2.5Pro">
<meta name="keywords" content="Snake, Game, Canvas, JavaScript, HTML, CSS">
<title>Classic Snake Game</title>
<link rel="stylesheet" href="style.css" />
<link rel="icon" href="media/favicon.ico" type="image/x-icon" />
</head>
<body>
<div class="game-container">
<div class="header">
<h1>Snake</h1>
<div id="score">Score: 0</div>
</div>
<div class="canvas-container">
<!-- canvas for the game -->
<canvas id="gameCanvas"></canvas>
<div id="gameOver" class="overlay hidden">
<div class="message-box">
<h2>Game Over!</h2>
<p>Your Score: <span id="finalScore">0</span></p>
<button id="restartButton">Play Again</button>
</div>
</div>
<div id="startMessage" class="overlay">
<div class="message-box">
<h2>Classic Snake</h2>
<p>Use Arrow Keys or Tap Controls</p>
<button id="startButton">Start Game</button>
</div>
</div>
<div id="pausedMessage" class="overlay hidden">
<div class="message-box">
<h2>PAUSED</h2>
</div>
</div>
</div>
<div class="controls-container">
<button class="control-btn" id="btnUp">▲</button>
<div>
<button class="control-btn" id="btnLeft">◀</button>
<button class="control-btn" id="btnDown">▼</button>
<button class="control-btn" id="btnRight">▶</button>
</div>
</div>
</div>
<!-- Easter Egg Video -->
<video id="easterEggVideo" class="easter-egg-video hidden" playsinline>
<source src="media/easter-egg-Lisan-al-Gaib.mp4" type="video/mp4">
</video>
<footer class="footer">
<p><small>Canvas Snake Game by <a href="https://github.com/jjteoh-thewebdev" target="_blank">JJTeoh</a> with ❤️</small></p>
<p><a href="https://github.com/jjteoh-thewebdev/html-canvas-snake/issues" target="_blank">Report Bug</a></p>
</footer>
<script src="script.js"></script>
</body>
</html>