-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
205 lines (195 loc) · 8.28 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
<html>
<head>
<title>♔♕</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="/game/jquery.ui.touch-punch.min.js"></script>
<script type='module'>
import {startGame} from "{{ game_js }}";
const GAME_KEY = '{{ game_key }}';
const INITIAL_MESSAGE = '{{ initial_message|safe }}';
const ME = '{{ me }}';
$(window).load(() => startGame(GAME_KEY, INITIAL_MESSAGE, ME));
</script>
<script type='text/javascript' nomodule>
$(window).load(() => {
$("#error_message").text("ES6 Modules are not supported. Please update your browser.");
$("#error_modal").show();
});
</script>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="{{ game_css }}" />
<script async defer src="https://buttons.github.io/buttons.js"></script>
<link rel="icon" href="data:,">
</head>
<body>
<div id='display-area'>
<h2 id="headline">Real-time Chess</h2>
<div align="center">
<div class="beforeGame">
Your current rating is {{ rating }}, with {{ wins }} wins and {{ losses }} losses.
</div>
<div id='other-player' class="boxWidth">
<strong>Waiting for another player to join.</strong><br>
Send them this link to play:<br>
<div id='game-link' class="darkLinks"><a href='{{ game_link }}'>{{ game_link }}</a></div>
<div class="darkLinks">
{{ recent_games|safe }}
</div>
</div>
<div class="topPlayers beforeGame">
<h3>Top Players</h3>
<table>
<thead>
<tr><th>Name</th><th>Rating</th></tr>
</thead>
<tbody>
{{ top_players|safe }}
</tbody>
</table>
</div>
<div id="gameInformation">
<a class="github-button" href="https://github.com/PetterS/realtimechess" data-size="large" data-show-count="true" aria-label="Star PetterS/realtimechess on GitHub">Star</a>
</div>
</div>
<div class="piece squareSize" id="p0"></div>
<div class="piece squareSize" id="p1"></div>
<div class="piece squareSize" id="p2"></div>
<div class="piece squareSize" id="p3"></div>
<div class="piece squareSize" id="p4"></div>
<div class="piece squareSize" id="p5"></div>
<div class="piece squareSize" id="p6"></div>
<div class="piece squareSize" id="p7"></div>
<div class="piece squareSize" id="p8"></div>
<div class="piece squareSize" id="p9"></div>
<div class="piece squareSize" id="p10"></div>
<div class="piece squareSize" id="p11"></div>
<div class="piece squareSize" id="p12"></div>
<div class="piece squareSize" id="p13"></div>
<div class="piece squareSize" id="p14"></div>
<div class="piece squareSize" id="p15"></div>
<div class="piece squareSize" id="p16"></div>
<div class="piece squareSize" id="p17"></div>
<div class="piece squareSize" id="p18"></div>
<div class="piece squareSize" id="p19"></div>
<div class="piece squareSize" id="p20"></div>
<div class="piece squareSize" id="p21"></div>
<div class="piece squareSize" id="p22"></div>
<div class="piece squareSize" id="p23"></div>
<div class="piece squareSize" id="p24"></div>
<div class="piece squareSize" id="p25"></div>
<div class="piece squareSize" id="p26"></div>
<div class="piece squareSize" id="p27"></div>
<div class="piece squareSize" id="p28"></div>
<div class="piece squareSize" id="p29"></div>
<div class="piece squareSize" id="p30"></div>
<div class="piece squareSize" id="p31"></div>
<div align="center">
<div id="controlPanel">
<button type="button" id="newGameButton" class="gameButton">Restart game</button>
<span id="isReady">
<button type="button" id="randomizePiecesButton" class="gameButton">Randomize first row</button>
<input type="checkbox" id="isReadyCheckBox" class="pointerCursor" />
<label class="pointerCursor" for="isReadyCheckBox">I am ready to start this game!</label>
</span>
<span id="topMessage"></span>
</div>
<table id="chess_board" cellpadding="0" cellspacing="0">
<tr>
<td id="A8" class="squareSize"></td>
<td id="B8" class="squareSize"></td>
<td id="C8" class="squareSize"></td>
<td id="D8" class="squareSize"></td>
<td id="E8" class="squareSize"></td>
<td id="F8" class="squareSize"></td>
<td id="G8" class="squareSize"></td>
<td id="H8" class="squareSize"></td>
</tr>
<tr>
<td id="A7" class="squareSize"></td>
<td id="B7" class="squareSize"></td>
<td id="C7" class="squareSize"></td>
<td id="D7" class="squareSize"></td>
<td id="E7" class="squareSize"></td>
<td id="F7" class="squareSize"></td>
<td id="G7" class="squareSize"></td>
<td id="H7" class="squareSize"></td>
</tr>
<tr>
<td id="A6" class="squareSize"></td>
<td id="B6" class="squareSize"></td>
<td id="C6" class="squareSize"></td>
<td id="D6" class="squareSize"></td>
<td id="E6" class="squareSize"></td>
<td id="F6" class="squareSize"></td>
<td id="G6" class="squareSize"></td>
<td id="H6" class="squareSize"></td>
</tr>
<tr>
<td id="A5" class="squareSize"></td>
<td id="B5" class="squareSize"></td>
<td id="C5" class="squareSize"></td>
<td id="D5" class="squareSize"></td>
<td id="E5" class="squareSize"></td>
<td id="F5" class="squareSize"></td>
<td id="G5" class="squareSize"></td>
<td id="H5" class="squareSize"></td>
</tr>
<tr>
<td id="A4" class="squareSize"></td>
<td id="B4" class="squareSize"></td>
<td id="C4" class="squareSize"></td>
<td id="D4" class="squareSize"></td>
<td id="E4" class="squareSize"></td>
<td id="F4" class="squareSize"></td>
<td id="G4" class="squareSize"></td>
<td id="H4" class="squareSize"></td>
</tr>
<tr>
<td id="A3" class="squareSize"></td>
<td id="B3" class="squareSize"></td>
<td id="C3" class="squareSize"></td>
<td id="D3" class="squareSize"></td>
<td id="E3" class="squareSize"></td>
<td id="F3" class="squareSize"></td>
<td id="G3" class="squareSize"></td>
<td id="H3" class="squareSize"></td>
</tr>
<tr>
<td id="A2" class="squareSize"></td>
<td id="B2" class="squareSize"></td>
<td id="C2" class="squareSize"></td>
<td id="D2" class="squareSize"></td>
<td id="E2" class="squareSize"></td>
<td id="F2" class="squareSize"></td>
<td id="G2" class="squareSize"></td>
<td id="H2" class="squareSize"></td>
</tr>
<tr>
<td id="A1" class="squareSize"></td>
<td id="B1" class="squareSize"></td>
<td id="C1" class="squareSize"></td>
<td id="D1" class="squareSize"></td>
<td id="E1" class="squareSize"></td>
<td id="F1" class="squareSize"></td>
<td id="G1" class="squareSize"></td>
<td id="H1" class="squareSize"></td>
</tr>
</table>
<div id="controlPanelBottom">
<span id="bottomMessage"></span>
</div>
</div>
<div id='this-game' float='top'>
<!--Quick link to this game: <span id='this-game-link'><a href='{{ game_link }}'>{{ game_link }}</a></span><br />-->
<a href="/">Back to main page</a>
</div>
<div id="error_modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<p id="error_message">Lost connection to the server! Please refresh page.</p>
</div>
</div>
</body>
</html>