-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
345 lines (302 loc) · 11.2 KB
/
index.html
File metadata and controls
345 lines (302 loc) · 11.2 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="css\nav.css">
<link rel="stylesheet" type="text/css" href="css\general.css">
<link rel="stylesheet" type="text/css" href="css\game.css">
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script type="text/javascript" src="js\app.js"></script>
<script type="text/javascript" src="js\login.js"></script>
<script type="text/javascript" src="js\Settings.js"></script>
<script type="text/javascript" src="js\SignUp.js"></script>
<!-- jQuery Modal -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css" />
</head>
<header>
<!--- Insert logo & other information here -->
<div id="logo" class="logo">
<img id="pacmanTitleImage" height="90" src="Images\packman.png" />
</div>
</header>
<body>
<!-- Side navigation -->
<div class="sidenav">
<a href="#" onclick="canGoToSetupWelcomeScreen()">Welcome</a>
<a id="about" href="#myModal" rel="modal:open">About</a>
<a href="#" onclick="canGoToRegister()">Sign Up</a>
<a href="#" onclick="canGoToLogin()">Sign In</a>
<a href="#" onclick="canGoToSettings()">Settings</a>
</div>
<!-- About Modal -->
<div id="myModal" class="modal">
<h2>About</h2>
<p>Authors: Alon Gutman & Amit Shakarchy.</p>
<p>Our most difficult parts of the assignment were giving the monsters a "smart" movement, and organizing our
code properly.</p>
<p>For this Modal Dialog's implementation, we used jQuery Modal plugin (jquerymodal.com) </p>
<a href="#" rel="modal:close">Close</a>
</div>
<div id="notLoggedIn" class="modal">
<!-- Modal content -->
<div class="modal-content">
<p>Please log in or sign up first.</p>
</div>
</div>
<div id="GameOverModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<p>Game Over!</p>
<button id="gameOverSettings" onclick="SettingsFromModal()">Go to settings</button>
<button id="gameOverSettings" onclick="startOver()">Start Over</button>
</div>
</div>
<!--- GameOver screen -->
<div id="gameOverLoser" style="display: none;">
<h1 style="font-family:courier;"> Game Over! </h1>
<img src="Images\monsterOrange.jpeg" id="imglogin" width=120>
<div id="gameOverLoserBox">
<h2>Loser!!!!!!!!</h2>
<div id="gameOverButton">
<button id="gameOverBtn" type="button" class="gameOverButton" onclick="startOver()"> Start Over </button>
<button type="button" class="gameOverButton"onclick="canGoToSettings()">Go to settings</button>
</div>
</div>
</div>
</div>
<!--- GameOver screen -->
<div id="gameOverWinner" style="display: none;">
<h1 style="font-family:courier;"> Game Over! </h1>
<img src="Images\monsterOrange.jpeg" id="imglogin" width=120>
<div id="gameOverWinnerBox">
<h2>Winner !!!!!!!!!!!</h2>
<div id="gameOverB">
<button type="button" class="gameOverButton" onclick="startOver()"> Start Over </button>
<button type="button" class="gameOverButton"onclick="canGoToSettings()">Go to settings</button>
</div>
</div>
</div>
</div>
<!-- Page content -->
<div class="main">
<!--Game screen-->
<div id="GameScreen" style="display: none;">
<!--Sound :) -->
<audio id="generalSound" src="Sounds\mr_clown.mp3" type="audio/mpeg" preload="auto" loop></audio>
<div id="gameInfo">
<div id="usernameBox">
<label for="lblUsername">Username:</label>
<input id="lblUsername" type="text" style="width: 8em; margin-left: 4%;" />
</div>
<div id="score">
<label for="lblScore">SCORE:</label>
<input id="lblScore" type="text" style="width: 8em; margin-left: 4%;" />
</div>
<div id="life">
<label for="lblLifeCount">Life:</label>
<input id="lblLifeCount" type="text" style="width: 8em; margin-left: 4%;" />
</div>
<div id="time">
<label for="lblTime">TIME:</label>
<input id="lblTime" type="text" style="width: 8em; margin-left: 4%;" />
</div>
<div id="New Game">
<button id="newGame" type="button" class="gameOverButton" onclick="startOver()">New Game</button>
</div>
</div>
<div id="game">
<canvas id="canvas" height="400" width="400"></canvas>
</div>
<div id="settingsView">
<h3 class="innerTitle">My Settings:</h3>
<h4 class="innerTitle">Key Controls:</h4>
<div class="view">
<!-- <label class="keyView" for="up">Up:</label> -->
Up: <output id="UpkeyView">0</output>,
</div>
<div class="view">
<!-- <label class="keyView" for="down">Down:</label> -->
Down: <output id="DownkeyView"></output>,
</div>
<div class="view">
Left: <output id="LeftkeyView"></output>,
</div>
<div class="view">
Right: <output id="RightkeyView"></output>
</div>
<div class="view">
<h4 class="innerTitle">Candy Colors:</h4>
<div class="view">
<div class="color_5">
<P id="colorTxt">5 points</P>
</div>
</div>
<div class="view">
<div class="color_15">
<P id="colorTxt">15 points</P>
</div>
</div>
<div class="view">
<div class="color_25">
<P id="colorTxt">25 points</P>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="view">
<h4 class="innerTitle">Other Settings:</h4>
<br>
Game length in minutes: <output id="length"></output>
<br>
Number of monsters: <output id="monstersNum"></output>
<br>
Number of candies: <output id="candyNum"></output>
</div>
</div>
<div class="clearfix"></div>
</div>
<!--end of gameScreen-->
<!--- Welcome screen -->
<div id="welcome" style="display: none;">
<h1 style="font-family:courier;"> Welcome! </h1>
<img src="Images\monsterOrange.jpeg" id="imglogin" width=120>
<div id="welcomeButton">
<button id="loginBtn" type="button" class="welcomeButton"> Login </button>
<button id="registerBtn" type="button" class="welcomeButton">Register</button>
</div>
</div>
<!--- Login screen -->
<div class="container" id="login" style="display: none;">
<div class="login-content">
<h1 class="title">Sign in to play!</h1>
<form id="loginForm" class="form">
<div class="loginInput">
<input id="usernameInput" type="text" class="input" placeholder="User Name">
</div>
<div class="loginInput">
<input id="passwordInput" type="password" class="input" placeholder="Password">
</div>
<input id="submit" type="submit" class="submit" value="submit">
<br>
</form>
<a id="backToMainPage" href="index.html">Back to main page</a>
</div>
</div>
<!--- Register screen -->
<div class="hero" id="register" style="display: none;">
<div class="form-box">
<h1 class="title">Sign up here!</h1>
<form class="form" id="registration_form">
<div class="regInput">
<input type="text" id="form_uname" class="input" placeholder="User Name" required>
<span class="error_form" id="uname_error_message"></span>
</div>
<div class="regInput">
<input type="text" id="form_fname" class="input" placeholder="First Name" required>
<span class="error_form" id="fname_error_message"></span>
</div>
<div class="regInput">
<input type="text" id="form_lname" class="input" placeholder="Last Name" required>
<span class="error_form" id="lname_error_message"></span>
</div>
<div class="regInput">
<input type="email" id="form_email" class="input" placeholder="Email" required>
<span class="error_form" id="email_error_message"></span>
</div>
<div class="regInput">
<input type="password" id="form_password" class="input" placeholder="Password" required>
<span class="error_form" id="password_error_message"></span>
</div>
<div class="regInput">
<input placeholder="Birth Date" class="textbox-n" type="text" onfocus="(this.type='date')"
onblur="(this.type='text')" id="date" required />
</div>
<input type="submit" value="Register" name="">
<br>
</form>
<a id="backToMainPage" href="index.html">Back to main page</a>
</div>
</div>
<div id="settingsScreen" style="display: none;">
<div class="login-content">
<h1 class="title">Settings!</h1>
<form id="settingsForm" class="form">
<button id="randomButton" class="randomButton">
<p>Random values</p>
</button>
<!--keyboard controls picker-->
<h4 class="innerTitle">Choose keyboard controls</h4>
<div class="key">
<label for="up">Up</label>
<input id="up" type="text" class="input" onkeydown="setUpKey(event)" title="ddd">
<p id="upVal"></p>
</div>
<div class="key">
<label for="down">Down</label>
<input id="down" type="text" class="input" onkeydown="setDownKey(event)">
</div>
<div class="key">
<label for="left">Left</label>
<input id="left" type="text" class="input" onkeydown="setLeftKey(event)">
</div>
<div class="key">
<label for="right">Right</label>
<input id="right" type="text" class="input" onkeydown="setRightKey(event)">
</div>
<!--Game length picker-->
<div class="slider">
<label for="vol">Select game length (in minutes)</label>
<div class="range-slider">
<input id="gameLength" class="range-slider__range" type="range" value="1" min="1" max="6">
<output class="range-slider__value">0</output>
</div>
</div>
<!--Number of monsters length picker-->
<div class="slider">
<div class="range-slider">
<label for="vol">Select number of monsters</label>
<input id="monstersAmount" class="range-slider__range" type="range" value="1" min="1"
max="4">
<output class="range-slider__value">0</output>
</div>
</div>
<!--Candy amount picker-->
<div class="slider">
<label for="vol">Choose candy amount (between 50 and 90):</label>
<input id="candyAmount" class="range-slider__range" type="range" min="50" max="90" value="50">
<output id="candyAmountVal" class="range-slider__value">0</output>
</div>
<!--Candy colors picker-->
<div class="i">
<h4 class="innerTitle"> Choose candy colors</h4>
<div class="colorBox">
<label for="color_5_Points"> 5 point (60%)</label>
<input class="CandyColor" type="color" id="color_5_Points" name="color_5_Points"
value="#ff0000">
</div>
<div class="colorBox">
<label for="color_15_Points"> 15 point (30%)</label>
<input class="CandyColor" type="color" id="color_15_Points" name="color_15_Points"
value="#ff0000">
</div>
<div class="colorBox">
<label for="color_25_Points"> 25 point (10%)</label>
<input class="CandyColor" type="color" id="color_25_Points" name="color_25_Points"
value="#ff0000">
</div>
</div>
<input id="submit" type="submit" class="submit" value="start!">
<br>
</form>
<a id="backToMainPage" href="index.html">Back to main page</a>
</div>
</div>
</div>
<!--end of main page div-->
<footer>
<p>Ⓒ Amit Shakarchy & Alon Gutman </p>
<p>amitshakarchy@gmail.com</p>
</footer>
</body>
</html>