-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
244 lines (217 loc) · 9.41 KB
/
index.php
File metadata and controls
244 lines (217 loc) · 9.41 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?php
require_once("namegame.php");
$game = new nameGame();
?><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">
<title>Name Game</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link rel="stylesheet" href="namegame.css">
</head>
<body>
<nav id="navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><img src="https://www.willowtreeapps.com/img/logo-black.png" height=30> The Name Game</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="xactive"><a href="#" id="newGame_btn" class="btn">Start New Game</a></li>
</ul>
<ul class="nav navbar-nav navbar-right" id="gameMenuItems">
<li class="active"><a href="#" id="menuTimer">Timer: <b></b></a></li>
<li class="active"><a href="#" id="menuScore">Score: <b></b></a></li>
</ul>
</div>
</div>
</nav>
<div id="mainStage">
<div class="container" id="startSplash" style="display: none;">
<div class="row extraRoom">
<div class="col-xs-12">
<h1 class="centered">Welcome to the Name Game!<br />
<small>Set your game options and learn your fellow employees names by having fun.</small></h1>
</div>
</div>
<form id="gameSelection">
<div class="row" id="gameOptions">
<div class="col-xs-12 col-sm-5 col-md-4">
<h4>Play Type:</h4>
<div id="gameType" class="btn-group-vertical" data-toggle="buttons">
<label class="btn btn-default active">
<input type="radio" name="gameType" value="face" id="gameType1" autocomplete="off" checked>
<span class="glyphicon glyphicon-user" aria-hidden="true"></span> Match the Face to the Name
</label>
<label class="btn btn-default">
<input type="radio" name="gameType" value="name" id="gameType2" autocomplete="off">
<span class="glyphicon glyphicon-screenshot" aria-hidden="true"></span> Match the Name to the Face
</label>
</div>
</div>
<div class="col-xs-12 col-sm-7 col-md-5">
<h4>Difficulty:</h4>
<div id="gameDifficulty" class="btn-group-vertical" data-toggle="buttons">
<label class="btn btn-default active">
<input type="radio" name="gameDifficulty" value="easy" id="gameDifficulty1" xautocomplete="off" checked>
<span class="glyphicon glyphicon-pawn" aria-hidden="true"></span> Easy: Keep guessing untill you get it right
</label>
<label class="btn btn-default">
<input type="radio" name="gameDifficulty" value="med" id="gameDifficulty2" xautocomplete="off">
<span class="glyphicon glyphicon-knight" aria-hidden="true"></span> Medium: 3 guesses, 2x the points
</label>
<label class="btn btn-default">
<input type="radio" name="gameDifficulty" value="hard" id="gameDifficulty3" xautocomplete="off">
<span class="glyphicon glyphicon-king" aria-hidden="true"></span> Hard: Only 1 guess, 3x the points
</label>
</div>
</div>
<div class="col-xs-12 col-sm-5 col-md-3">
<h4>Challenge Mode:</h4>
<div id="gameMode" class="btn-group-vertical" data-toggle="buttons">
<label class="btn btn-default active">
<input type="radio" name="gameMode" value="all" id="gameMode1" autocomplete="off" checked>
<span class="glyphicon glyphicon-picture" aria-hidden="true"></span> Use all names (default)
</label>
<label class="btn btn-default">
<input type="radio" name="gameMode" value="matt" id="gameMode2" autocomplete="off">
<span class="glyphicon glyphicon-fire" aria-hidden="true"></span> Everyone is named Matt
</label>
<label class="btn btn-default">
<input type="radio" name="gameMode" value="mike" id="gameMode3" autocomplete="off">
<span class="glyphicon glyphicon-fire" aria-hidden="true"></span> Everyone is named Mike
</label>
</div>
</div>
</div>
</form>
<div class="row extraRoom">
<div class="col-xs-12" style="text-align: center;">
<button id="startGame" type="button" class="btn btn-success btn-md">
<span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span> Let's Play!
</button>
</div>
</div>
<div class="row">
<div class="col-xs-12 hallOfFame">
<h2>Hall of Fame</h2>
<table class="table table-condensed table-striped">
<thead>
<th>Rank</th>
<th>Name</th>
<th>Score</th>
<th>Date</th>
<th>Type</th>
<th>Difficulty</th>
<th>Mode</th>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="container" id="gameContent" style="display: none;">
<div class="row">
<div class="col-xs-12">
Round:
<div class="progress">
<div id="gameProgress" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 10%;">
1 of 10
</div>
</div>
</div>
</div>
<div class="row extraRoom">
<div class="col-xs-12">
<h1 class="centered">Match the face to the name<br />
<small>Guesses Remaining: <b id="remaining">6</b><span id="bonusTimer">
<br />Timer Bonus: <b></b></span></small></h1>
</div>
</div>
<div class="row">
<div class="col-xs-12 extraRoom">
<h2 class="centered">Who is:</h2>
<p id="theQuestion"></p>
</div>
</div>
<div id="theChoices" class="row">
</div>
</div>
<div class="container" id="gameResults" style="display: none;">
<div class="row">
<div class="col-xs-12">
<form id="highScore" class="form-inline">
<h1>Congratulations!</h1>
<h3>You have made the Hall of Fame Leaderboard!</h3>
<div class="form-group">
<label for="userName">Name</label>
<input type="text" class="form-control" id="userName" placeholder="Jane Doe">
</div>
<button id="highScore_btn" class="btn btn-default">Add My Name</button>
</form>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4">
<h2>Your Game Results</h2>
<table class="table table-condensed table-striped " id="gameStats">
<thead>
<th>Round</th>
<th>Guesses</th>
<th>Time</th>
<th>Score</th>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="col-md-offset-1 col-xs-12 col-sm-6 col-md-7 hallOfFame">
<h2>Hall of Fame</h2>
<table class="table table-condensed table-striped">
<thead>
<th>Rank</th>
<th>Name</th>
<th>Score</th>
<th>Date</th>
<th>Type</th>
<th>Difficulty</th>
<th>Mode</th>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<footer class="footer">
<p class="text-muted">
© 2018 Steven Dunn. <a href="https://github.com/senigami/nameGame" target="_blank">View the game source on GitHub</a>
</p>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="namegame.js"></script>
<script type="text/javascript">
var gameInfo = <?=json_encode($game->getGameState())?>;
var leaderboard = <?=json_encode($game->getLeaderboard())?>;
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-587088-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-587088-1');
</script>
</body>
</html>