-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsnake.html
45 lines (37 loc) · 975 Bytes
/
snake.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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Snake! Snake!</title>
<style>
html {
text-align: center;
font-family: Helvetica, Arial, sans-serif;
}
#board {
width: calc(26 * 24px);
margin: auto;
}
#board div {
background-color: black;
border: 1px solid grey;
box-sizing: border-box;
float: left;
width: 24px;
height: 24px;
}
#board .snake {
background-color: green;
}
#board .apple {
background-color: red;
}
</style>
<script src="js/snake.js"></script>
</head>
<body onload="initGame()" onkeydown="enterKey(event)">
<h1>Snake</h1>
<div id="board"></div>
</body>
</html>