cm-chessboard 5.4.1 → 5.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/extensions/chessboard-promotion-dialog-extension.html +0 -1
- package/examples/input-callbacks.html +6 -17
- package/package.json +1 -1
- package/src/cm-chessboard/extensions/promotion-dialog/assets/promotion-dialog.css +18 -12
- package/src/cm-chessboard/extensions/promotion-dialog/assets/promotion-dialog.css.map +1 -1
- package/src/cm-chessboard/extensions/promotion-dialog/assets/promotion-dialog.scss +14 -1
|
@@ -13,23 +13,9 @@
|
|
|
13
13
|
<div class="board" id="board1"></div>
|
|
14
14
|
<div class="board" id="board2"></div>
|
|
15
15
|
<br style="clear: both"/>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let markerType
|
|
20
|
-
if(event.type === SQUARE_SELECT_TYPE.primary) {
|
|
21
|
-
markerType = MARKER_TYPE.dot
|
|
22
|
-
} else {
|
|
23
|
-
markerType = MARKER_TYPE.circle
|
|
24
|
-
}
|
|
25
|
-
const markersOnSquare = board1.getMarkers(markerType, event.square)
|
|
26
|
-
if (markersOnSquare.length > 0) {
|
|
27
|
-
board1.removeMarkers(markerType, event.square)
|
|
28
|
-
} else {
|
|
29
|
-
board1.addMarker(markerType, event.square)
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
</pre>
|
|
16
|
+
<div>
|
|
17
|
+
<button onclick="window.removeDots()" class="btn btn-primary">Remove all dots</button>
|
|
18
|
+
</div>
|
|
33
19
|
<script type="module">
|
|
34
20
|
import {Chessboard, MARKER_TYPE, SQUARE_SELECT_TYPE} from "../src/cm-chessboard/Chessboard.js"
|
|
35
21
|
import {FEN} from "../src/cm-chessboard/model/Position.js"
|
|
@@ -53,6 +39,9 @@
|
|
|
53
39
|
board1.addMarker(markerType, event.square)
|
|
54
40
|
}
|
|
55
41
|
})
|
|
42
|
+
window.removeDots = () => {
|
|
43
|
+
board1.removeMarkers(MARKER_TYPE.dot)
|
|
44
|
+
}
|
|
56
45
|
|
|
57
46
|
const board2 = new Chessboard(document.getElementById("board2"), {
|
|
58
47
|
position: "rn2k1r1/ppp1pp1p/3p2p1/5bn1/P7/2N2B2/1PPPPP2/2BNK1RR",
|
package/package.json
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
svg.cm-chessboard .promotion-dialog-group
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
svg.cm-chessboard .promotion-dialog-group {
|
|
2
|
+
animation: fade-in 0.25s ease-in normal; }
|
|
3
|
+
svg.cm-chessboard .promotion-dialog-group .promotion-dialog {
|
|
4
|
+
fill: black;
|
|
5
|
+
fill-opacity: 0.3;
|
|
6
|
+
stroke: rgba(0, 0, 0, 0.3); }
|
|
7
|
+
svg.cm-chessboard .promotion-dialog-group .promotion-dialog-button {
|
|
8
|
+
fill: transparent;
|
|
9
|
+
cursor: pointer; }
|
|
10
|
+
svg.cm-chessboard .promotion-dialog-group .promotion-dialog-button:hover {
|
|
11
|
+
fill: rgba(0, 0, 0, 0.2); }
|
|
12
|
+
svg.cm-chessboard .promotion-dialog-group .piece-group {
|
|
13
|
+
pointer-events: none; }
|
|
5
14
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
svg.cm-chessboard .promotion-dialog-group .piece-group {
|
|
13
|
-
pointer-events: none; }
|
|
15
|
+
@keyframes fade-in {
|
|
16
|
+
0% {
|
|
17
|
+
opacity: 0; }
|
|
18
|
+
100% {
|
|
19
|
+
opacity: 1; } }
|
|
14
20
|
|
|
15
21
|
/*# sourceMappingURL=promotion-dialog.css.map */
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
"promotion-dialog.scss"
|
|
6
6
|
],
|
|
7
7
|
"names": [],
|
|
8
|
-
"mappings": "AAAA,
|
|
8
|
+
"mappings": "AAAA,AACE,GADC,AAAA,cAAc,CACf,uBAAuB,CAAC;EAGtB,SAAS,EAAE,4BAA4B,GAoBxC;EAxBH,AAMI,GAND,AAAA,cAAc,CACf,uBAAuB,CAKrB,iBAAiB,CAAC;IAChB,IAAI,EAAE,KAAK;IACX,YAAY,EAAE,GAAG;IACjB,MAAM,EAAE,kBAAkB,GAC3B;EAVL,AAYI,GAZD,AAAA,cAAc,CACf,uBAAuB,CAWrB,wBAAwB,CAAC;IACvB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,OAAO,GAKhB;IAnBL,AAgBM,GAhBH,AAAA,cAAc,CACf,uBAAuB,CAWrB,wBAAwB,CAIpB,KAAK,CAAC;MACN,IAAI,EAAE,kBAAkB,GACzB;EAlBP,AAqBI,GArBD,AAAA,cAAc,CACf,uBAAuB,CAoBrB,YAAY,CAAC;IACX,cAAc,EAAE,IAAI,GACrB;;AAIL,UAAU,CAAV,OAAU;EACR,EAAE;IACA,OAAO,EAAE,CAAC;EAEZ,IAAI;IACF,OAAO,EAAE,CAAC"
|
|
9
9
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
svg.cm-chessboard {
|
|
2
2
|
.promotion-dialog-group {
|
|
3
|
+
|
|
4
|
+
// opacity: 0;
|
|
5
|
+
animation: fade-in 0.25s ease-in normal;
|
|
6
|
+
|
|
3
7
|
.promotion-dialog {
|
|
4
8
|
fill: black;
|
|
5
9
|
fill-opacity: 0.3;
|
|
6
|
-
stroke: rgba(0, 0, 0, 0.3)
|
|
10
|
+
stroke: rgba(0, 0, 0, 0.3);
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
.promotion-dialog-button {
|
|
@@ -20,3 +24,12 @@ svg.cm-chessboard {
|
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
}
|
|
27
|
+
|
|
28
|
+
@keyframes fade-in {
|
|
29
|
+
0% {
|
|
30
|
+
opacity: 0;
|
|
31
|
+
}
|
|
32
|
+
100% {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
}
|
|
35
|
+
}
|