-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
277 lines (266 loc) · 12.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
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE html>
<html>
<head>
<title>Pro Tic Tac Toe</title>
<link href="https://styles.leonardfollner.de/open-sans.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="main.js"></script>
</head>
<body class="centerText">
<div class ="parent">
<div class="element">
<h1>Pro Tic Tac Toe</h1>
<div id = "menu">
<p class = "pointer buttonSimple center" onclick = "startGame()">Neues Spiel</p>
<p class = "pointer buttonSimple center invisible" id ="continueButton" onclick = "continueGame()">Spiel fortsetzen</p>
<p class = "pointer buttonSimple center" onclick = "toggle('leaderboard')">Bestenliste</p>
</div>
<div id = "confirm" class = "invisible">
<p>Bist du dir sicher, dass du das laufende Spiel löschen willst?</p><br>
<p class = "inline-block buttonSimple pointer" onclick="confirm('resetGame', 1)">Ja</p>
<p class = "inline-block buttonSimple pointer" onclick="confirm('resetGame', 0)">Nein</p>
</div>
<div id = "confirmResetLeaderboard" class = "invisible">
<p>Bist du dir sicher, dass du die Bestenliste löschen willst?</p><br>
<p class = "inline-block buttonSimple pointer" onclick="confirm('resetLeaderboard', 1)">Ja</p>
<p class = "inline-block buttonSimple pointer" onclick="confirm('resetLeaderboard', 0)">Nein</p>
</div>
<div id = "startTable" class = "invisible">
<p class = "hint underline" onclick = "showMenu()">zum Menu</p>
<table id="data" align="center" cellspacing="2" cellpadding="2" border="0">
<tr>
<th>Spielername:</th>
<td><form name="info1" onsubmit="return false"><input type="text" name="player1Name" id="spieler1Name" placeholder="Spieler1"></form></td>
<td><form name="info2" onsubmit="return false"><input type="text" name="player2Name" id="spieler2Name" placeholder="Spieler2"></form></td>
<td><input type="button" value="Start" onclick="draw()"></td>
</tr>
<tr>
<th>Farbe:</th>
<td><input type="color" id="spieler1colK" value="#ab4143"></td>
<td><input type="color" id="spieler2colK" value="#448eb3"></td>
<td></td>
</tr>
<tr>
<th>Hintergrundfarbe:</th>
<td><input type="color" id="spieler1colF" value="#cc7a7c"></td>
<td><input type="color" id="spieler2colF" value="#7ab1cc"></td>
<td><input type="button" value="Reset" onclick="reset()"></td>
</tr>
<tr>
<td></td>
<td colspan="2" class = "hint">Farbcodes gibts <a href="http://html-color-codes.info/webfarben_hexcodes/" target="_blank">hier</a>!</td>
<td></td>
</tr>
</table>
</div>
<div id = "drawingArea" class = "invisible">
<table id ="feld" border="5" cellspacing="10" cellpadding="10" align="center" frame="void">
<tr>
<td id = "field1">
<table id = "1" border="1" cellspacing="5">
<tr>
<td id = "11" class="box" onclick="klick(this.id)"></td>
<td id = "12" class="box" onclick="klick(this.id)"></td>
<td id = "13" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "14" class="box" onclick="klick(this.id)"></td>
<td id = "15" class="box" onclick="klick(this.id)"></td>
<td id = "16" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "17" class="box" onclick="klick(this.id)"></td>
<td id = "18" class="box" onclick="klick(this.id)"></td>
<td id = "19" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
<td id = "field2">
<table id = "2" border="1" cellspacing="5">
<tr>
<td id = "21" class="box" onclick="klick(this.id)"></td>
<td id = "22" class="box" onclick="klick(this.id)"></td>
<td id = "23" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "24" class="box" onclick="klick(this.id)"></td>
<td id = "25" class="box" onclick="klick(this.id)"></td>
<td id = "26" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "27" class="box" onclick="klick(this.id)"></td>
<td id = "28" class="box" onclick="klick(this.id)"></td>
<td id = "29" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
<td id = "field3">
<table id = "3" border="1" cellspacing="5">
<tr>
<td id = "31" class="box" onclick="klick(this.id)"></td>
<td id = "32" class="box" onclick="klick(this.id)"></td>
<td id = "33" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "34" class="box" onclick="klick(this.id)"></td>
<td id = "35" class="box" onclick="klick(this.id)"></td>
<td id = "36" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "37" class="box" onclick="klick(this.id)"></td>
<td id = "38" class="box" onclick="klick(this.id)"></td>
<td id = "39" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td id = "field4">
<table id = "4" border="1" cellspacing="5">
<tr>
<td id = "41" class="box" onclick="klick(this.id)"></td>
<td id = "42" class="box" onclick="klick(this.id)"></td>
<td id = "43" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "44" class="box" onclick="klick(this.id)"></td>
<td id = "45" class="box" onclick="klick(this.id)"></td>
<td id = "46" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "47" class="box" onclick="klick(this.id)"></td>
<td id = "48" class="box" onclick="klick(this.id)"></td>
<td id = "49" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
<td id = "field5">
<table id = "5" border="1" cellspacing="5">
<tr>
<td id = "51" class="box" onclick="klick(this.id)"></td>
<td id = "52" class="box" onclick="klick(this.id)"></td>
<td id = "53" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "54" class="box" onclick="klick(this.id)"></td>
<td id = "55" class="box" onclick="klick(this.id)"></td>
<td id = "56" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "57" class="box" onclick="klick(this.id)"></td>
<td id = "58" class="box" onclick="klick(this.id)"></td>
<td id = "59" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
<td id = "field6">
<table id = "6" border="1" cellspacing="5">
<tr>
<td id = "61" class="box" onclick="klick(this.id)"></td>
<td id = "62" class="box" onclick="klick(this.id)"></td>
<td id = "63" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "64" class="box" onclick="klick(this.id)"></td>
<td id = "65" class="box" onclick="klick(this.id)"></td>
<td id = "66" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "67" class="box" onclick="klick(this.id)"></td>
<td id = "68" class="box" onclick="klick(this.id)"></td>
<td id = "69" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td id = "field7">
<table id = "7" border="1" cellspacing="5">
<tr>
<td id = "71" class="box" onclick="klick(this.id)"></td>
<td id = "72" class="box" onclick="klick(this.id)"></td>
<td id = "73" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "74" class="box" onclick="klick(this.id)"></td>
<td id = "75" class="box" onclick="klick(this.id)"></td>
<td id = "76" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "77" class="box" onclick="klick(this.id)"></td>
<td id = "78" class="box" onclick="klick(this.id)"></td>
<td id = "79" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
<td id = "field8">
<table id = "8" border="1" cellspacing="5">
<tr>
<td id = "81" class="box" onclick="klick(this.id)"></td>
<td id = "82" class="box" onclick="klick(this.id)"></td>
<td id = "83" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "84" class="box" onclick="klick(this.id)"></td>
<td id = "85" class="box" onclick="klick(this.id)"></td>
<td id = "86" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "87" class="box" onclick="klick(this.id)"></td>
<td id = "88" class="box" onclick="klick(this.id)"></td>
<td id = "89" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
<td id = "field9">
<table id = "9" border="1" cellspacing="5">
<tr>
<td id = "91" class="box" onclick="klick(this.id)"></td>
<td id = "92" class="box" onclick="klick(this.id)"></td>
<td id = "93" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "94" class="box" onclick="klick(this.id)"></td>
<td id = "95" class="box" onclick="klick(this.id)"></td>
<td id = "96" class="box" onclick="klick(this.id)"></td>
</tr>
<tr>
<td id = "97" class="box" onclick="klick(this.id)"></td>
<td id = "98" class="box" onclick="klick(this.id)"></td>
<td id = "99" class="box" onclick="klick(this.id)"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id = "turn" class ="invisible">
<p class = "inline-block">Am Zug:</p>
<p id="turn1" class = "button inline-block"></p>
<p id="turn2" class = "button inline-block"></p>
</div>
<div id = "gameOver" class="invisible">
<p id = "winner"></p>
<button type="button" class="buttonSimple center pointer" onclick="toggle('drawingArea')">Spiel zeigen</button>
<button type="button" class ="buttonSimple center pointer" onclick="showMenu()">Menu</button>
<button type="button" class ="buttonSimple center pointer" onclick="newGame()">Neues Spiel</button>
</div>
<div id = "leaderboard" class="invisible">
<p class = "hint underline" onclick = "startReset()">zurücksetzen</p>
<table id = "leaderboardTable" class = "leaderboard center">
<tr>
<td></td>
<th>Name</th>
<th>gewonnen</th>
<th>gespielt</th>
</tr>
<tr>
<td colspan="4">Es sind noch keine Einträge vorhanden</td>
</tr>
</table>
<button type="button" class ="pointer buttonSimple" onclick="showMenu()">Menu</button>
</div>
</div>
</div>
</body>
</html>