kokopu-react 1.7.1 → 1.9.0

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.
Files changed (161) hide show
  1. package/dist/lib/Chessboard.js +84 -97
  2. package/dist/lib/ErrorBox.js +3 -1
  3. package/dist/lib/Movetext.js +24 -15
  4. package/dist/lib/i18n.js +2 -1
  5. package/dist/lib/impl/ArrowTip.js +2 -2
  6. package/dist/lib/impl/Motion.js +133 -0
  7. package/dist/lib/impl/util.js +12 -0
  8. package/doc_src/demo/PageChessboardInteraction.js +9 -9
  9. package/doc_src/demo/PageChessboardMove.js +8 -8
  10. package/doc_src/demo/PageMovetextInteraction.js +2 -2
  11. package/graphic_test_src/02_chessboard_simple.js +2 -2
  12. package/graphic_test_src/03_chessboard_flipped.js +2 -2
  13. package/graphic_test_src/05_chessboard_move.js +4 -4
  14. package/graphic_test_src/06a_chessboard_animated_move.js +36 -0
  15. package/graphic_test_src/06b_chessboard_animated_move.js +36 -0
  16. package/graphic_test_src/06c_chessboard_animated_move.js +36 -0
  17. package/graphic_test_src/{06_chessboard_theme.js → 07_chessboard_theme.js} +0 -0
  18. package/graphic_test_src/{07_chessboard_click_squares.js → 08_chessboard_click_squares.js} +0 -0
  19. package/graphic_test_src/{08_chessboard_move_pieces.js → 09_chessboard_move_pieces.js} +0 -0
  20. package/graphic_test_src/{09_chessboard_edit_arrows.js → 10_chessboard_edit_arrows.js} +0 -0
  21. package/graphic_test_src/{10_chessboard_play_moves.js → 11_chessboard_play_moves.js} +0 -0
  22. package/graphic_test_src/{11_chessboard_play_promotions.js → 12_chessboard_play_promotions.js} +0 -0
  23. package/graphic_test_src/{12_movetext_simple.js → 13_movetext_simple.js} +3 -3
  24. package/graphic_test_src/{13_movetext_error.js → 14_movetext_error.js} +4 -3
  25. package/graphic_test_src/{14_movetext_html.js → 15_movetext_html.js} +0 -0
  26. package/graphic_test_src/{15_movetext_options.js → 16_movetext_options.js} +0 -0
  27. package/graphic_test_src/{16_movetext_interaction.js → 17_movetext_interaction.js} +0 -0
  28. package/graphic_test_src/common/games.pgn +3 -3
  29. package/package.json +17 -19
  30. package/scripts/docker-compose.yml +1 -1
  31. package/src/Chessboard.js +42 -42
  32. package/src/ErrorBox.js +2 -1
  33. package/src/Movetext.js +20 -16
  34. package/src/i18n.js +1 -0
  35. package/src/impl/ArrowTip.js +2 -2
  36. package/src/impl/Motion.js +99 -0
  37. package/src/impl/util.js +8 -0
  38. package/test/4_chessboard_graphic.js +4 -1
  39. package/test/5_chessboard_interaction.js +5 -5
  40. package/test/6_chessboard_play_moves.js +4 -4
  41. package/test/7_movetext_graphic.js +4 -4
  42. package/test/8_movetext_interaction.js +2 -2
  43. package/test/common/graphic.js +6 -0
  44. package/test/references/06a_chessboard_animated_move/0.png +0 -0
  45. package/test/references/06a_chessboard_animated_move/1.png +0 -0
  46. package/test/references/06a_chessboard_animated_move/2.png +0 -0
  47. package/test/references/06a_chessboard_animated_move/3.png +0 -0
  48. package/test/references/06a_chessboard_animated_move/4.png +0 -0
  49. package/test/references/06a_chessboard_animated_move/5.png +0 -0
  50. package/test/references/06b_chessboard_animated_move/0.png +0 -0
  51. package/test/references/06b_chessboard_animated_move/1.png +0 -0
  52. package/test/references/06b_chessboard_animated_move/2.png +0 -0
  53. package/test/references/06b_chessboard_animated_move/3.png +0 -0
  54. package/test/references/06b_chessboard_animated_move/4.png +0 -0
  55. package/test/references/06b_chessboard_animated_move/5.png +0 -0
  56. package/test/references/06c_chessboard_animated_move/0.png +0 -0
  57. package/test/references/06c_chessboard_animated_move/1.png +0 -0
  58. package/test/references/06c_chessboard_animated_move/2.png +0 -0
  59. package/test/references/06c_chessboard_animated_move/3.png +0 -0
  60. package/test/references/06c_chessboard_animated_move/4.png +0 -0
  61. package/test/references/06c_chessboard_animated_move/5.png +0 -0
  62. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/0.png +0 -0
  63. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/1.png +0 -0
  64. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/2.png +0 -0
  65. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/3.png +0 -0
  66. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/4.png +0 -0
  67. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/5.png +0 -0
  68. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/6.png +0 -0
  69. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/7.png +0 -0
  70. package/test/references/{06_chessboard_theme → 07_chessboard_theme}/8.png +0 -0
  71. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/after_move.png +0 -0
  72. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/empty_square.png +0 -0
  73. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/null_vector.png +0 -0
  74. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/out_of_board.png +0 -0
  75. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/over_arrow_marker.png +0 -0
  76. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/over_empty.png +0 -0
  77. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/over_non_empty_1.png +0 -0
  78. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/over_non_empty_2.png +0 -0
  79. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/over_square_marker.png +0 -0
  80. package/test/references/{08_chessboard_move_pieces → 09_chessboard_move_pieces}/over_text_marker.png +0 -0
  81. package/test/references/{09_chessboard_edit_arrows → 10_chessboard_edit_arrows}/base_1.png +0 -0
  82. package/test/references/{09_chessboard_edit_arrows → 10_chessboard_edit_arrows}/base_2.png +0 -0
  83. package/test/references/{09_chessboard_edit_arrows → 10_chessboard_edit_arrows}/edit_color_not_set.png +0 -0
  84. package/test/references/{09_chessboard_edit_arrows → 10_chessboard_edit_arrows}/null_vector.png +0 -0
  85. package/test/references/{09_chessboard_edit_arrows → 10_chessboard_edit_arrows}/out_of_board.png +0 -0
  86. package/test/references/{09_chessboard_edit_arrows → 10_chessboard_edit_arrows}/over_arrow_marker.png +0 -0
  87. package/test/references/{09_chessboard_edit_arrows → 10_chessboard_edit_arrows}/over_square_marker.png +0 -0
  88. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/castling_move.png +0 -0
  89. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/chess960_ambiguous_king_move.png +0 -0
  90. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/chess960_castling_move_1.png +0 -0
  91. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/chess960_castling_move_2.png +0 -0
  92. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/chess960_non_kxr_castling.png +0 -0
  93. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/illegal_move.png +0 -0
  94. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/illegal_position.png +0 -0
  95. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/null_vector.png +0 -0
  96. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/out_of_board.png +0 -0
  97. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/regular_move_1.png +0 -0
  98. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/regular_move_2.png +0 -0
  99. package/test/references/{10_chessboard_play_moves → 11_chessboard_play_moves}/wrong_color.png +0 -0
  100. package/test/references/{11_chessboard_play_promotions → 12_chessboard_play_promotions}/antichess_promotion.png +0 -0
  101. package/test/references/{11_chessboard_play_promotions → 12_chessboard_play_promotions}/cancel_promotion.png +0 -0
  102. package/test/references/{11_chessboard_play_promotions → 12_chessboard_play_promotions}/regular_promotion_1.png +0 -0
  103. package/test/references/{11_chessboard_play_promotions → 12_chessboard_play_promotions}/regular_promotion_2.png +0 -0
  104. package/test/references/{12_movetext_simple → 13_movetext_simple}/0.png +0 -0
  105. package/test/references/{12_movetext_simple → 13_movetext_simple}/1.png +0 -0
  106. package/test/references/{12_movetext_simple → 13_movetext_simple}/2.png +0 -0
  107. package/test/references/{12_movetext_simple → 13_movetext_simple}/3.png +0 -0
  108. package/test/references/14_movetext_error/0.png +0 -0
  109. package/test/references/14_movetext_error/1.png +0 -0
  110. package/test/references/{13_movetext_error/1.png → 14_movetext_error/2.png} +0 -0
  111. package/test/references/14_movetext_error/3.png +0 -0
  112. package/test/references/14_movetext_error/4.png +0 -0
  113. package/test/references/15_movetext_html/0.png +0 -0
  114. package/test/references/15_movetext_html/1.png +0 -0
  115. package/test/references/{14_movetext_html → 15_movetext_html}/2.png +0 -0
  116. package/test/references/{15_movetext_options → 16_movetext_options}/0.png +0 -0
  117. package/test/references/{15_movetext_options → 16_movetext_options}/1.png +0 -0
  118. package/test/references/{15_movetext_options → 16_movetext_options}/2.png +0 -0
  119. package/test/references/{15_movetext_options → 16_movetext_options}/3.png +0 -0
  120. package/test/references/{16_movetext_interaction → 17_movetext_interaction}/0.png +0 -0
  121. package/test/references/{16_movetext_interaction → 17_movetext_interaction}/1.png +0 -0
  122. package/test/references/{16_movetext_interaction → 17_movetext_interaction}/2.png +0 -0
  123. package/CHANGELOG.md +0 -131
  124. package/graphics/chess_sprites/cburnett/bb.svg +0 -45
  125. package/graphics/chess_sprites/cburnett/bk.svg +0 -47
  126. package/graphics/chess_sprites/cburnett/bn.svg +0 -37
  127. package/graphics/chess_sprites/cburnett/bp.svg +0 -19
  128. package/graphics/chess_sprites/cburnett/bq.svg +0 -58
  129. package/graphics/chess_sprites/cburnett/br.svg +0 -60
  130. package/graphics/chess_sprites/cburnett/bx.svg +0 -56
  131. package/graphics/chess_sprites/cburnett/wb.svg +0 -48
  132. package/graphics/chess_sprites/cburnett/wk.svg +0 -26
  133. package/graphics/chess_sprites/cburnett/wn.svg +0 -37
  134. package/graphics/chess_sprites/cburnett/wp.svg +0 -19
  135. package/graphics/chess_sprites/cburnett/wq.svg +0 -60
  136. package/graphics/chess_sprites/cburnett/wr.svg +0 -44
  137. package/graphics/chess_sprites/cburnett/wx.svg +0 -56
  138. package/graphics/chess_sprites/generate_sprites.sh +0 -135
  139. package/graphics/chess_sprites/mmonge/celtic-bx.svg +0 -112
  140. package/graphics/chess_sprites/mmonge/celtic-wx.svg +0 -111
  141. package/graphics/chess_sprites/mmonge/celtic.svg +0 -1576
  142. package/graphics/chess_sprites/mmonge/eyes-spatial-bx.svg +0 -101
  143. package/graphics/chess_sprites/mmonge/eyes-spatial-wx.svg +0 -100
  144. package/graphics/chess_sprites/mmonge/eyes.svg +0 -2538
  145. package/graphics/chess_sprites/mmonge/fantasy-bx.svg +0 -112
  146. package/graphics/chess_sprites/mmonge/fantasy-wx.svg +0 -111
  147. package/graphics/chess_sprites/mmonge/fantasy.svg +0 -5497
  148. package/graphics/chess_sprites/mmonge/fantasy_alt.svg +0 -3742
  149. package/graphics/chess_sprites/mmonge/freak.svg +0 -3479
  150. package/graphics/chess_sprites/mmonge/prmi.svg +0 -6776
  151. package/graphics/chess_sprites/mmonge/skulls-bx.svg +0 -124
  152. package/graphics/chess_sprites/mmonge/skulls-wx.svg +0 -111
  153. package/graphics/chess_sprites/mmonge/skulls.svg +0 -12978
  154. package/graphics/chess_sprites/mmonge/spatial.svg +0 -1223
  155. package/graphics/logo-small.svg +0 -14
  156. package/graphics/logo.svg +0 -26
  157. package/test/references/13_movetext_error/0.png +0 -0
  158. package/test/references/13_movetext_error/2.png +0 -0
  159. package/test/references/13_movetext_error/3.png +0 -0
  160. package/test/references/14_movetext_html/0.png +0 -0
  161. package/test/references/14_movetext_html/1.png +0 -0
@@ -1,56 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10
- version="1.1"
11
- width="45"
12
- height="45"
13
- id="svg3128"
14
- inkscape:version="0.91 r"
15
- sodipodi:docname="bx.svg">
16
- <metadata
17
- id="metadata14">
18
- <rdf:RDF>
19
- <cc:Work
20
- rdf:about="">
21
- <dc:format>image/svg+xml</dc:format>
22
- <dc:type
23
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
24
- <dc:title />
25
- </cc:Work>
26
- </rdf:RDF>
27
- </metadata>
28
- <sodipodi:namedview
29
- pagecolor="#ffffff"
30
- bordercolor="#666666"
31
- borderopacity="1"
32
- objecttolerance="10"
33
- gridtolerance="10"
34
- guidetolerance="10"
35
- inkscape:pageopacity="0"
36
- inkscape:pageshadow="2"
37
- inkscape:window-width="1680"
38
- inkscape:window-height="973"
39
- id="namedview12"
40
- showgrid="false"
41
- inkscape:zoom="10.488889"
42
- inkscape:cx="1.2168363"
43
- inkscape:cy="30.050919"
44
- inkscape:window-x="0"
45
- inkscape:window-y="25"
46
- inkscape:window-maximized="1"
47
- inkscape:current-layer="svg3128" />
48
- <defs
49
- id="defs3130" />
50
- <circle
51
- style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
52
- id="path2991"
53
- cx="22.5"
54
- cy="22.5"
55
- r="13.25" />
56
- </svg>
@@ -1,48 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg
4
- xmlns:svg="http://www.w3.org/2000/svg"
5
- xmlns="http://www.w3.org/2000/svg"
6
- version="1.1"
7
- width="45"
8
- height="45"
9
- id="svg3128">
10
- <defs
11
- id="defs3130" />
12
- <g
13
- style="display:inline"
14
- id="layer1">
15
- <path
16
- d="M 9,36 C 12.385,35.028 19.115,36.431 22.5,34 C 25.885,36.431 32.615,35.028 36,36 C 36,36 37.646,36.542 39,38 C 38.323,38.972 37.354,38.986 36,38.5 C 32.615,37.528 25.885,38.958 22.5,37.5 C 19.115,38.958 12.385,37.528 9,38.5 C 7.6459,38.986 6.6771,38.972 6,38 C 7.3541,36.055 9,36 9,36 z "
17
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
18
- id="path4582" />
19
- <path
20
- d="M 15,32 C 17.5,34.5 27.5,34.5 30,32 C 30.5,30.5 30,30 30,30 C 30,27.5 27.5,26 27.5,26 C 33,24.5 33.5,14.5 22.5,10.5 C 11.5,14.5 12,24.5 17.5,26 C 17.5,26 15,27.5 15,30 C 15,30 14.5,30.5 15,32 z "
21
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
22
- id="path4584" />
23
- <path
24
- d="M 25 10 A 2.5 2.5 0 1 1 20,10 A 2.5 2.5 0 1 1 25 10 z"
25
- transform="translate(0,-2)"
26
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
27
- id="path4586" />
28
- <path
29
- d="M 17.5,26 L 27.5,26"
30
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
31
- id="path4588" />
32
- <path
33
- d="M 15,30 L 30,30"
34
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
35
- id="path4590" />
36
- <path
37
- d="M 22.5,15.5 L 22.5,20.5"
38
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
39
- id="path4592" />
40
- <path
41
- d="M 20,18 L 25,18"
42
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
43
- id="path4594" />
44
- </g>
45
- <g
46
- style="display:inline"
47
- id="layer2" />
48
- </svg>
@@ -1,26 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg
4
- xmlns:svg="http://www.w3.org/2000/svg"
5
- xmlns="http://www.w3.org/2000/svg"
6
- version="1.1"
7
- width="45"
8
- height="45">
9
- <defs />
10
- <g style="fill-rule:evenodd; fill-opacity:1; stroke:#000000; stroke-width:1.5; stroke-linejoin:miter; stroke-miterlimit:4;stroke-dasharray:none; stroke-opacity:1;">
11
- <path d="M 22.5,11.625 L 22.5,6"
12
- style="fill:none;fill-opacity:0.75; stroke-linecap:round;" />
13
- <path d="M 22.5,25 C 22.5,25 27,17.5 25.5,14.5 C 25.5,14.5 24.5,12 22.5,12 C 20.5,12 19.5,14.5 19.5,14.5 C 18,17.5 22.5,25 22.5,25"
14
- style="fill:#ffffff; stroke-linecap:butt;" />
15
- <path d="M 11.5,37 C 17,40.5 27,40.5 32.5,37 L 32.5,30 C 32.5,30 41.5,25.5 38.5,19.5 C 34.5,13 25,16 22.5,23.5 L 22.5,27 L 22.5,23.5 C 19,16 9.5,13 6.5,19.5 C 3.5,25.5 11.5,29.5 11.5,29.5 L 11.5,37 z "
16
- style="fill:#ffffff; stroke-linecap:round; stroke-linejoin:round;" />
17
- <path d="M 20,8 L 25,8"
18
- style="fill:none; fill-opacity:0.75; stroke-linecap:round;" />
19
- <path d="M 11.5,29.5 C 17,27 27,27 32.5,30"
20
- style="fill:none; fill-opacity:0.75; stroke-linecap:round;" />
21
- <path d="M 11.5,37 C 17,34.5 27,34.5 32.5,37"
22
- style="fill:none; fill-opacity:0.75; stroke-linecap:round; stroke-linejoin:round;" />
23
- <path d="M 11.5,33.5 C 17,31.5 27,31.5 32.5,33.5"
24
- style="fill:none; fill-opacity:0.75; stroke-linecap:round; stroke-linejoin:round;" />
25
- </g>
26
- </svg>
@@ -1,37 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg
4
- xmlns:svg="http://www.w3.org/2000/svg"
5
- xmlns="http://www.w3.org/2000/svg"
6
- version="1.1"
7
- width="45"
8
- height="45"
9
- id="svg3128">
10
- <defs
11
- id="defs3130" />
12
- <g
13
- id="layer1">
14
- <path
15
- d="M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18"
16
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
17
- id="path3491" />
18
- <path
19
- d="M 24,18 C 24.384,20.911 18.447,25.369 16,27 C 13,29 13.181,31.343 11,31 C 9.9583,30.056 12.413,27.962 11,28 C 10,28 11.187,29.232 10,30 C 9,30 5.9968,31 6,26 C 6,24 12,14 12,14 C 12,14 13.886,12.098 14,10.5 C 13.274,9.5056 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10 L 18.5,10 C 18.5,10 19.282,8.0081 21,7 C 22,7 22,10 22,10"
20
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
21
- id="path3495" />
22
- <path
23
- d="M 9 23.5 A 0.5 0.5 0 1 1 8,23.5 A 0.5 0.5 0 1 1 9 23.5 z"
24
- transform="translate(0.5,2)"
25
- style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
26
- id="path3499" />
27
- <path
28
- d="M 15 15.5 A 0.5 1.5 0 1 1 14,15.5 A 0.5 1.5 0 1 1 15 15.5 z"
29
- transform="matrix(0.866,0.5,-0.5,0.866,9.6926,-5.1734)"
30
- style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
31
- id="path3501" />
32
- <path
33
- d="M 37,39 C 38,19 31.5,11.5 25,10.5"
34
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
35
- id="path8049" />
36
- </g>
37
- </svg>
@@ -1,19 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg
4
- xmlns:svg="http://www.w3.org/2000/svg"
5
- xmlns="http://www.w3.org/2000/svg"
6
- version="1.1"
7
- width="45"
8
- height="45"
9
- id="svg3128">
10
- <defs
11
- id="defs3130" />
12
- <g
13
- id="layer1">
14
- <path
15
- d="M 22,9 C 19.792,9 18,10.792 18,13 C 18,13.885 18.294,14.712 18.781,15.375 C 16.829,16.497 15.5,18.588 15.5,21 C 15.5,23.034 16.442,24.839 17.906,26.031 C 14.907,27.089 10.5,31.578 10.5,39.5 L 33.5,39.5 C 33.5,31.578 29.093,27.089 26.094,26.031 C 27.558,24.839 28.5,23.034 28.5,21 C 28.5,18.588 27.171,16.497 25.219,15.375 C 25.706,14.712 26,13.885 26,13 C 26,10.792 24.208,9 22,9 z "
16
- style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10;stroke-opacity:1"
17
- id="path3194" />
18
- </g>
19
- </svg>
@@ -1,60 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg
4
- xmlns:svg="http://www.w3.org/2000/svg"
5
- xmlns="http://www.w3.org/2000/svg"
6
- version="1.1"
7
- width="45"
8
- height="45"
9
- id="svg3128">
10
- <defs
11
- id="defs3130" />
12
- <g
13
- id="layer1">
14
- <path
15
- d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z"
16
- transform="translate(-1,-1)"
17
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
18
- id="path5571" />
19
- <path
20
- d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z"
21
- transform="translate(15.5,-5.5)"
22
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
23
- id="path5573" />
24
- <path
25
- d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z"
26
- transform="translate(32,-1)"
27
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
28
- id="path5575" />
29
- <path
30
- d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z"
31
- transform="translate(7,-4.5)"
32
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
33
- id="path5577" />
34
- <path
35
- d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z"
36
- transform="translate(24,-4)"
37
- style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
38
- id="path5579" />
39
- <path
40
- d="M 9,26 C 17.5,24.5 30,24.5 36,26 L 38,14 L 31,25 L 31,11 L 25.5,24.5 L 22.5,9.5 L 19.5,24.5 L 14,10.5 L 14,25 L 7,14 L 9,26 z "
41
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
42
- id="path5581" />
43
- <path
44
- d="M 9,26 C 9,28 10.5,28 11.5,30 C 12.5,31.5 12.5,31 12,33.5 C 10.5,34.5 10.5,36 10.5,36 C 9,37.5 11,38.5 11,38.5 C 17.5,39.5 27.5,39.5 34,38.5 C 34,38.5 35.5,37.5 34,36 C 34,36 34.5,34.5 33,33.5 C 32.5,31 32.5,31.5 33.5,30 C 34.5,28 36,28 36,26 C 27.5,24.5 17.5,24.5 9,26 z "
45
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
46
- id="path5583" />
47
- <path
48
- d="M 11.5,30 C 15,29 30,29 33.5,30"
49
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
50
- id="path5585" />
51
- <path
52
- d="M 12,33.5 C 18,32.5 27,32.5 33,33.5"
53
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
54
- id="path5587" />
55
- <path
56
- d="M 10.5,36 C 15.5,35 29,35 34,36"
57
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
58
- id="path5589" />
59
- </g>
60
- </svg>
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg
4
- xmlns:svg="http://www.w3.org/2000/svg"
5
- xmlns="http://www.w3.org/2000/svg"
6
- version="1.1"
7
- width="45"
8
- height="45"
9
- id="svg3128">
10
- <defs
11
- id="defs3130" />
12
- <g
13
- style="display:inline"
14
- id="layer1">
15
- <path
16
- d="M 9,39 L 36,39 L 36,36 L 9,36 L 9,39 z "
17
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
18
- id="path3119" />
19
- <path
20
- d="M 12,36 L 12,32 L 33,32 L 33,36 L 12,36 z "
21
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
22
- id="path3121" />
23
- <path
24
- d="M 11,14 L 11,9 L 15,9 L 15,11 L 20,11 L 20,9 L 25,9 L 25,11 L 30,11 L 30,9 L 34,9 L 34,14"
25
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
26
- id="path3129" />
27
- <path
28
- d="M 34,14 L 31,17 L 14,17 L 11,14"
29
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
30
- id="path3127" />
31
- <path
32
- d="M 31,17 L 31,29.5 L 14,29.5 L 14,17"
33
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
34
- id="path3125" />
35
- <path
36
- d="M 31,29.5 L 32.5,32 L 12.5,32 L 14,29.5"
37
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
38
- id="path3123" />
39
- <path
40
- d="M 11,14 L 34,14"
41
- style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1"
42
- id="path5175" />
43
- </g>
44
- </svg>
@@ -1,56 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10
- version="1.1"
11
- width="45"
12
- height="45"
13
- id="svg3128"
14
- inkscape:version="0.91 r"
15
- sodipodi:docname="wx.svg">
16
- <metadata
17
- id="metadata14">
18
- <rdf:RDF>
19
- <cc:Work
20
- rdf:about="">
21
- <dc:format>image/svg+xml</dc:format>
22
- <dc:type
23
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
24
- <dc:title />
25
- </cc:Work>
26
- </rdf:RDF>
27
- </metadata>
28
- <sodipodi:namedview
29
- pagecolor="#ffffff"
30
- bordercolor="#666666"
31
- borderopacity="1"
32
- objecttolerance="10"
33
- gridtolerance="10"
34
- guidetolerance="10"
35
- inkscape:pageopacity="0"
36
- inkscape:pageshadow="2"
37
- inkscape:window-width="1680"
38
- inkscape:window-height="973"
39
- id="namedview12"
40
- showgrid="false"
41
- inkscape:zoom="10.488889"
42
- inkscape:cx="5.7480884"
43
- inkscape:cy="26.23736"
44
- inkscape:window-x="0"
45
- inkscape:window-y="25"
46
- inkscape:window-maximized="1"
47
- inkscape:current-layer="svg3128" />
48
- <defs
49
- id="defs3130" />
50
- <circle
51
- style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.5;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
52
- id="path2991"
53
- cx="22.5"
54
- cy="22.5"
55
- r="13.25" />
56
- </svg>
@@ -1,135 +0,0 @@
1
- #!/bin/bash
2
- ################################################################################
3
- # #
4
- # This file is part of Kokopu-React, a JavaScript chess library. #
5
- # Copyright (C) 2021-2022 Yoann Le Montagner <yo35 -at- melix.net> #
6
- # #
7
- # This program is free software: you can redistribute it and/or #
8
- # modify it under the terms of the GNU Lesser General Public License #
9
- # as published by the Free Software Foundation, either version 3 of #
10
- # the License, or (at your option) any later version. #
11
- # #
12
- # This program is distributed in the hope that it will be useful, #
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15
- # GNU Lesser General Public License for more details. #
16
- # #
17
- # You should have received a copy of the GNU Lesser General #
18
- # Public License along with this program. If not, see #
19
- # <http://www.gnu.org/licenses/>. #
20
- # #
21
- ################################################################################
22
-
23
-
24
- # This script aims at generating the .png sprite files corresponding the .svg files
25
- # saved in /chess-sprites and its sub-directories.
26
- # The generated .png files are saved in git, thus no need to call this script during the package build.
27
-
28
- # Output sprite size
29
- size=96
30
-
31
- # Output directory
32
- output_dir=../src/sprites
33
- cd `dirname $0`
34
- mkdir -p $output_dir
35
-
36
-
37
- function echo_pieceset {
38
- echo ""
39
- echo "#################################################"
40
- echo "# Pieceset $1"
41
- echo "#################################################"
42
- echo ""
43
- }
44
-
45
-
46
- function echo_sprite {
47
- echo "Processing sprite $1..."
48
- }
49
-
50
-
51
-
52
- ################################################################################
53
- # CBURNETT
54
- ################################################################################
55
-
56
- function export_cburnett {
57
-
58
- echo_pieceset "cburnett"
59
-
60
- codes=$1
61
- for code in $codes; do
62
-
63
- echo_sprite $code
64
-
65
- # Input/output files
66
- input=cburnett/$code.svg
67
- output=$output_dir/cburnett-$code.png
68
-
69
- # Create the sprite
70
- inkscape -e $output -w $size -h $size $input > /dev/null
71
-
72
- done
73
- }
74
-
75
-
76
-
77
- ################################################################################
78
- # MMONGE
79
- ################################################################################
80
-
81
- function export_mmonge {
82
-
83
- codes=$1
84
- piecesets=$2
85
-
86
- for pieceset in $piecesets; do
87
-
88
- echo_pieceset $pieceset
89
-
90
- for code in $codes; do
91
-
92
- echo_sprite $code
93
-
94
- colorcode=${code:0:1}
95
- piececode=${code:1:1}
96
-
97
- if [ "$piececode" == "x" ]; then
98
-
99
- # Input/output files
100
- input=mmonge/$pieceset-$code.svg
101
- output=$output_dir/$pieceset-$code.png
102
-
103
- # Create the sprite
104
- inkscape -e $output -w $size -h $size $input > /dev/null
105
-
106
- else
107
-
108
- # Input/output files
109
- input=mmonge/$pieceset.svg
110
- output=$output_dir/$pieceset-$code.png
111
-
112
- # Area to extract from the source file
113
- x1=`expr "(" index "kqrbnp" $piececode ")" "*" 200`
114
- y1=`expr "(" index "wb" $colorcode ")" "*" 200`
115
- x0=`expr $x1 - 200`
116
- y0=`expr $y1 - 200`
117
- area="$x0:$y0:$x1:$y1"
118
-
119
- # Create the sprite
120
- inkscape -e $output -a $area -w $size -h $size $input > /dev/null
121
- fi
122
-
123
- done
124
- done
125
- }
126
-
127
-
128
-
129
- ################################################################################
130
- # RUN THE EXPORTS
131
- ################################################################################
132
-
133
- export_cburnett "bb bk bn bp bq br bx wb wk wn wp wq wr wx"
134
- export_mmonge "bb bk bn bp bq br wb wk wn wp wq wr" "celtic eyes fantasy skulls spatial"
135
- export_mmonge "bx wx" "celtic eyes-spatial fantasy skulls"
@@ -1,112 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- xmlns:xlink="http://www.w3.org/1999/xlink"
9
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
10
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
11
- version="1.1"
12
- width="200"
13
- height="200"
14
- id="svg3128"
15
- inkscape:version="0.91 r"
16
- sodipodi:docname="celtic-bx.svg">
17
- <metadata
18
- id="metadata14">
19
- <rdf:RDF>
20
- <cc:Work
21
- rdf:about="">
22
- <dc:format>image/svg+xml</dc:format>
23
- <dc:type
24
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
25
- <dc:title />
26
- </cc:Work>
27
- </rdf:RDF>
28
- </metadata>
29
- <sodipodi:namedview
30
- pagecolor="#ffffff"
31
- bordercolor="#666666"
32
- borderopacity="1"
33
- objecttolerance="10"
34
- gridtolerance="10"
35
- guidetolerance="10"
36
- inkscape:pageopacity="0"
37
- inkscape:pageshadow="2"
38
- inkscape:window-width="1280"
39
- inkscape:window-height="997"
40
- id="namedview12"
41
- showgrid="false"
42
- inkscape:zoom="2.6222223"
43
- inkscape:cx="51.849615"
44
- inkscape:cy="88.0318"
45
- inkscape:window-x="1680"
46
- inkscape:window-y="0"
47
- inkscape:window-maximized="1"
48
- inkscape:current-layer="svg3128"
49
- showguides="true" />
50
- <defs
51
- id="defs3130">
52
- <linearGradient
53
- id="linearGradientBlackPieces">
54
- <stop
55
- id="stop2268"
56
- offset="0"
57
- style="stop-color:#000000;stop-opacity:1;" />
58
- <stop
59
- id="stop2270"
60
- offset="1"
61
- style="stop-color:#505070;stop-opacity:1;" />
62
- </linearGradient>
63
- <linearGradient
64
- id="linearGradientBlackPiecesBorder">
65
- <stop
66
- style="stop-color:#808080;stop-opacity:1;"
67
- offset="0"
68
- id="stop7192" />
69
- <stop
70
- style="stop-color:#808080;stop-opacity:1;"
71
- offset="1"
72
- id="stop7194" />
73
- </linearGradient>
74
- <linearGradient
75
- gradientTransform="matrix(0.35702699,0,0,0.39669667,-171.34051,-48.100097)"
76
- inkscape:collect="always"
77
- xlink:href="#linearGradientBlackPieces-9"
78
- id="linearGradient5532"
79
- gradientUnits="userSpaceOnUse"
80
- x1="559.771"
81
- y1="313.20999"
82
- x2="911.98419"
83
- y2="460.03769" />
84
- <linearGradient
85
- id="linearGradientBlackPieces-9">
86
- <stop
87
- id="stop2268-7"
88
- offset="0"
89
- style="stop-color:#000e1c;stop-opacity:1;" />
90
- <stop
91
- id="stop2270-6"
92
- offset="1"
93
- style="stop-color:#50506f;stop-opacity:1;" />
94
- </linearGradient>
95
- <linearGradient
96
- gradientTransform="matrix(0.35702699,0,0,0.39669667,-171.34051,-48.100097)"
97
- inkscape:collect="always"
98
- xlink:href="#linearGradientBlackPiecesBorder"
99
- id="linearGradient5534"
100
- gradientUnits="userSpaceOnUse"
101
- x1="582.45239"
102
- y1="373.33334"
103
- x2="937.54761"
104
- y2="373.33334" />
105
- </defs>
106
- <circle
107
- cy="100"
108
- cx="100"
109
- id="path35272"
110
- style="fill:url(#linearGradient5532);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5534);stroke-width:4.99100018;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
111
- r="59.504501" />
112
- </svg>