-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
177 lines (164 loc) · 7.45 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Adil Basar Websocket</title>
<link rel="stylesheet" href="css/libs/jquery.dataTables.min.css">
<link rel="stylesheet" href="css/libs/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/ui.css">
<script src="js/libs/jquery-3.5.1.slim.min.js"></script>
<script src="js/libs/jquery.dataTables.min.js"></script>
<script src="js/libs/bootstrap.min.js"></script>
<script src="js/libs/pbf.js"></script>
<script src="js/libs/pixi.min.js"></script>
<script src="js/proto-all.js"></script>
<script src="js/dom_control.js"></script>
<script src="js/parser.js"></script>
<script src="js/websocket.js"></script>
<script src="js/game.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div class="container wrapper" id="login">
<div id="loginFormHolder">
<h3 style="margin-top: 48px;">Websocket Game</h3>
<form action="javascript:void(0);" id="loginForm" method="POST" onsubmit="initAll($('#name').val())">
<div class="form-group">
<input type="text" id="name" name="name" class="form-control form-control-sm" placeholder="Username"
style="width:300px;margin:auto;" required autofocus />
</div>
<input type="submit" class="btn btn-primary" style="width:300px;margin:auto;" value="Join" />
</form>
<div id="formFooter">
Mutfak 2020
</div>
</div>
</div>
<div class="container" id="lobby">
<div class="row" style="height: 70%;">
<div class="col-sm-2 moduleWrapper">
<div class="moduleTitle">Players</div>
<div id="players" class="scrollStyle">
<table class="table table-striped" id="playersTable">
<tbody></tbody>
</table>
</div>
</div>
<div class="col-sm-10 moduleWrapper">
<div class="moduleTitle">Games</div>
<table id="roomTable" class="table table-bordered table-sm table-hover" cellspacing="0" width="100%">
<thead>
<tr>
<th class="th-sm">ID
</th>
<th class="th-sm">Room Name
</th>
<th class="th-sm">Password
</th>
<th class="th-sm">Player
</th>
</tr>
</thead>
<tbody class="cursorHand">
</tbody>
</table>
</div>
</div>
<div class="row" style="height: 30%;">
<div class="col-sm-2 moduleWrapper">
<div class="moduleTitle" id="myName"></div>
<button type="button" data-toggle="modal" data-target="#newRoomModal" class="btn btn-info btn-profile"
id="newGameButton">New Game</button><br>
<button type="button" class="btn btn-danger btn-profile" id="disconnectButton">Disconnect</button>
</div>
<div class="col-sm-10 moduleWrapper">
<div class="moduleTitle">Chat</div>
<div id="chatBox" class="chat scrollStyle"></div>
<div style="height: 78%;"></div>
<input type="text" id="chatInputBox" class="chatText" placeholder="Type a message !">
</div>
</div>
</div>
<div id="game">
</div>
<!------------------------>
<div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="errorModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="errorModalLabel" style="color:red;"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p id="errorMsg"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Okay</button>
</div>
</div>
</div>
</div>
<!------------------------>
<div class="modal fade" id="newRoomModal" tabindex="-1" role="dialog" aria-labelledby="newRoomModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="newRoomModalLabel">Create a new room</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Room Name : <input type="text" id="roomname2">
<br>
Password : <input type="password" id="roompass2">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="domControl.createRoom()">Create</button>
</div>
</div>
</div>
</div>
<!-------------------------------------->
<div class="modal fade" id="loadMe" tabindex="-1" role="dialog" aria-labelledby="loadMeLabel" data-keyboard="false"
data-backdrop="static">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-body text-center">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
</div>
</div>
<!----------------------------------->
<div class="modal fade" id="roomPassModal" tabindex="-1" role="dialog" aria-labelledby="roomPassModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="roomPassModalLabel">Enter the password</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<input type="hidden" id="roomIdHidden">
Password : <input type="password" id="roompassJoin">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="domControl.tryPassword()">Join</button>
</div>
</div>
</div>
</div>
</body>
</html>