-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
85 lines (77 loc) · 2.54 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Tapioca Anaconda</title>
<style>
body {
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
margin-left: 100;
background-color: black;
}
#game-board {
/* background-color: rgb(248, 210, 210); */
background-image: url("assets/background.jpeg");
width: 100vmin;
height: 100vmin;
display: grid;
grid-template-rows: repeat(20, 1fr);
grid-template-columns: repeat(20, 1fr);
grid-auto-rows: 5em;
grid-auto-columns: 5em;
}
.boba {
/* background-color: rgb(146, 250, 142); */
/* border: 0.25vmin solid black; */
/* border-radius: 50px; */
width: 2em;
height: 2em;
}
.food {
/* background-color: rgb(255, 255, 53); */
/* border: 0.25vmin solid black; */
width: 2em;
height: 2em;
}
</style>
<script src="game.js" defer type="module"></script>
<script>
src = "snake.js";
</script>
</head>
<body>
<div id="game-board"></div>
<!-- Add music -->
<div class="musicPlayer">
<img src="assets/musicIcon.png" id="icon" />
</div>
<audio id="mySong" autoplay loop>
<source
src="assets/Pharrell Happy 8bit MIDI version.mp3"
type="audio/mp3"
/>
</audio>
<script>
var mySong = document.getElementById("mySong");
mySong.volume = 0.1;
var icon = document.getElementById("icon");
icon.onclick = function () {
if (mySong.paused) {
mySong.play();
icon.src = "assets/musicIcon_pause.png";
} else {
mySong.pause();
icon.src = "assets/musicIcon.png";
}
};
</script>
</body>
</html>