forked from shiluying/dachuang-factory
-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.html
77 lines (71 loc) · 3.01 KB
/
game.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>棋</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="renderer/global.css">
<script type="text/javascript" src="renderer/public/jquery.js"></script>
<script>if (typeof module === 'object') {window.jQuery = window.$ = module.exports;};</script>
<p class="time" id = "myTime">00:00:00</p>
<div style="margin:0 auto;text-align: center;float: left;" id="container">
<canvas id="myCanvas"></canvas>
</div>
<div style="text-align: center;" class="button">
<input type="button" class="func_button" value=" Start Game " id="startbtn" onclick="InitGame(order)"><br>
<input type="button" class="func_button" value="Restart Game" id="restartbtn" onclick="ResetGame()"><br>
<input type="button" class="func_button" value=" With Draw " id="retractbtn" onclick="WithDraw()"><br>
<input type="button" class="func_button" value=" Read Boards " id="readbtn" onclick="GetBoards()"><br>
<input type="button" class="func_button" value=" Return " id="return" onclick="returnRoom()"><br>
白方用时:<p id="whiteTime">00:00:00</p>
黑方用时:<p id="blackTime">00:00:00</p>
</div>
<script type="text/javascript" src="renderer/public/chess.js"></script>
<script type="text/javascript" src="renderer/public/game.js"></script>
<script type="text/javascript" src="renderer/public/app.js"></script>
<script type="text/javascript" src="renderer/public/windowOpen.js"></script>
<script type="text/javascript" src="renderer/public/button.js"></script>
<script type="text/javascript" src="renderer/public/file.js"></script>
<script type="text/javascript">
// InitType();
function returnRoom() {
$('.game-room').removeClass('active').removeClass('show').addClass('hide');
$('.room').removeClass('hide').addClass('active').addClass('show');
}
function parseUrl(){
var url=location.href;
var i=url.indexOf('?');
if(i==-1)return;
var querystr=url.substr(i+1);
var arr1=querystr.split('&');
var arr2=new Object();
for (i in arr1){
var ta=arr1[i].split('=');
arr2[ta[0]]=ta[1];
}
return arr2;
}
function addScript(type) {
if("Surakarta"==type){
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "renderer/Surakarta/DoublyList.js";
document.body.appendChild(script);
script = document.createElement("script");
script.type = "text/javascript";
script.src = "renderer/Surakarta/ChessGame.js";
document.body.appendChild(script);
}else if("Amazons"==type){
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "renderer/Amazons/ChessGame.js";
document.body.appendChild(script);
}
}
var arr=parseUrl();
var order = arr['order'];
addScript(arr['type']);
</script>
</body>
</html>