forked from erhankilic/snake-game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
115 lines (111 loc) · 3.38 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Snake Game!</title>
<style type="text/css">
@font-face {
font-family: 'PressStart2P';
src: url('font/PressStart2P.ttf');
}
body {
font-family: PressStart2P;
}
.text-center {
text-align: center;
}
#start-game, #stop-game {
text-decoration: underline;
}
#start-game:hover, #stop-game:hover {
cursor: pointer;
}
#stop-game {
display: none;
}
.main-container {
width: 85%;
margin: 0 auto;
}
.game-container {
text-align: center;
float: left;
width: 70%;
}
.game-container > .game-area {
border: 1px solid black;
display: inline-block;
}
.game-container > .game-area > .row {
overflow: hidden;
}
.game-container > .game-area > .row > .cell {
border: 1px solid rgba(0, 0, 0, .1);
width: 5px;
height: 5px;
display: block;
float: left;
}
.game-container > .game-area > .row > .cell.black {
background-color: black;
border-color: black;
}
.game-setting {
text-align: center;
float: left;
width: 30%;
}
.game-setting > .setting-group {
margin-bottom: 10px;
}
.game-setting > .setting-group > label {
display: block;
font-size: .75em;
margin-bottom: 5px;
}
.game-setting > .setting-group > .setting {
display: inline-block;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="main-container">
<div class="game-container">
<h3 class="text-center" id="start-game">Start Game</h3>
<h3 class="text-center" id="stop-game">Stop Game</h3>
<h3 class="text-center" id="score-container"><u>Score</u> <br /><span id="score">0</span></h3>
<div class="game-area"></div>
</div>
<div class="game-setting">
<h3>Game Settings</h3>
<div class="setting-group">
<label for="game-difficulty"><u>Game Difficulty</u></label>
<select name="gameDifficulty" class="setting" id="game-difficulty">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option selected>9</option>
<option>10</option>
</select>
</div>
<div class="setting-group">
<label>Game Area (Row x Cell)</label>
<input type="number" id="row-length" class="setting" value="64" />
<input type="number" id="cell-length" class="setting" value="64" />
<br />
<br />
<button id="set-game-settings">Set Settings</button>
</div>
</div>
</div>
<script type="text/javascript" src="snake.js"></script>
<script type="text/javascript" src="core.js"></script>
</body>
</html>