-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
264 lines (182 loc) · 9.5 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
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
<!DOCTYPE html>
<!-- A declaração DOCTYPE declara a versão do HTML usado no documento -->
<html lang="en">
<link rel="stylesheet" href="extension.css" type="text/css"/>
<head >
<meta charset=UTF-8> <!-- para caracteres acentuados -->
<title> Mancala </title> <!-- texto na decoração da janela -->
<link rel="icon" href="images/logo.png" type="image/png">
</head>
<body>
<div id="page-mask"></div>
<div id=header class=edges>
<img id=logo src="images/logo.png" alt="logo">
<div id="loginNickDisplay"></div>
<button id=login class=edgeButtons type="button" onclick="openLoginForm()">Login</button>
</div>
<div class="Form" id="loginForm">
<div class="form-container registerForms">
<h1>Login</h1>
<div id="feedbackLogin"></div>
<br>
<label for="username"><b>Username</b></label>
<input id="loginNick" type="text" placeholder="Enter Username" name="username" required>
<label for="psw"><b>Password</b></label>
<input id="loginPass" type="password" placeholder="Enter Password" name="psw" required>
<button id="loginFormBttn" type="submit" class="btn" onclick="login()">Login</button>
<button type="button" class="btn cancel" onclick="closeLoginForm()">Close</button>
</div>
</div>
<div id="main">
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>
<div id='stars'></div>
<div id='stars2'></div>
<div id='stars3'></div>
<div id='title'></div>
</div>
<div id="main-page" >
<div id="logo-button">
<img id="main-logo" src="images/logo.png" alt="logo">
<button type="button" id="play-button" onclick="play()">Play</button>
</div>
</div>
<div class="instructions-rankings">
<div id="instructions-rankings-buttons">
<button type="button" class="instructions-rankings-buttons" class="popup" id="instructions-button" onclick="instructionsOn()"> Instructions </button>
<button type="button" class="instructions-rankings-buttons" class="popup" id="rankings-button" onclick="rankingsOn()"> Classifications </button>
</div>
<div id="instructions-popup">
<div id="window1">
<h1>Forma de jogar</h1>
<p><br>Jogadores semeiam as suas sementes alternadamente<br>
Na sua vez semeiam a partir de uma das suas cavidades<br>
Consoante a situação da última semente semeada, podem<br>
  voltar a jogar<br>
  ficar com algumas sementes do adversário<br>
Termina quando um dos jogadores fica sem sementes</p>
</div>
<div id="window2">
<h1>Começar a semear</h1>
<p><br>Escolher uma cavidade do seu lado (que não o armazém)<br>
Recolher todas as N sementes dessa cavidade<br>
Colocar 1 semente nas N cavidade seguintes<br>
A semeadura é feita no sentido anti-horário </p>
</div>
<div id="window3">
<h1>Continuar a semear</h1>
<p><br>Se a cavidade seguinte for o seu armazém, semear também<br>
Sobrando sementes, continuar no lado do adversário<br>
Se atingir o armazém do adversário, não semear<br>
Mas depois continuar do seu lado, se ainda tiver sementes</p>
</div>
<div id="window4">
<h1>Última semente em armazem</h1>
<p><br>Volta a jogar se a última semente for semeada for no seu próprio armazém<br>
Semeando cavidade agora vazia, a última semente cai no armazém e volta a jogar</p>
</div>
<div id="window5">
<h1>Última semente em cavidade vazia</h1>
<p><br>Se a última semente calhar numa sua cavidade vazia, transferir para o seu armazém as sementes<br>
  na cavidade oposta, do adversário<br>
  assim como essa última semente semeada</p>
</div>
<div id="window6">
<h1>Terminar</h1>
<p><br>Jogo termina quando um dos jogadores não pode jogar<br>
… porque todas as suas cavidades estão vazias<br>
O outro jogador recolhe sementes nas suas cavidades …<br>
… que são colocadas no seu armazém<br>
Ganha jogador cujo armazém tem mais sementes</p>
</div>
<div id="instructions-windows-buttons">
<button type="button" class="instructions-window-buttons instructions-window" id="instructions-window1" onclick="window1()"> 1 </button>
<button type="button" class="instructions-window-buttons instructions-window"" id="instructions-window2" onclick="window2()"> 2 </button>
<button type="button" class="instructions-window-buttons instructions-window" id="instructions-window3" onclick="window3()"> 3 </button>
<button type="button" class="instructions-window-buttons instructions-window" id="instructions-window4" onclick="window4()"> 4 </button>
<button type="button" class="instructions-window-buttons instructions-window" id="instructions-window5" onclick="window5()"> 5 </button>
<button type="button" class="instructions-window-buttons instructions-window" id="instructions-window6" onclick="window6()"> 6 </button>
</div>
<button type="button" id="instructions-windowX" onclick="windowX()"> X </button>
</div>
<div id="rankingsPopup" name="rankingsPopup">
<div id="globalClassifications">
<h1>Global Classifications<br> </h1>
<div id="rankingsResult"></div>
</div>
<div id="localClassifications">
<h1>Local Classifications<br><br> </h1>
<div id="localrankingsResult"></div>
</div>
<button type="button" id="instructions-windowX" onclick="closeRankings()"> X </button>
</div>
</div>
<div class="game" id="game">
<div id="game-configs">
<div class="game-title">
<h1>MANCALA</h1>
</div>
<div id="oneplayer-text"><h1>Player vs CPU</h1></div>
<img class="icons" id="oneplayer-img" class="icons" src="images/oneplayer.png" alt="one player">
<div id="difficulty-input">
<select name="difficulty" id="difficulty" class="box">
<option selected value="2">random</option>
<option value="3">easy</option>
<option value="4">medium</option>
<option value="5">hard</option>
</select>
</div>
<hr id="configs-line">
<div id="twoplayers-text"><h1>Player vs Player</h1></div>
<img class="icons" id="twoplayers-img" src="images/twoplayers.png" alt="two players">
<input type="button" id="toggle_gamemode" onclick="gamemodeButtonClick()" alt="Toggle">
<div id="numseeds-text"><h1>Seeds per pit</h1></div>
<div id="seed-buttons">
<button type="button" class="seed-buttons" id="threeseeds-button" onclick="chooseSeedsPerPit('threeseeds-button')"> 3 </button>
<button type="button" class="seed-buttons" id="fourseeds-button" onclick="chooseSeedsPerPit('fourseeds-button')"> 4 </button>
<button type="button" class="seed-buttons" id="fiveseeds-button" onclick="chooseSeedsPerPit('fiveseeds-button')"> 5 </button>
<button type="button" class="seed-buttons" id="sixseeds-button" onclick="chooseSeedsPerPit('sixseeds-button')"> 6 </button>
</div>
<div id="numpits-text"><h1>Pits per player</h1></div>
<div id="pits-buttons">
<button type="button" class="pits-buttons" id="fourpits-button" onclick="choosePitsPerPlayer('fourpits-button')"> 4 </button>
<button type="button" class="pits-buttons" id="fivepits-button" onclick="choosePitsPerPlayer('fivepits-button')"> 5 </button>
<button type="button" class="pits-buttons" id="sixpits-button" onclick="choosePitsPerPlayer('sixpits-button')"> 6 </button>
<button type="button" class="pits-buttons" id="sevenpits-button" onclick="choosePitsPerPlayer('sevenpits-button')"> 7 </button>
</div>
<button type="button" id="startgame-button" onclick="startGame()"> Start Game </button>
</div>
<div id="win-popup">
<h1>YOU WIN!</h1>
<button type="button" id="win-ok-button" onclick="okWin()"> Ok </button>
</div>
<div id="lose-popup">
<h1>YOU LOST!</h1>
<button type="button" id="lose-ok-button" onclick="okLose()"> Ok </button>
</div>
<div id="tie-popup">
<h1>IT'S A TIE!</h1>
<button type="button" id="tie-ok-button" onclick="okTie()"> Ok </button>
</div>
<div id="game-board">
<div class="game-title">
<h1>MANCALA</h1>
</div>
<div id="name1">Player1</div>
<div id="values1"></div>
<div id="storage1" class="allPits"></div>
<div id="storageValue1" class="allValues"></div>
<div id="storageValue2" class="allValues"></div>
<div id="board"></div>
<div id="storage2" class="allPits"></div>
<div id="values2"></div>
<div id="name2">Player2</div>
<div id="messages"></div>
<button type="button" id="giveup-button" onclick="giveUp()"> Give Up </button>
<button type="button" id="back-button" onclick="back()"> Back </button>
</div>
</div>
<br>
<br>
<script src="js/requests.js"></script>
</body>
</html>