cm-chessboard 4.1.4 → 4.1.6
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/README.md +4 -3
- package/package.json +1 -1
- package/src/cm-chessboard/Chessboard.js +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ aspects of chess games.
|
|
|
16
16
|
- [Can handle moves input via click or drag](https://shaack.com/projekte/cm-chessboard/examples/validate-moves.html)
|
|
17
17
|
- [Styleable via css](https://shaack.com/projekte/cm-chessboard/examples/different-styles.html)
|
|
18
18
|
- [Supports multiple piece sets](https://shaack.com/projekte/cm-chessboard/examples/different-styles.html)
|
|
19
|
+
- [Supports an optimized usage for visually impaired people](https://shaack.com/projekte/cm-chessboard/examples/accessible-chessboard.html) 🆕
|
|
19
20
|
- Uses SVG for rendering
|
|
20
21
|
- Vanilla JavaScript modules in ECMAScript 6 syntax
|
|
21
22
|
- **No dependencies**
|
|
@@ -33,7 +34,7 @@ aspects of chess games.
|
|
|
33
34
|
|
|
34
35
|
**Option 2:** Download the code from [GitHub](https://github.com/shaack/cm-chessboard).
|
|
35
36
|
|
|
36
|
-
**Option 3:** Use it via CDN https://cdn.jsdelivr.net/npm/cm-chessboard@4
|
|
37
|
+
**Option 3:** Use it via CDN https://cdn.jsdelivr.net/npm/cm-chessboard@4/src/cm-chessboard/Chessboard.js
|
|
37
38
|
|
|
38
39
|
After installation, copy the sprite in `cm-chessboard/assets/images/` to your projects `assets/images/`
|
|
39
40
|
folder. If you put the sprite somewhere else you have to configure the location
|
|
@@ -53,7 +54,7 @@ The pieces animations are now smoother and less error-prone for race conditions.
|
|
|
53
54
|
As of version 4.x, the API functions `setPosition()`, `setPiece()` and `movePiece()` are **not animated** as default.
|
|
54
55
|
If you want some pieces animations you have to give the parameter `animated = true`.
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
And with 4.x the chessboard has become more accessible for visually impaired people.
|
|
57
58
|
|
|
58
59
|
## Usage
|
|
59
60
|
|
|
@@ -85,7 +86,7 @@ Below is the default configuration
|
|
|
85
86
|
let defaultProps = {
|
|
86
87
|
position: "empty", // set as fen, "start" or "empty"
|
|
87
88
|
orientation: COLOR.white, // white on bottom
|
|
88
|
-
responsive: true, //
|
|
89
|
+
responsive: true, // resize the board automatically to the size of the context element
|
|
89
90
|
animationDuration: 300, // pieces animation duration in milliseconds. Disable all animation with `0`.
|
|
90
91
|
language: navigator.language.substring(0,2).toLowerCase(), // supports "de" and "en" for now, used for pieces naming
|
|
91
92
|
style: {
|
package/package.json
CHANGED
|
@@ -49,7 +49,7 @@ export class Chessboard {
|
|
|
49
49
|
let defaultProps = {
|
|
50
50
|
position: "empty", // set as fen, "start" or "empty"
|
|
51
51
|
orientation: COLOR.white, // white on bottom
|
|
52
|
-
responsive: true, //
|
|
52
|
+
responsive: true, // resize the board automatically to the size of the context element
|
|
53
53
|
animationDuration: 300, // pieces animation duration in milliseconds. Disable all animation with `0`.
|
|
54
54
|
language: navigator.language.substring(0,2).toLowerCase(), // supports "de" and "en" for now, used for pieces naming
|
|
55
55
|
style: {
|