-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (61 loc) · 3.49 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
<!DOCTYPE html>
<html>
<head>
<title>trueChess | Open Source Chess framework.</title>
<meta charset="UTF-8">
<meta name="description" content="Free and Open Source chess framework for your next chess game project.">
<meta name="keywords" content="trueChess, chess game, game, board, pawn, king, knight, rook, bishop, chess board, white pawn, black pawn, check mate, ichess, chessboard, play chess, learn chess, develop chess, integrate chess board">
<meta name="author" content="Sonu Auti @sonuauti">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css"> <!-- required for animation, if set false then not required-->
<link rel="stylesheet" href="style.css"> <!-- color and style information -->
<script type="text/javascript" src="truechess_beta.js"> </script> <!-- main js file -->
</head>
<body style="text-align: center;font-size: 16px;">
<div id="chessBoard1" style="width: 600px; margin: auto;"> </div>
<div style="box-shadow: 0px 0px 2px 2px #eee;
border-radius: 10px;margin-left: 12px;display: inline-block;margin-top: 10px;">
<div id="theme_wood" class="themes animated" style="background: var(--theme_wood);" onclick="truechess.updateTheme(document.getElementById(this.id).style.background);"></div>
<div id="theme_darkwood" class="themes animated" style="background: var(--theme_darkwood);" onclick="truechess.updateTheme(document.getElementById(this.id).style.background);"></div>
<div id="theme_pink" class="themes animated" style="background: var(--theme_pink);" onclick="truechess.updateTheme(document.getElementById(this.id).style.background);"></div>
<div id="theme_vibrant" class="themes animated" style="background: var(--theme_vibrant);" onclick="truechess.updateTheme(document.getElementById(this.id).style.background);"></div>
<div id="theme_default" class="themes animated" style="background: var(--theme_default);" onclick="truechess.updateTheme(document.getElementById(this.id).style.background);"></div>
<div id="theme_black" class="themes animated" style="background: var(--theme_black);" onclick="truechess.updateTheme(document.getElementById(this.id).style.background);"></div>
</div>
<script type="text/javascript">
function initiChess(){
var config = {
showBoardNotations:true, //show board notations 1-8, a-f
position:"start", // either start or position array
orientation:'default', //top side down
isDraggable:true, //drag element
isFocus:false, //
boardTheme:'theme_default', //board color
showClock:true, //hide or show clock
gameTime:'10', //game time
imgSrc:'img/', //absolute path of icons
displayUnicodeSymbols:false, //display web friendly icons
showCapturedPieces:true, //show captured pieces
showBoardWithPieces:true, //show board only
animation:true, //show animation
showBorder:false, //show or hide board border
lockMoves:false,
onPositionUpdate:function(startPos,endPos,element){
console.log('This is from callback function '+startPos+","+endPos+","+element);
console.log(truechess.getPositions());
},
onDragStart:function(startPos){
console.log('Position started at '+startPos);
},
onDragStop:function(endPos){
console.log('Position end at '+endPos);
},
}
//console.log(window.truechess);
truechess.createChessBoard('chessBoard1',config);
//console.log(truechess.getPositions());
}
initiChess();
</script>
</body>
</html>