-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
70 lines (70 loc) · 1.87 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Snake</title>
<style>
body{
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
background-color: #000;
}
html, body {overflow: hidden}
#game-board{
background-color: #ccc;
width: 100vmin;
height: 100vmin;
display: grid;
grid-template-rows: repeat(21, 1fr);
grid-template-columns: repeat(21, 1fr);
}
.snake{
background-color: hsl(200, 100%, 50%);
border: .25vmin solid black;
}
.food{
background-color: #d11818;
border: .25vmin solid #d11818;
border-radius: 50%;
}
#high-score-title{
color: #fff;
position: absolute;
}
#score-title{
color: #fff;
position: absolute;
}
@media screen and (max-width: 480px) {
#score-title{
top: 45px;
}
#high-score-title{
top: 20px;
}
}
@media screen and (min-width: 480px) {
#high-score-title{
top: 170px;
left: 140px;
}
#score-title{
left: 140px;
top: 200px;
}
}
</style>
<script src="js/main.js" defer type="module"></script>
<script src="js/swiped-events.js"></script>
</head>
<body>
<h3 id="high-score-title">High Score: <span id="high-score">0</span></h3>
<h3 id="score-title">Score: <span id="score">0</span></h3>
<div id="game-board"></div>
</body>
</html>