-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (54 loc) · 2.12 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="public/style.css">
<link rel="stylesheet" type="text/css" href="public/stars.css">
<title>Tetris 😊</title>
<link rel="shortcut icon" href="assets/tetris.svg" type="image/x-icon">
</head>
<body>
<audio id="back" src="assets/tetris.mp3" loop autoplay>
<source id="tetris" src="assets/tetris.mp3" type="audio/mp3">
</audio>
<audio id="bubble" src="assets/bubble.mp3">
<source src="assets/bubble.mp3" type="audio/mp3">
</audio>
<audio id="bubble2" src="assets/bubble2.mp3">
<source src="assets/bubble2.mp3" type="audio/mp3">
</audio>
<div id='stars'></div>
<div id='stars2'></div>
<div id='stars3'></div>
<div id="night" class="night grid">
<canvas id="board" class="game-board"></canvas>
<div class="right-column">
<div>
<h1>TETRIS</h1>
<p>Score: <span id="score">0</span></p>
<p>Lines: <span id="lines">0</span></p>
<p>Level: <span id="level">0</span></p>
<canvas id="next" class="next"></canvas>
</div>
<button onclick="play()" class="play-button">Play</button>
</div>
</div>
<div id='stars'></div>
<div id='stars2'></div>
<div id='stars3'></div>
<script type="text/javascript" src="public/constants.js"></script>
<script type="text/javascript" src="public/game.js"></script>
<script type="text/javascript" src="public/piece.js"></script>
<script type="text/javascript" src="public/main.js"></script>
<script>
var audio = document.getElementById("back")
audio.volume = 0.8;
document.addEventListener('click', async _ => {
await audio.play()
})
</script>
</body>
</html>