-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
134 lines (125 loc) · 3.52 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Juicer board</title>
<link rel="stylesheet" href="./index.css" />
<script type="module" src="/src/juicer-board.ts"></script>
<script type="module" src="./index.ts"></script>
</head>
<body>
<article style="display: flex; gap: 2rem; align-items: start">
<juicer-board
interactive="true"
fen="start"
coords-placement="inside"
ranks-position="left"
files-position="bottom"
show-ghost="true"
></juicer-board>
<section class="demo" style="display: grid; gap: 1rem">
<datalist id="list-coords"></datalist>
<datalist id="list-pieces"></datalist>
<div>
<pre class="out-board"></pre>
<pre class="out-initial-fen"></pre>
<pre class="out-fen"></pre>
<pre class="out-orientation"></pre>
<pre class="out-pieces-count"></pre>
</div>
<div style="display: flex; align-items: center; gap: 1rem">
<button class="cmd-flip-board">flip board</button>
<button class="cmd-clear-board">clear board</button>
</div>
<div style="display: flex; align-items: center; gap: 1rem">
<button class="cmd-set-position-empty">set empty position</button>
<button class="cmd-set-position-start">set start position</button>
<div>
<label>
FEN
<input class="input-fen" name="input-fen" value="8/8/8/6B1/3P4/2N2N2/PPP1PPPP/R2QKB1R w KQha - 0 1" />
</label>
<button class="cmd-set-position-custom">set custom position</button>
</div>
</div>
<div style="display: flex; align-items: center; gap: 1rem">
<div>
<label>
coord
<input list="list-coords" class="input-get-piece" name="input-get-piece" value="e4" style="width: 3rem" />
</label>
<button class="cmd-get-piece">get piece</button>
</div>
<pre class="out-get-piece"></pre>
</div>
<div style="display: flex; align-items: center; gap: 1rem">
<div>
<label>
coord
<input
list="list-coords"
class="input-set-piece-coord"
name="input-set-piece-coord"
value="e4"
style="width: 3rem"
/>
</label>
<label>
piece
<input
list="list-pieces"
class="input-set-piece-piece"
name="input-set-piece-piece"
value="Q"
style="width: 3rem"
/>
</label>
<button class="cmd-set-piece">set piece</button>
</div>
</div>
<div style="display: flex; align-items: center; gap: 1rem">
<div>
<label>
coord
<input
list="list-coords"
class="input-remove-piece"
name="input-remove-piece"
value="e4"
style="width: 3rem"
/>
</label>
<button class="cmd-remove-piece">remove piece</button>
</div>
</div>
<div style="display: flex; align-items: center; gap: 1rem">
<div>
<label>
src
<input
list="list-coords"
class="input-move-piece-src"
name="input-move-piece-src"
value="h2"
style="width: 3rem"
/>
</label>
<label>
dest
<input
list="list-coords"
class="input-move-piece-dest"
name="input-move-piece-dest"
value="h4"
style="width: 3rem"
/>
</label>
<button class="cmd-move-piece">move piece</button>
</div>
</div>
</section>
</article>
</body>
</html>