-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
63 lines (42 loc) · 1.45 KB
/
index.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html>
<head>
<title>Tetris</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon.ico">
</head>
<body>
<div class="gameboy-body">
<div class="darkgray-plastic">
<div>
<div class="flashing-light"></div>
<div class="battery"><p>BATTERY</p></div>
</div>
<canvas class="overlay" style="background-color:#9bbc0f" width="320" height="640" id="game"></canvas>
<div class="overlay game-info" id="game-info">
<div class="score">Score <span id="score"><br>0</span></div>
<div class="lines">Lines <span id="lines"><br>0</span></div>
<div class="level">Level <span id="level"><br>1</span></div>
<div id="tetromino-container"></div>
</div>
<div id="hscore">
<div class="underline">
<h3 class="underline2">Highscores</h3>
</div>
<ul id="highscoresList"></ul>
</div>
</div>
</div>
</body>
</html>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="app.js"> </script>
<script>
document.addEventListener('keydown', function(event) {
// Check if the pressed key is one of the arrow keys or the space bar
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Space'].includes(event.key)) {
event.preventDefault(); // Prevent the default scroll action
}
});
</script>