-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
96 lines (85 loc) · 2.04 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
86
87
88
89
90
91
92
93
94
95
96
<html>
<head>
<title>Snake!</title>
<script src="jquery-1.10.2.min.js"></script>
<script src="script.js"></script>
<style>
body {
background-color: #757575;
}
h1 {
text-align: center;
}
.example {
float: none;
margin-right: .3em;
margin-bottom: .3em;
}
#info {
float: left;
margin: 1em;
padding: 1em;
}
#info p {
font-size: larger;
}
#board {
width: 300px; /* 40 == 600 */
height: 300px; /* 20 == 300 */
margin-left: auto; /* 10 == 150 */
margin-right: auto;
}
#start {
margin-top: 1em;
}
#main {
text-align: center;
}
.square {
width: 13px;
height: 13px;
background-color: #272822;
border: 1px solid #020000;
float: left;
}
.food {
background-color: blue;
border: 2px solid darkblue;
width: 11px;
height: 11px;
}
.snake {
width: 11px;
height: 11px;
background-color: red;
border: 2px solid darkred;
}
</style>
</head>
<body>
<h1>Snake!</h1>
<div id="info">
<p>Current Score: <span id="score">0</span></p>
<div class="square food example"></div> Food<br/>
<div class="square snake example"></div> Snake<br/>
<br/>
<div>Grid Size:<br/>
<label><input name="grid" type="radio" value="10" id="smallGrid"/>Small</label><br/>
<label><input name="grid" type="radio" value="20" checked="checked" id="mediumGrid"/>Medium</label><br/>
<label><input name="grid" type="radio" value="40" id="largeGrid"/>Large</label><br/>
</div>
<br/>
<div>Speed:<br/>
<label><input name="speed" type="radio" value="1000" id="slowSpeed"/>Slow</label><br/>
<label><input name="speed" type="radio" value="500" checked="checked" id="mediumSpeed"/>Medium</label><br/>
<label><input name="speed" type="radio" value="250" id="fastSpeed"/>Fast</label><br/>
</div>
<p> Use arrow keys to move snake.</p>
<button id="start">Click to start (or press 'P')</button>
</div>
<div id="main">
<div id="board">
</div>
</div>
</body>
</html>