-
Notifications
You must be signed in to change notification settings - Fork 0
/
pong.html
47 lines (47 loc) · 1.29 KB
/
pong.html
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
<!DOCTYPE html>
<html>
<head>
<title>Pong Game</title>
<style>
#gameCanvas {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
}
#startMenu {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.dark-mode {
filter: invert(1);
background: black;
}
</style>
</head>
<body>
<div id="startMenu">
<button id="startButton">Start Game</button>
<button id="darkModeToggle">Toggle Dark Mode</button>
<select id="speedChanger">
<option value="0.25">0.25x</option>
<option value="0.5">0.5x</option>
<option value="0.75">0.75x</option>
<option value="1" selected>1x</option>
</select>
</div>
<canvas id="gameCanvas"></canvas>
<script src="pong.js"></script>
<script>
document.getElementById('startButton').addEventListener('click', function() {
document.getElementById('startMenu').style.display = 'none';
document.getElementById('gameCanvas').style.display = 'block';
startGame();
});
</script>
</body>
</html>