-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
145 lines (134 loc) · 6.23 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vanilla JS Chess</title>
<script src="puzzlesDataBase2.js" defer></script>
<script src="stockfish.js" defer></script>
<script src="game.js" defer></script>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="img/pieces/wn.svg">
</head>
<body>
<div class="container">
<div class="score" style="color: white; text-align: right; width: 100px;">White score 0</div>
<div class="game">
<div class="timer timeblack">
<div class="material materialblack">
<div class="pawn">
</div>
<div class="rook">
</div>
<div class="knight">
</div>
<div class="bishop">
</div>
<div class="queen">
</div>
</div>
</div>
<div class="board">
</div>
<div class="timer timewhite">
<div class="material materialwhite">
<div class="pawn">
</div>
<div class="rook">
</div>
<div class="knight">
</div>
<div class="bishop">
</div>
<div class="queen">
</div>
</div>
</div>
<div class="info checkmate">
<p>Checkmate</p>
<button onclick="generateInitialPosition()">Restart</button>
<button onclick="closecheck()">Close</button>
</div>
<div class="info puzzle">
<p>Puzzle solved!</p>
<button onclick="selectpuzzle()">New puzzle</button>
<button onclick="closecheck()">Close</button>
</div>
</div>
<div class="play">
<button class="invertboard">Flip board</button>
<form>
<label for="promote">Promote to:</label>
<select name="promote" class="promote" onchange="selectPromotion()">
<option value="queen">Queen</option>
<option value="rook">Rook</option>
<option value="knight">Knight</option>
<option value="bishop">Bishop</option>
</select>
</form>
<div class="gamemode">
<p>Select Gamemode</p>
<p class="current">Current: Player Vs. Stockfish</p>
<div class="btnsgamemode">
<button class="playerselect" onclick="selectplayer()">Player Vs. Player</button>
<button class="stockfishselect selected" onclick="selectai()">Player Vs. Stockfish</button>
<button class="stockfishxselect" onclick="selectstockfish()">Stockfish Vs. Stockfish</button>
<button class="puzzleselect" onclick="selectpuzzle()">Puzzle</button>
<form>
<label for="filter">Theme filter:</label>
<select name="filter" class="filter" onchange="changeFilter()">
<option value="none">None</option>
<option value="mate">Mate</option>
<option value="fork">Fork</option>
<option value="advantage">Advantage</option>
<option value="middlegame">Middlegame</option>
<option value="advancedPawn">Advanced Pawn</option>
<option value="xRayAttack">xRay Attack</option>
<option value="sacrifice">Sacrifice</option>
<option value="opening">Opening</option>
<option value="pin">Pin</option>
<option value="oneMove">One Move</option>
</select>
<label for="ratingfilter">Rating filter:</label>
<select name="ratingfilter" class="ratingfilter" onchange="changeFilter()">
<option value="none">None</option>
<option value="0-900">0-900</option>
<option value="900-1200">900-1200</option>
<option value="1200-1600">1200-1600</option>
<option value="1600-2000">1600-2000</option>
<option value="2000-4000">2000+</option>
</select>
</form>
<p class="ppuzzletheme"></p>
<a href="" class="ppuzzle"></a>
</div>
</div>
<div class="level">
<p>Stockfish thinking time</p>
<form>
<input type="range" value="1000" class="lvlinput" min="1" max="10000">
<p class="pslider">1s</p>
</form>
</div>
<div class="startgame">
<p>Select color</p>
<p class="current">Current: white</p>
<div class="btns">
<button class="whiteselect selected" onclick="selectwhite()">White</button>
<button class="blackselect" onclick="selectblack()">Black</button>
</div>
<button class="startgame playbtn" onclick="play()">Play!</button>
<button class="startgame" onclick="generateInitialPosition();playSound('over');document.querySelector('a.ppuzzle').innerText='';document.querySelector('a.ppuzzle').href =''">Stop</button>
</div>
<div class="loadgame">
<p>Load game from FEN string</p>
<div class="load">
<input type="text" placeholder="FEN" class="feninput">
<button onclick="loadGame()">Load</button>
</div>
</div>
</div>
</div>
</body>
</html>