-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
67 lines (58 loc) · 1.77 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
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/xiangqiboard-0.2.0.min.css" />
<script src="js/jquery-3.3.1.js"></script>
<script src="js/xiangqiboard-0.2.0.js"></script>
<script src="js/xiangqi.min.js"></script>
<style type="text/css">
.highlight {
box-shadow: inset 0 0 3px 3px white;
}
.highlight-red {
box-shadow: inset 0 0 3px 3px yellow;
}
.highlight-black {
box-shadow: inset 0 0 3px 3px blue;
html, body {
overflow: hidden;
position: fixed;
}
</style>
<body>
<h3 class="board">
Alpha beta
</h3>
<div id="myBoard" class="board" style="width:375px"></div>
<br>
<button onclick="game.undo(); board.position(game.fen()),game.undo(); board.position(game.fen())">UNDO</button>
<div class="info">
Search depth:
<select id="search-depth">
<option value="1">1</option>
<option value="2" selected >2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<br>
<span>Positions evaluated: <span id="position-count"></span></span>
<br>
<span>Capture positions evaluated: <span id="position-count2"></span></span>
<br>
<span>Time: <span id="time"></span></span>
<br>
<span>Positions/s: <span id="positions-per-s"></span> </span>
<br>
<br>
<div id="move-history" class="move-history">
</div>
</div>
</body>
<script>var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
var height = (window.innerHeight > 0) ? window.innerHeight*0.5 : screen.height;
document.getElementById("myBoard").style.width = Math.min(width,height);
// Disable scrolling.
document.getElementById("myBoard").ontouchmove = function (e) {
e.preventDefault();
}
</script>
<script src="js/script.js"></script>