Initial commit

This commit is contained in:
KingOfDog
2019-04-08 21:52:07 +02:00
committed by Marcel
commit e377dc3668
15 changed files with 787 additions and 0 deletions

1
assets/bishop_black.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.59 660.4"><defs><style>.a{fill:#fff;}</style></defs><title>bishop_black</title><path d="M115.05,74.1a38.4,38.4,0,1,1,60.4,0Z"/><rect x="34.75" y="619.7" width="221" height="28.9"/><path d="M96.85,322.2h-7.8c-4.4-2.3-21-11.9-24.7-28.6-.1-.5-.2-1.1-.3-1.6h162.2c-.1.6-.2,1.1-.3,1.7-3.8,16.8-20.3,26.3-24.7,28.5H96.85Z"/><path d="M211.55,238.1H79c-4.8-3-23.9-17.7-23.9-61.3,0-14.5,5.2-29.7,15.4-45.1l64.1,44.6a5.94,5.94,0,0,0,7.6-.7,6,6,0,0,0,.7-7.6l-46.1-66.7a185,185,0,0,1,18.8-15.4h59.6c8.8,6.3,60.4,44.9,60.4,90.8C235.45,220.4,216.25,235.1,211.55,238.1Z"/><path d="M69.55,265.5h0a74.39,74.39,0,0,1,4.5-7.5c.1-.2.3-.4.4-.6.7-1,1.4-2,2.2-3l.6-.9c.9-1.2,1.9-2.4,2.9-3.6h130.3c1,1.2,2,2.4,2.9,3.6a5.5,5.5,0,0,0,.7.9c.7,1,1.4,2,2.1,2.9.2.2.3.5.5.7a86.27,86.27,0,0,1,4.5,7.4.1.1,0,0,0,.1.1,50.41,50.41,0,0,1,5.2,14.6H64.25A51.87,51.87,0,0,1,69.55,265.5Z"/><path d="M42.85,498.4c26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65,3.5,32.2-13.7,42.5-17.7,44.5H30.05c-4.1-2-21.2-12.3-17.7-44.5C14.25,545.9,27.45,523.9,42.85,498.4Z"/><path class="a" d="M.55,562.1c-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V617.4c8.2-4.7,26.3-19.4,22.4-55.3-2.2-20.1-16.1-43.2-32.1-69.8-25.2-41.8-56.4-93.6-58.2-158.3h3.1a6.44,6.44,0,0,0,2.4-.5c1.1-.5,26.8-12.2,32.5-37.3,2.5-11.2.5-23.1-5.8-35.5v-.1a63.52,63.52,0,0,0-4.6-7.8c-.2-.4-.5-.7-.7-1.1l-1.2-1.8c-.4-.6-.8-1.1-1.2-1.7s-.7-1-1.1-1.5-.8-1.1-1.2-1.6c9.2-7.5,25.5-26.8,25.5-68.5,0-46.5-43.7-84.1-61.1-97.3a50.3,50.3,0,1,0-82,0,217.42,217.42,0,0,0-19.5,16.8,5.8,5.8,0,0,0-.7,7.6l30.4,44-42.1-29.3a6,6,0,0,0-8.2,1.4c-13.9,19.2-20.9,38.3-20.9,56.9,0,41.7,16.3,60.9,25.5,68.5-.4.5-.8,1.1-1.2,1.6a14.31,14.31,0,0,0-1.1,1.5c-.4.6-.8,1.1-1.2,1.7l-1.2,1.8c-.2.4-.5.7-.7,1.1-1.7,2.6-3.2,5.2-4.6,7.8v.1c-6.3,12.4-8.3,24.3-5.8,35.5,5.6,25.1,31.4,36.8,32.5,37.3a6.87,6.87,0,0,0,2.4.5h3.1c-1.8,64.7-33,116.5-58.2,158.3C16.65,519,2.75,542,.55,562.1ZM183.65,50.4a38,38,0,0,1-8.2,23.6H115a38.4,38.4,0,1,1,68.7-23.6Zm27.9,187.7H79c-4.8-3-23.9-17.7-23.9-61.3,0-14.5,5.2-29.7,15.4-45.1l64.1,44.6a5.94,5.94,0,0,0,7.6-.7,6,6,0,0,0,.7-7.6l-46.1-66.7a185,185,0,0,1,18.8-15.4h59.6c8.8,6.3,60.4,44.9,60.4,90.8C235.45,220.4,216.25,235.1,211.55,238.1Zm14.7,42h-162a50.41,50.41,0,0,1,5.2-14.6v-.1A86.27,86.27,0,0,1,74,258c.1-.2.3-.4.4-.6.7-1,1.4-2,2.2-3l.6-.9c.9-1.2,1.9-2.4,2.9-3.6h130.3c1,1.2,2,2.4,2.9,3.6a5.5,5.5,0,0,0,.7.9c.7,1,1.4,2,2.1,2.9.2.2.3.5.5.7a86.27,86.27,0,0,1,4.5,7.4.1.1,0,0,0,.1.1A58,58,0,0,1,226.25,280.1Zm-32.6,42.1H89.05c-4.4-2.3-21-11.9-24.7-28.6-.1-.5-.2-1.1-.3-1.6h162.2c-.1.6-.2,1.1-.3,1.7-3.8,16.8-20.3,26.3-24.7,28.5ZM34.75,619.7h221v28.9h-221Zm-22.4-56.3c1.9-17.5,15.2-39.5,30.5-65,26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65,3.5,32.2-13.7,42.5-17.7,44.5H30.05C26,605.9,8.85,595.5,12.35,563.4Z"/></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

1
assets/bishop_white.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.49 660.4"><defs><style>.a{fill:#fff;}</style></defs><title>bishop_white</title><path class="a" d="M175.45,74.2a38.41,38.41,0,1,0-60.41,0Z"/><rect class="a" x="34.65" y="619.8" width="221" height="28.9"/><path class="a" d="M193.55,322.3h7.8c4.4-2.3,21-11.9,24.7-28.6.1-.5.2-1.1.3-1.6H64.15c.1.6.2,1.1.3,1.7,3.8,16.8,20.3,26.3,24.7,28.5h104.4Z"/><path class="a" d="M78.84,238.2h132.6c4.81-3,23.9-17.7,23.9-61.3,0-14.5-5.19-29.7-15.4-45.1l-64.1,44.6a5.92,5.92,0,0,1-7.59-.7,6,6,0,0,1-.7-7.6l46.1-66.7A184.75,184.75,0,0,0,174.84,86H115.25c-8.81,6.3-60.41,44.9-60.41,90.8C55.05,220.5,74.25,235.2,78.84,238.2Z"/><path class="a" d="M221,265.6h0a74.39,74.39,0,0,0-4.5-7.5c-.1-.2-.3-.4-.4-.6-.7-1-1.4-2-2.2-3l-.6-.9c-.9-1.2-1.9-2.4-2.9-3.6H80.05c-1,1.2-2,2.4-2.9,3.6a5.5,5.5,0,0,1-.7.9c-.7,1-1.4,2-2.1,2.9-.2.2-.3.5-.5.7a86.27,86.27,0,0,0-4.5,7.4.1.1,0,0,1-.1.1,50.41,50.41,0,0,0-5.2,14.6H226A45.5,45.5,0,0,0,221,265.6Z"/><path class="a" d="M247.65,498.5c-26-43.1-58.1-96.4-59.9-164.4h-85C100.94,402,68.84,455.4,42.84,498.5c-15.4,25.5-28.59,47.5-30.5,65C8.84,595.7,26,606,30,608h230.4c4.1-2,21.2-12.3,17.7-44.5C276.25,546,263,524,247.65,498.5Z"/><path d="M257.75,492.4c-25.2-41.8-56.41-93.6-58.2-158.3h3.1a6.48,6.48,0,0,0,2.4-.5c1.1-.5,26.8-12.2,32.5-37.3,2.5-11.2.5-23.1-5.8-35.5v-.1a83.55,83.55,0,0,0-4.6-7.8,6.73,6.73,0,0,0-.7-1.1l-1.2-1.8c-.4-.6-.8-1.1-1.2-1.7s-.7-1-1.1-1.5-.8-1.1-1.2-1.6c9.2-7.5,25.5-26.8,25.5-68.5,0-18.5-7-37.7-20.9-56.9a6,6,0,0,0-8.2-1.4l-42.1,29.3,30.4-44a6,6,0,0,0-.7-7.6,220,220,0,0,0-19.5-16.8,50.3,50.3,0,1,0-82,0c-17.4,13.1-61.1,50.8-61.1,97.3,0,41.7,16.3,60.9,25.5,68.5-.4.5-.8,1.1-1.2,1.6a14.31,14.31,0,0,0-1.1,1.5c-.4.6-.8,1.1-1.2,1.7L64,251.7c-.2.4-.5.7-.7,1.1-1.7,2.6-3.2,5.2-4.6,7.8v.1c-6.3,12.4-8.3,24.2-5.8,35.5,5.6,25.1,31.4,36.8,32.5,37.3a6.87,6.87,0,0,0,2.4.5h3.1c-1.8,64.7-33,116.5-58.2,158.3C16.55,519,2.65,542,.55,562.1c-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.8a5.91,5.91,0,0,0,5.9-5.9V617.4c8.2-4.7,26.3-19.4,22.4-55.3C287.75,542.1,273.84,519.1,257.75,492.4ZM145.25,12.1a38.42,38.42,0,0,1,38.4,38.4,38,38,0,0,1-8.2,23.6H115a38.31,38.31,0,0,1,30.3-62ZM55.05,176.8c0-45.9,51.6-84.5,60.4-90.8h59.6a197.22,197.22,0,0,1,18.8,15.4l-46.1,66.7a6,6,0,0,0,8.3,8.3l64.1-44.6c10.19,15.5,15.4,30.6,15.4,45.1,0,43.6-19.1,58.3-23.9,61.3H79.05C74.25,235.2,55.05,220.5,55.05,176.8Zm14.4,88.9a.1.1,0,0,1,.1-.1,86.27,86.27,0,0,1,4.5-7.4c.2-.2.3-.5.5-.7.7-1,1.4-2,2.1-2.9a5.41,5.41,0,0,1,.69-.9c.91-1.2,1.91-2.4,2.91-3.6h130.3c1,1.2,2,2.4,2.9,3.6l.6.9c.7,1,1.5,2,2.2,3,.09.2.3.4.4.6,1.69,2.5,3.19,5,4.5,7.4v.1a50.07,50.07,0,0,1,5.19,14.6H64.44A43.75,43.75,0,0,1,69.45,265.7Zm19.6,56.6c-4.3-2.2-20.9-11.7-24.7-28.5-.1-.6-.2-1.1-.3-1.7h162.2c-.1.5-.2,1.1-.31,1.6-3.69,16.8-20.3,26.4-24.69,28.6H89.05Zm166.7,326.5h-221V619.9h221Zm4.7-40.8H30.05c-4-1.9-21.2-12.3-17.7-44.5,1.9-17.5,15.2-39.5,30.5-65,26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65C281.65,595.6,264.55,606,260.45,608Z"/></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

1
assets/king_black.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.59 741.2"><defs><style>.a{fill:#fff;}</style></defs><title>king_black</title><path d="M87.75,280.2c1-2.8,2.3-6.2-16.3-76.2-6.4-24.1-13.1-48-16.4-59.7h180.2c-3.3,11.8-10,35.6-16.4,59.7-18.6,69.9-17.3,73.4-16.3,76.2,2,5.4,13.4,20.9,21.5,31.5H66.25C74.35,301.1,85.75,285.6,87.75,280.2Z"/><path d="M66.25,379.9h158.1c-5.6,13.4-19,21.1-22.9,23.1H89.05C85.25,401,71.85,393.3,66.25,379.9Z"/><path d="M168.55,89.8a5.93,5.93,0,0,0-2.6,4.9v1.4a5.93,5.93,0,0,0,.5,2.3l14.2,34h-70.6l14.2-34a5.93,5.93,0,0,0,.5-2.3V94.9a5.93,5.93,0,0,0-2.6-4.9,5.85,5.85,0,0,0-5.6-.5l-42.8,17.8V36.7l42.8,17.8a5.86,5.86,0,0,0,8.2-5.4V47.9a5.93,5.93,0,0,0-.5-2.3l-14.2-34h70.5l-14.2,34a6,6,0,0,0,7.8,7.8L216,36v70.6l-41.8-17.4A6.14,6.14,0,0,0,168.55,89.8Z"/><path d="M34.35,368.1c1.9-13.8,9.5-28.8,22.6-44.5h176.5c13.2,15.8,20.8,30.7,22.6,44.5H34.35Z"/><path d="M42.85,579.2c26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65,3.5,32.2-13.7,42.5-17.7,44.5H30.05c-4.1-2-21.2-12.3-17.7-44.5C14.15,626.7,27.45,604.7,42.85,579.2Z"/><rect x="34.75" y="700.5" width="221" height="28.9"/><path class="a" d="M.55,642.9c-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V698.2c8.2-4.7,26.3-19.4,22.4-55.3-2.2-20.1-16.1-43.2-32.1-69.8-25.2-41.8-56.4-93.6-58.2-158.3h3.1a6.44,6.44,0,0,0,2.4-.5c1.1-.5,24.8-11.3,31.7-34.4h25.6a5.6,5.6,0,0,0,4.2-1.8,6.07,6.07,0,0,0,1.7-4.2c-.3-18.9-9.6-39.1-27.7-60.1-11.6-14.9-24.4-32.3-26.8-37.2.2-9.6,17.9-77,34.8-136.6a6,6,0,0,0-1-5.2,5.92,5.92,0,0,0-4.7-2.4h-49.8l-11.3-27,37.4,15.6a5.86,5.86,0,0,0,8.2-5.4V27.2a5.93,5.93,0,0,0-2.6-4.9,5.85,5.85,0,0,0-5.6-.5l-36.7,15.3,12-28.9a5.9,5.9,0,0,0-.5-5.6,5.69,5.69,0,0,0-4.9-2.6h-88.4A5.93,5.93,0,0,0,96,2.6a5.85,5.85,0,0,0-.5,5.6l12.6,30.3-38.3-16a5.86,5.86,0,0,0-8.2,5.4v88.4a5.93,5.93,0,0,0,2.6,4.9,5.85,5.85,0,0,0,5.6.5l38.3-16L97,132.4H47.15a5.78,5.78,0,0,0-4.7,2.4,6,6,0,0,0-1,5.2c16.9,59.6,34.7,126.9,34.8,136.6-2.3,4.9-15.1,22.3-26.8,37.2-18.1,21-27.4,41.2-27.7,60.1a5.89,5.89,0,0,0,1.7,4.2,6,6,0,0,0,4.2,1.8h25.7c6.8,23.1,30.6,33.9,31.7,34.4a6.87,6.87,0,0,0,2.4.5h3.1c-1.8,64.7-33,116.5-58.2,158.3C16.55,599.8,2.75,622.8.55,642.9ZM174.15,89.3a5.86,5.86,0,0,0-8.2,5.4v1.4a5.93,5.93,0,0,0,.5,2.3l14.2,34h-70.6l14.2-34a5.93,5.93,0,0,0,.5-2.3V94.9a5.93,5.93,0,0,0-2.6-4.9,5.85,5.85,0,0,0-5.6-.5l-42.8,17.8V36.7l42.8,17.8a5.86,5.86,0,0,0,8.2-5.4V47.9a5.93,5.93,0,0,0-.5-2.3l-14.2-34h70.5l-14.2,34a6,6,0,0,0,7.8,7.8L216,36v70.6Zm50,222.4H66.25c8.1-10.6,19.5-26.1,21.5-31.5,1-2.8,2.3-6.2-16.3-76.2-6.4-24.1-13.1-48-16.4-59.7h180.2c-3.3,11.8-10,35.6-16.4,59.7-18.6,69.9-17.3,73.4-16.3,76.2C204.65,285.6,216.15,301.1,224.15,311.7Zm8,56.4H34.35c1.9-13.8,9.5-28.8,22.6-44.5h176.5c13.2,15.8,20.8,30.7,22.6,44.5ZM89.05,403c-3.8-2-17.2-9.7-22.9-23.1h158.1c-5.6,13.4-19,21.1-22.9,23.1ZM34.75,700.5h221v28.9h-221V700.5Zm-22.5-56.3c1.9-17.5,15.2-39.5,30.5-65,26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65,3.5,32.2-13.7,42.5-17.7,44.5H30.05C25.85,686.7,8.75,676.3,12.25,644.2Z"/></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

1
assets/king_white.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.59 741.2"><defs><style>.a{fill:#fff;}</style></defs><title>king_white</title><path class="a" d="M203,280.2c-1-2.8-2.3-6.2,16.3-76.2,6.4-24.1,13.1-48,16.4-59.7H55.45c3.3,11.8,10,35.6,16.4,59.7,18.6,69.9,17.3,73.4,16.3,76.2-2,5.4-13.4,20.9-21.5,31.5h157.9C216.45,301.1,205.05,285.6,203,280.2Z"/><path class="a" d="M224.55,379.9H66.45c5.6,13.4,19,21.1,22.9,23.1h112.3C205.55,401,219,393.3,224.55,379.9Z"/><path class="a" d="M122.25,89.8a5.93,5.93,0,0,1,2.6,4.9v1.4a5.93,5.93,0,0,1-.5,2.3l-14.2,34h70.6l-14.2-34a5.93,5.93,0,0,1-.5-2.3v-1a5.93,5.93,0,0,1,2.6-4.9,5.85,5.85,0,0,1,5.6-.5l42.8,17.8V36.9l-42.8,17.8a5.86,5.86,0,0,1-8.2-5.4V48.1a5.93,5.93,0,0,1,.5-2.3l14.2-34h-70.5l14.2,34a6,6,0,0,1-7.8,7.8L74.85,36.2v70.6l41.8-17.4A5.88,5.88,0,0,1,122.25,89.8Z"/><path class="a" d="M256.45,368.1c-1.9-13.8-9.5-28.8-22.6-44.5H57.25c-13.2,15.8-20.8,30.7-22.6,44.5h221.8Z"/><path class="a" d="M248,579.2c-26-43.1-58.1-96.4-59.9-164.4h-85c-1.8,67.9-33.9,121.3-59.9,164.4-15.4,25.5-28.6,47.5-30.5,65-3.5,32.2,13.7,42.5,17.7,44.5h230.4c4.1-2,21.2-12.3,17.7-44.5C276.55,626.7,263.35,604.7,248,579.2Z"/><rect class="a" x="35.05" y="700.5" width="221" height="28.9"/><path d="M258.15,573.1c-25.2-41.8-56.4-93.6-58.2-158.3h3.1a6.44,6.44,0,0,0,2.4-.5c1.1-.5,24.8-11.3,31.7-34.4h25.7a5.6,5.6,0,0,0,4.2-1.8,6.07,6.07,0,0,0,1.7-4.2c-.3-18.9-9.6-39.1-27.7-60.1-11.6-14.9-24.4-32.3-26.8-37.2.2-9.6,17.9-77,34.8-136.6a6,6,0,0,0-1-5.2,5.92,5.92,0,0,0-4.7-2.4h-49.8l-11.1-26.7,38.3,16a5.86,5.86,0,0,0,8.2-5.4V27.9a5.93,5.93,0,0,0-2.6-4.9,5.85,5.85,0,0,0-5.6-.5l-38.3,16,12.6-30.3a5.9,5.9,0,0,0-.5-5.6,5.93,5.93,0,0,0-4.9-2.6h-88.4a5.93,5.93,0,0,0-4.9,2.6,5.85,5.85,0,0,0-.5,5.6l12,28.9L71.15,21.8A5.86,5.86,0,0,0,63,27.2v88.4a5.93,5.93,0,0,0,2.6,4.9,5.85,5.85,0,0,0,5.6.5l37.4-15.6-11.3,27H47.45a5.78,5.78,0,0,0-4.7,2.4,6,6,0,0,0-1,5.2c16.9,59.6,34.7,126.9,34.8,136.6-2.3,4.9-15.1,22.3-26.8,37.2-18.1,21-27.4,41.2-27.7,60.1a5.89,5.89,0,0,0,1.7,4.2,6,6,0,0,0,4.2,1.8h25.7c6.8,23.1,30.6,33.9,31.7,34.4a6.87,6.87,0,0,0,2.4.5h3.1c-1.8,64.7-33,116.5-58.2,158.3-16.1,26.7-30,49.7-32.1,69.8-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V698.2c8.2-4.7,26.3-19.4,22.4-55.3C288.05,622.8,274.15,599.8,258.15,573.1ZM75,106.7V36.1l41.8,17.4a6,6,0,0,0,7.8-7.8l-14.2-34H181l-14.2,34a5.93,5.93,0,0,0-.5,2.3v1.2a5.93,5.93,0,0,0,2.6,4.9,5.85,5.85,0,0,0,5.6.5l42.8-17.8v70.6l-42.8-17.8a5.86,5.86,0,0,0-8.2,5.4v1.2a5.93,5.93,0,0,0,.5,2.3l14.2,34h-70.7l14.2-34a5.93,5.93,0,0,0,.5-2.3V94.8a5.93,5.93,0,0,0-2.6-4.9,5.85,5.85,0,0,0-5.6-.5Zm13.2,173.5c1-2.8,2.3-6.3-16.3-76.2-6.4-24.1-13.1-48-16.4-59.7h180.2c-3.3,11.8-10,35.6-16.4,59.7-18.6,69.9-17.3,73.4-16.3,76.2,2,5.4,13.4,20.9,21.5,31.5H66.55C74.65,301.1,86.05,285.6,88.15,280.2Zm-53.5,87.9c1.9-13.8,9.5-28.8,22.6-44.5h176.5c13.2,15.8,20.8,30.7,22.6,44.5H34.65ZM89.45,403c-3.8-2-17.2-9.6-22.9-23.1h158.1c-5.6,13.3-19,21.1-22.9,23.1Zm166.6,326.5h-221V700.6h221Zm4.7-40.8H30.35c-4-1.9-21.2-12.3-17.7-44.5,1.9-17.5,15.2-39.5,30.5-65,26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65C282,676.3,264.85,686.7,260.75,688.7Z"/></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

1
assets/knight_black.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 357.72 554.15"><defs><style>.a{fill:#fff;}</style></defs><title>knight_black</title><path d="M302.48,423.85c9.9,10.9,16.3,20.5,17.7,33.2,3.5,32.1-13.6,42.5-17.7,44.5H72.08c-4.1-2-21.2-12.3-17.7-44.5,1.4-12.8,7.8-22.4,17.7-33.2Z"/><path d="M44.08,232.65c-.2-4.2-.6-8.8-.9-13.8-3.5-49.6-9.4-132.6,45.6-175.1,59.9-46.3,126.8-30.1,135.7-25.7,3.1,3.8,6.1,24,7.8,35,.6,3.7,1,7,1.5,9.8-29.1-13.5-57.2-7.8-70.5-3.7-1.2-10.6-4.9-18.9-11-24.6a29.58,29.58,0,0,0-20.4-7.8,6,6,0,0,0-5.4,4.6l-14,59.7c-8.5,6.8-42.3,36.9-38.5,89,2.1,28.6,12.7,52.4,22.1,73.4,9.3,20.8,17.4,38.7,15.5,56.8-3,29.2-30,54.9-40.3,63.8l-55.5-56.3C46.38,300,46.48,275.45,44.08,232.65Z"/><rect x="76.78" y="513.35" width="221" height="28.9"/><path d="M73.38,412c-6.6-16.7.4-24.4,1.3-25.4,4-3.1,44.5-35.3,48.6-75.1,2.2-21.2-6.9-41.4-16.5-62.9-9.4-21.1-19.2-42.8-21.1-69.4-3.7-51.6,35-79.6,35.4-79.9a6.2,6.2,0,0,0,2.4-3.5l13.3-56.7a17.4,17.4,0,0,1,7.5,4.2c5,4.8,7.6,12.9,7.6,24.1a6,6,0,0,0,2.7,5,6.06,6.06,0,0,0,5.7.4c.4-.2,40.4-17.8,77.7,5.7,6.8,11.9,29.9,23.5,43.5,28.3a4.67,4.67,0,0,0,1.7.3c39.8,1.7,54.6,31.2,59.1,43.9,5.1,14.3,4.2,25.7,2.1,30.1h-34.2l-38.4-7.3a5.9,5.9,0,1,0-2.2,11.6l33,6.3a19.53,19.53,0,0,1-10.7,11.8c-8.2,3.6-18.8,2-27-4-21.7-16-47-1.1-48.2-.3-.8.5-36.2,20.9-55.6.9a5.94,5.94,0,1,0-8.5,8.3c9.1,9.3,20.1,12.4,30.8,12.4,15,0,29.2-6.1,35.7-9.4,17.7,14.6,107.1,90.8,111.7,139,4.5,46.8-21.8,59.7-26.5,61.6Z"/><path class="a" d="M.08,315.25a6.2,6.2,0,0,0,1.6,5.2L63,382.65c-3.6,5.9-7.3,17.2-.5,34.2-10.8,12-18.3,23.5-20,39-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9v-37.1c8.2-4.7,26.3-19.4,22.4-55.3-1.5-14.2-7.9-25.1-17.3-36,11.7-7.2,31.8-26.1,27.6-70.5-4.8-50.1-86-121.9-111.6-143.4,7.1-2.2,17.7-3.6,26.9,3.2,11.7,8.6,26.6,10.7,38.8,5.3a31.32,31.32,0,0,0,18-21.4h32.7a5.78,5.78,0,0,0,3.9-1.5c8.1-7.2,9-25.4,2.2-44.4-10.9-30.7-36.6-50-68.8-51.7-16.3-5.8-34-17-36.7-23.3-1.2-2.8-2.6-12.4-3.9-20.8-4-26.7-6.6-39.7-13.5-43.5-8.8-4.8-82.4-24.8-148.9,26.6-60,46.4-53.9,133.4-50.2,185.3.3,4.9.7,9.5.9,13.6,2.7,46.9,1,63.3-28.9,77.6A5.83,5.83,0,0,0,.08,315.25ZM304,412H73.38c-6.6-16.7.4-24.4,1.3-25.4,4-3.1,44.5-35.3,48.6-75.1,2.2-21.2-6.9-41.4-16.5-62.9-9.4-21.1-19.2-42.8-21.1-69.4-3.7-51.6,35-79.6,35.4-79.9a6.2,6.2,0,0,0,2.4-3.5l13.3-56.7a17.4,17.4,0,0,1,7.5,4.2c5,4.8,7.6,12.9,7.6,24.1a6,6,0,0,0,2.7,5,6.06,6.06,0,0,0,5.7.4c.4-.2,40.4-17.8,77.7,5.7,6.8,11.9,29.9,23.5,43.5,28.3a4.67,4.67,0,0,0,1.7.3c39.8,1.7,54.6,31.2,59.1,43.9,5.1,14.3,4.2,25.7,2.1,30.1h-34.2l-38.4-7.3a5.9,5.9,0,1,0-2.2,11.6l33,6.3a19.53,19.53,0,0,1-10.7,11.8c-8.2,3.6-18.8,2-27-4-21.7-16-47-1.1-48.2-.3-.8.5-36.2,20.9-55.6.9a5.94,5.94,0,1,0-8.5,8.3c9.1,9.3,20.1,12.4,30.8,12.4,15,0,29.2-6.1,35.7-9.4,17.7,14.6,107.1,90.8,111.7,139C335,397.15,308.68,410.05,304,412ZM76.78,513.35h221v28.9h-221Zm-4.7-89.5h230.4c9.9,10.9,16.3,20.5,17.7,33.2,3.5,32.1-13.6,42.5-17.7,44.5H72.08c-4.1-2-21.2-12.3-17.7-44.5C55.68,444.25,62.08,434.65,72.08,423.85Zm-56.4-106.1c30.6-17.8,30.8-42.3,28.3-85.1-.2-4.2-.6-8.8-.9-13.8-3.5-49.6-9.4-132.6,45.6-175.1,59.9-46.3,126.8-30.1,135.7-25.7,3.1,3.8,6.1,24,7.8,35,.6,3.7,1,7,1.5,9.8-29.1-13.5-57.2-7.8-70.5-3.7-1.2-10.6-4.9-18.9-11-24.6a29.58,29.58,0,0,0-20.4-7.8,6,6,0,0,0-5.4,4.6l-14,59.7c-8.5,6.8-42.3,36.9-38.5,89,2.1,28.6,12.7,52.4,22.1,73.4,9.3,20.8,17.4,38.7,15.5,56.8-3,29.2-30,54.9-40.3,63.8Z"/></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

1
assets/knight_white.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 357.79 554.14"><defs><style>.a{fill:#fff;}</style></defs><title>knight_white</title><path class="a" d="M55.41,423.94c-9.9,10.9-16.3,20.5-17.7,33.2-3.5,32.1,13.6,42.5,17.7,44.5h230.4c4.1-2,21.2-12.3,17.7-44.5-1.4-12.8-7.8-22.4-17.7-33.2Z"/><path class="a" d="M313.81,232.74c.2-4.2.6-8.8.9-13.8,3.5-49.6,9.4-132.6-45.6-175.1-59.9-46.3-126.8-30.1-135.7-25.7-3.1,3.8-6.1,24-7.8,35-.6,3.7-1,7-1.5,9.8,29.1-13.5,57.2-7.8,70.5-3.7,1.2-10.6,4.9-18.9,11-24.6a29.58,29.58,0,0,1,20.4-7.8,6,6,0,0,1,5.4,4.6l14,59.7c8.5,6.8,42.3,36.9,38.5,89-2.1,28.6-12.7,52.4-22.1,73.4-9.3,20.8-17.4,38.7-15.5,56.8,3,29.2,30,54.9,40.3,63.8l55.5-56.3C311.51,300,311.31,275.54,313.81,232.74Z"/><rect class="a" x="60.11" y="513.44" width="221" height="28.9"/><path class="a" d="M284.51,412c6.6-16.7-.4-24.4-1.3-25.4-4-3.1-44.5-35.3-48.6-75.1-2.2-21.2,6.9-41.4,16.5-62.9,9.4-21.1,19.2-42.8,21.1-69.4,3.7-51.6-35-79.6-35.4-79.9a6.2,6.2,0,0,1-2.4-3.5l-13.3-56.7a17.4,17.4,0,0,0-7.5,4.2c-5,4.8-7.6,12.9-7.6,24.1a6,6,0,0,1-2.7,5,6.06,6.06,0,0,1-5.7.4c-.4-.2-40.4-17.8-77.7,5.7-6.8,11.9-29.9,23.5-43.5,28.3a4.67,4.67,0,0,1-1.7.3c-39.8,1.7-54.6,31.2-59.1,43.9-5.1,14.3-4.2,25.7-2.1,30.1h34.2l38.4-7.3a5.9,5.9,0,0,1,2.2,11.6l-33,6.3A19.53,19.53,0,0,0,66,203.54c8.2,3.6,18.8,2,27-4,21.7-16,47-1.1,48.2-.3.8.5,36.2,20.9,55.6.9a5.94,5.94,0,1,1,8.5,8.3c-9.1,9.3-20.1,12.4-30.8,12.4-15,0-29.2-6.1-35.7-9.4-17.7,14.6-107.1,90.8-111.7,139-4.5,46.8,21.8,59.7,26.5,61.6Z"/><path d="M354.51,311c-29.9-14.4-31.6-30.7-28.9-77.6.2-4.2.6-8.7.9-13.6,3.7-52,9.8-138.9-50.2-185.3C209.81-17,136.21,3,127.41,7.84c-6.9,3.8-9.5,16.8-13.5,43.5-1.3,8.4-2.7,18-3.9,20.8-2.7,6.3-20.4,17.5-36.7,23.3-32.2,1.7-57.9,21-68.8,51.7-6.8,19-5.8,37.3,2.2,44.4a5.78,5.78,0,0,0,3.9,1.5h32.8a31.32,31.32,0,0,0,18,21.4c12.2,5.3,27.1,3.3,38.8-5.3,9.2-6.8,19.8-5.5,26.9-3.2-25.6,21.5-106.8,93.3-111.6,143.4-4.2,44.4,15.9,63.3,27.6,70.5-9.4,11-15.8,21.8-17.3,36-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9H287a5.91,5.91,0,0,0,5.9-5.9v-37.1c8.2-4.7,26.3-19.4,22.4-55.3-1.7-15.5-9.1-27-20-39,6.8-16.9,3.1-28.2-.5-34.2l61.3-62.2a6.2,6.2,0,0,0,1.6-5.2A5.5,5.5,0,0,0,354.51,311Zm-327.2,39.4c4.6-48.2,94-124.4,111.7-139,6.5,3.3,20.7,9.4,35.7,9.4,10.6,0,21.7-3.1,30.8-12.4a5.94,5.94,0,1,0-8.5-8.3c-19.4,20-54.8-.5-55.6-.9-1.3-.8-26.5-15.7-48.2.3-8.2,6.1-18.8,7.6-27,4a19.24,19.24,0,0,1-10.7-11.8l33-6.3a5.9,5.9,0,0,0-2.2-11.6l-38.4,7.3H13.71c-2.1-4.4-3-15.8,2.1-30.1,4.5-12.6,19.2-42.2,59.1-43.9a5.08,5.08,0,0,0,1.7-.3c13.6-4.7,36.7-16.4,43.5-28.3,37.3-23.5,77.3-5.9,77.7-5.7a6.08,6.08,0,0,0,5.7-.4,6,6,0,0,0,2.7-5c0-11.2,2.5-19.3,7.6-24.1a17.4,17.4,0,0,1,7.5-4.2L234.41,96a5.75,5.75,0,0,0,2.4,3.5c.4.3,39.2,28.2,35.4,79.9-1.9,26.5-11.7,48.3-21.1,69.4-9.6,21.4-18.7,41.6-16.5,62.9,4.1,39.9,44.6,72,48.6,75.1,1,1,7.9,8.7,1.3,25.4H53.81C49.11,410.14,22.91,397.24,27.31,350.44Zm253.8,192h-221v-28.9h221Zm22.4-85.3c3.5,32.1-13.6,42.5-17.7,44.5H55.41c-4.1-2-21.2-12.3-17.7-44.5,1.4-12.8,7.8-22.4,17.7-33.2h230.4C295.71,434.74,302.11,444.34,303.51,457.14Zm-16.9-83c-10.3-8.9-37.3-34.6-40.3-63.8-1.9-18,6.2-36,15.5-56.8,9.4-21,20.1-44.7,22.1-73.4,3.8-52-30-82.2-38.5-89l-14-59.7a6.07,6.07,0,0,0-5.4-4.6,29,29,0,0,0-20.4,7.8c-6.1,5.7-9.8,13.9-11,24.6-13.3-4.2-41.4-9.8-70.5,3.7.5-2.9,1-6.2,1.5-9.8,1.6-11,4.7-31.2,7.8-35,8.9-4.4,75.8-20.6,135.7,25.7,55,42.5,49.2,125.5,45.6,175.1q-.6,7.5-.9,13.8c-2.4,42.8-2.3,67.3,28.3,85.1Z"/></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

1
assets/pawn_black.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.59 520.9"><defs><style>.a{fill:#fff;}</style></defs><title>pawn_black</title><rect x="34.75" y="480.2" width="221" height="28.9"/><path d="M71.55,180.2h0c.4-.8.7-1.6,1.1-2.4.1-.1.1-.2.2-.4.6-1.3,1.2-2.6,1.9-3.9.2-.4.4-.8.7-1.3s.6-1.1.9-1.7l1.2-2.1c.3-.5.6-1,.9-1.6.5-.9,1.1-1.7,1.6-2.6.2-.4.5-.7.7-1.1.7-1.1,1.5-2.2,2.3-3.4h133.4c.8,1.1,1.5,2.3,2.3,3.4.2.4.5.7.7,1.1.6.9,1.1,1.7,1.6,2.6l.9,1.5c.4.7.8,1.4,1.2,2.2.3.6.6,1.1.9,1.7.2.4.4.8.7,1.3.7,1.3,1.3,2.6,1.9,3.9.1.1.1.2.2.4.4.8.7,1.6,1.1,2.4h0a73.65,73.65,0,0,1,5.4,19.1H66.15A66.55,66.55,0,0,1,71.55,180.2Z"/><path d="M82.85,148a84.5,84.5,0,1,1,133.8,0Z"/><path d="M204.35,250.7H92.25c-4.5-2.8-20.8-14.1-25.3-33.9a54.34,54.34,0,0,1-.9-5.6h167.4a50.3,50.3,0,0,1-.9,5.6c-4.5,19.8-20.8,31.1-25.3,33.9Z"/><path d="M39.65,380.7c22.7-23.2,50.8-51.8,52.4-118.1h106.5c1.6,66.2,29.7,94.9,52.4,118.1,14.2,14.5,25.4,26,27.3,43.2,3.5,32.2-13.7,42.5-17.7,44.5H30.15c-4.1-2-21.2-12.3-17.7-44.5C14.15,406.6,25.45,395.2,39.65,380.7Z"/><path class="a" d="M.55,422.6c-3.9,36,14.1,50.6,22.4,55.3V515a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V477.9c8.2-4.7,26.3-19.4,22.4-55.3-2.3-21.3-16.1-35.4-30.6-50.2-22.3-22.8-47.5-48.5-49-110a6.94,6.94,0,0,0,1.3-.5c1.1-.6,25.9-14,32.4-42.2,3.2-13.9,1.4-28.8-5.4-44.5a.1.1,0,0,0-.1-.1l-1.5-3.3c-.1-.2-.2-.3-.3-.5-1.4-2.9-2.9-5.7-4.6-8.6-.4-.7-.8-1.4-1.3-2.2-.4-.6-.7-1.2-1.1-1.8-.6-.9-1.1-1.8-1.7-2.6a7.1,7.1,0,0,0-1-1.4c-.1-.2-.2-.3-.3-.5a96.4,96.4,0,1,0-154.4,0c-.1.2-.2.3-.3.5a8.64,8.64,0,0,0-1,1.6c-.6.8-1.1,1.7-1.6,2.5-.4.6-.8,1.3-1.2,1.9l-1.2,2.1c-1.7,2.9-3.3,5.8-4.7,8.7-.1.2-.2.3-.2.5l-1.5,3.3v.1c-6.8,15.6-8.6,30.5-5.4,44.5,4.3,18.7,16.6,30.9,24.8,37.1,0,65.5-26.1,92.1-49.1,115.6C16.65,387.2,2.85,401.3.55,422.6ZM216.65,148H82.85a84.5,84.5,0,1,1,133.8,0Zm16.7,51.4H66.15a69,69,0,0,1,5.4-19.1h0a25.57,25.57,0,0,1,1.1-2.4c.1-.1.1-.2.2-.4.6-1.3,1.2-2.6,1.9-3.9.2-.4.4-.8.7-1.3s.6-1.1.9-1.7l1.2-2.1c.3-.5.6-1,.9-1.6.5-.9,1.1-1.7,1.6-2.6.2-.4.5-.7.7-1.1.7-1.1,1.5-2.2,2.3-3.4h133.4c.8,1.1,1.5,2.3,2.3,3.4.2.4.5.7.7,1.1.6.9,1.1,1.7,1.6,2.6l.9,1.5c.4.7.8,1.4,1.2,2.2.3.6.6,1.1.9,1.7.2.4.4.8.7,1.3.7,1.3,1.3,2.6,1.9,3.9.1.1.1.2.2.4.4.8.7,1.6,1.1,2.4h0A71.53,71.53,0,0,1,233.35,199.4Zm-26.1,51.3h-115c-4.5-2.8-20.8-14.1-25.3-33.9a54.34,54.34,0,0,1-.9-5.6h167.4a50.3,50.3,0,0,1-.9,5.6C228.05,236.7,211.75,247.9,207.25,250.7ZM34.75,480.2h221v28.9h-221Zm-22.4-56.3c1.9-17.3,13.1-28.7,27.3-43.2,22.7-23.2,50.8-51.8,52.4-118.1h106.5c1.6,66.2,29.7,94.9,52.4,118.1,14.2,14.5,25.4,26,27.3,43.2,3.5,32.2-13.7,42.5-17.7,44.5H30.15C26,466.4,8.85,456,12.35,423.9Z"/></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

1
assets/pawn_white.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.59 521.1"><defs><style>.a{fill:#fff;}</style></defs><title>pawn_white</title><rect class="a" x="34.75" y="480.4" width="221" height="28.9"/><path class="a" d="M219,180.4h0c-.4-.8-.7-1.6-1.1-2.4-.1-.1-.1-.2-.2-.4-.6-1.3-1.2-2.6-1.9-3.9-.2-.4-.4-.8-.7-1.3s-.6-1.1-.9-1.7l-1.2-2.1c-.3-.5-.6-1-.9-1.6-.5-.9-1.1-1.7-1.6-2.6-.2-.4-.5-.7-.7-1.1-.7-1.1-1.5-2.2-2.3-3.4H74.05c-.8,1.1-1.5,2.3-2.3,3.4-.2.4-.5.7-.7,1.1-.6.9-1.1,1.7-1.6,2.6l-.9,1.5c-.4.7-.8,1.4-1.2,2.2-.3.6-.6,1.1-.9,1.7-.2.4-.4.8-.7,1.3-.7,1.3-1.3,2.6-1.9,3.9-.1.1-.1.2-.2.4-.4.8-.7,1.6-1.1,2.4h0a73.65,73.65,0,0,0-5.4,19.1h167.2A73.65,73.65,0,0,0,219,180.4Z"/><path class="a" d="M207.65,148.2a84.5,84.5,0,1,0-133.8,0Z"/><path class="a" d="M86.15,250.9h112.1c4.5-2.8,20.8-14.1,25.3-33.9a54.34,54.34,0,0,0,.9-5.6H57.05A50.3,50.3,0,0,0,58,217c4.5,19.8,20.8,31.1,25.3,33.9Z"/><path class="a" d="M250.85,380.9c-22.7-23.2-50.8-51.8-52.4-118.1H92c-1.6,66.2-29.7,94.9-52.4,118.1-14.2,14.5-25.4,26-27.3,43.2C8.75,456.3,26,466.6,30,468.6h230.4c4.1-2,21.2-12.3,17.7-44.5C276.25,406.8,265.05,395.4,250.85,380.9Z"/><path d="M259.35,372.6c-23-23.5-49-50-49.1-115.6,8.2-6.3,20.5-18.5,24.8-37.1,3.2-13.9,1.4-28.8-5.4-44.5v-.1l-1.5-3.3c-.1-.2-.2-.3-.2-.5a92.66,92.66,0,0,0-4.7-8.7l-1.2-2.1c-.4-.6-.8-1.3-1.2-1.9-.5-.8-1.1-1.7-1.6-2.5-.3-.5-.7-1-1-1.6-.1-.2-.2-.3-.3-.5a96.4,96.4,0,1,0-154.4,0c-.1.2-.2.3-.3.5a7.1,7.1,0,0,1-1,1.4c-.6.9-1.2,1.8-1.7,2.6a17.39,17.39,0,0,0-1.1,1.8c-.4.7-.9,1.4-1.3,2.2-1.7,2.9-3.2,5.8-4.6,8.6-.1.2-.2.3-.3.5l-1.5,3.3a.1.1,0,0,1-.1.1c-6.8,15.6-8.6,30.5-5.4,44.5,6.6,28.2,31.4,41.7,32.4,42.2a5,5,0,0,0,1.3.5c-1.5,61.5-26.7,87.2-49,110-14.4,15-28.1,29.1-30.4,50.4-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V478.1c8.2-4.7,26.3-19.4,22.4-55.3C287.65,401.5,273.85,387.4,259.35,372.6ZM56.25,96.5a84.5,84.5,0,1,1,151.4,51.7H73.85A84.56,84.56,0,0,1,56.25,96.5Zm6.3,83.9h0a25.57,25.57,0,0,1,1.1-2.4c.1-.1.1-.2.2-.4.6-1.3,1.2-2.6,1.9-3.9.2-.4.4-.8.7-1.3s.6-1.1.9-1.7.8-1.4,1.2-2.2l.9-1.5c.5-.9,1.1-1.7,1.6-2.6.2-.4.5-.7.7-1.1.7-1.1,1.5-2.2,2.3-3.4h133.4c.8,1.1,1.5,2.3,2.3,3.4.2.4.5.7.7,1.1.6.9,1.1,1.7,1.6,2.6.3.5.6,1.1.9,1.6l1.2,2.1c.3.6.6,1.1.9,1.7.2.4.4.8.7,1.3.7,1.3,1.3,2.6,1.9,3.9.1.1.1.2.2.4.4.8.7,1.6,1.1,2.4h0a73.65,73.65,0,0,1,5.4,19.1H57.15A73.65,73.65,0,0,1,62.55,180.4ZM58,217.1a54.34,54.34,0,0,1-.9-5.6h167.4a50.3,50.3,0,0,1-.9,5.6c-4.5,19.8-20.8,31.1-25.3,33.9h-115C78.75,248.1,62.45,236.9,58,217.1Zm197.8,292.3h-221V480.5h221Zm4.7-40.8H30.05c-4-1.9-21.2-12.3-17.7-44.5,1.9-17.3,13.1-28.7,27.3-43.2,22.7-23.2,50.8-51.8,52.4-118.1h106.5c1.6,66.2,29.7,94.9,52.4,118.1,14.2,14.5,25.4,26,27.3,43.2C281.65,456.2,264.55,466.6,260.45,468.6Z"/></svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

1
assets/queen_black.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.59 660.4"><defs><style>.a{fill:#fff;}</style></defs><title>queen_black</title><path d="M66.25,299.1h158.1c-5.6,13.4-19,21.1-22.9,23.1H89.15C85.35,320.2,72,312.5,66.25,299.1Z"/><path d="M42.85,498.4c26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65,3.5,32.2-13.7,42.5-17.7,44.5H30.05c-4.1-2-21.2-12.3-17.7-44.5C14.25,545.9,27.55,523.9,42.85,498.4Z"/><path d="M34.35,287.3c1.9-13.8,9.5-28.8,22.6-44.5h176.5c13.2,15.8,20.8,30.7,22.6,44.5H34.35Z"/><path d="M81.45,230.9c-1.8-17.1-9.8-68.9-41.3-103.6a84.68,84.68,0,0,1,17.5-2.1h1.1c16.7.1,29,6.3,36.4,18.3a5.81,5.81,0,0,0,4.8,2.8,6,6,0,0,0,5-2.3c.2-.2,18.7-24.4,40.4-27.2,21.6,2.8,40.2,26.9,40.4,27.2a5.84,5.84,0,0,0,5,2.3,6,6,0,0,0,4.8-2.8c7.4-12,19.7-18.2,36.4-18.3h1.1a78.35,78.35,0,0,1,17.5,2.1c-31.5,34.7-39.5,86.5-41.3,103.6Z"/><path d="M190.05,130.9c-8-8.6-24.5-23.8-44.1-25.9h-1.3c-19.6,2.1-36.1,17.3-44.1,25.9-8.5-9.9-20.4-15.8-35.1-17.2,3-12.6,12.6-40.9,40-53.8a43.08,43.08,0,0,0,79.6,0c27.5,13,37,41.2,40,53.8C210.45,115.1,198.55,121,190.05,130.9Z"/><path d="M145.25,74.6a31.3,31.3,0,1,1,31.3-31.3A31.28,31.28,0,0,1,145.25,74.6Z"/><rect x="34.75" y="619.7" width="221" height="28.9"/><path class="a" d="M.55,562.1c-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V617.4c8.2-4.7,26.3-19.4,22.4-55.3-2.2-20.1-16.1-43.2-32.1-69.8-25.2-41.8-56.4-93.6-58.2-158.3h3.1a6.44,6.44,0,0,0,2.4-.5c1.1-.5,24.8-11.3,31.7-34.4h25.7a5.6,5.6,0,0,0,4.2-1.8,6.07,6.07,0,0,0,1.7-4.2c-.3-18.9-9.6-39.2-27.7-60.2a6,6,0,0,0-4.5-2.1h-15.2c2.2-18.2,11.2-71.8,44.6-102.2a5.93,5.93,0,0,0-1.9-9.9,96.89,96.89,0,0,0-26.6-5.3c-2.7-13.5-13.2-49.7-49.1-65.3a39.08,39.08,0,0,0,.3-4.9,43.2,43.2,0,1,0-86.4,0,40.28,40.28,0,0,0,.3,4.9c-35.9,15.6-46.3,51.8-49.1,65.3a96.89,96.89,0,0,0-26.6,5.3,5.93,5.93,0,0,0-1.9,9.9c33.4,30.4,42.5,84,44.6,102.2H54.25a5.68,5.68,0,0,0-4.5,2.1c-18.1,21-27.5,41.3-27.7,60.2a5.89,5.89,0,0,0,1.7,4.2,6,6,0,0,0,4.2,1.8h25.7c6.8,23.1,30.6,33.9,31.7,34.4a6.87,6.87,0,0,0,2.4.5h3.1c-1.8,64.7-33,116.5-58.2,158.3C16.65,519,2.75,542,.55,562.1ZM176.65,43.3A31.3,31.3,0,1,1,145.35,12,31.28,31.28,0,0,1,176.65,43.3Zm48.5,70.4c-14.7,1.4-26.6,7.3-35.1,17.2-8-8.6-24.5-23.8-44.1-25.9h-1.3c-19.6,2.1-36.1,17.3-44.1,25.9-8.5-9.9-20.4-15.8-35.1-17.2,3-12.6,12.6-40.9,40-53.8a43.08,43.08,0,0,0,79.6,0C212.65,72.9,222.15,101.1,225.15,113.7Zm-16,117.2H81.45c-1.8-17.1-9.8-68.9-41.3-103.6a84.68,84.68,0,0,1,17.5-2.1h1.1c16.7.1,29,6.3,36.4,18.3a5.81,5.81,0,0,0,4.8,2.8,6,6,0,0,0,5-2.3c.2-.2,18.7-24.4,40.4-27.2,21.6,2.8,40.2,26.9,40.4,27.2a5.84,5.84,0,0,0,5,2.3,6,6,0,0,0,4.8-2.8c7.4-12,19.7-18.2,36.4-18.3h1.1a78.35,78.35,0,0,1,17.5,2.1C219,162,211,213.8,209.15,230.9Zm23.1,56.4H34.35c1.9-13.8,9.5-28.8,22.6-44.5h176.5c13.2,15.8,20.8,30.7,22.6,44.5ZM89.15,322.2c-3.8-2-17.2-9.7-22.9-23.1h158.1c-5.6,13.4-19,21.1-22.9,23.1ZM34.75,619.7h221v28.9h-221Zm-22.4-56.3c1.9-17.5,15.2-39.5,30.5-65,26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65,3.5,32.2-13.7,42.5-17.7,44.5H30.05C26,605.9,8.85,595.5,12.35,563.4Z"/></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

1
assets/queen_white.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.59 660.4"><defs><style>.a{fill:#fff;}</style></defs><title>queen_white</title><path class="a" d="M224.55,299.1H66.45c5.6,13.4,19,21.1,22.9,23.1h112.3C205.45,320.2,218.85,312.5,224.55,299.1Z"/><path class="a" d="M248,498.4c-26-43.1-58.1-96.4-59.9-164.4h-85c-1.8,67.9-33.9,121.3-59.9,164.4-15.4,25.5-28.6,47.5-30.5,65-3.5,32.2,13.7,42.5,17.7,44.5h230.4c4.1-2,21.2-12.3,17.7-44.5C276.55,545.9,263.25,523.9,248,498.4Z"/><path class="a" d="M256.35,287.3c-1.9-13.8-9.5-28.8-22.6-44.5H57.25c-13.2,15.8-20.8,30.7-22.6,44.5h221.7Z"/><path class="a" d="M209.35,230.9c1.8-17.1,9.8-68.9,41.3-103.6a84.68,84.68,0,0,0-17.5-2.1h-1.1c-16.7.1-29,6.3-36.4,18.3a5.81,5.81,0,0,1-4.8,2.8,6,6,0,0,1-5-2.3c-.2-.2-18.7-24.4-40.4-27.2-21.6,2.8-40.2,26.9-40.4,27.2a5.84,5.84,0,0,1-5,2.3,6,6,0,0,1-4.8-2.8c-7.4-12-19.7-18.2-36.4-18.3h-1.1a78.35,78.35,0,0,0-17.5,2.1c31.5,34.7,39.5,86.5,41.3,103.6Z"/><path class="a" d="M100.75,130.9c8-8.6,24.5-23.8,44.1-25.9h1.3c19.6,2.1,36.1,17.3,44.1,25.9,8.5-9.9,20.4-15.8,35.1-17.2-3-12.6-12.6-40.9-40-53.8a43.08,43.08,0,0,1-79.6,0c-27.5,13-37,41.2-40,53.8C80.35,115.2,92.25,121,100.75,130.9Z"/><path class="a" d="M145.45,74.6a31.3,31.3,0,1,0-31.3-31.3A31.28,31.28,0,0,0,145.45,74.6Z"/><rect class="a" x="34.95" y="619.7" width="221" height="28.9"/><path d="M258.05,492.3c-25.2-41.8-56.4-93.6-58.2-158.3H203a6.44,6.44,0,0,0,2.4-.5c1.1-.5,24.8-11.3,31.7-34.4h25.7a5.6,5.6,0,0,0,4.2-1.8,6.07,6.07,0,0,0,1.7-4.2c-.3-18.9-9.6-39.2-27.7-60.2a6,6,0,0,0-4.5-2.1h-15.2c2.2-18.2,11.2-71.8,44.6-102.2a5.93,5.93,0,0,0-1.9-9.9,96.89,96.89,0,0,0-26.6-5.3c-2.7-13.5-13.2-49.7-49.1-65.3a39.08,39.08,0,0,0,.3-4.9,43.2,43.2,0,0,0-86.4,0,40.28,40.28,0,0,0,.3,4.9c-35.9,15.6-46.3,51.8-49.1,65.3a96.89,96.89,0,0,0-26.6,5.3,5.93,5.93,0,0,0-1.9,9.9c33.4,30.4,42.5,84,44.6,102.2H54.25a5.68,5.68,0,0,0-4.5,2.1c-18.1,21-27.5,41.3-27.7,60.2a5.89,5.89,0,0,0,1.7,4.2,6,6,0,0,0,4.2,1.8h25.7c6.8,23.1,30.6,33.9,31.7,34.4a6.87,6.87,0,0,0,2.4.5h3.1c-1.8,64.7-33,116.5-58.2,158.3C16.55,519,2.65,542,.55,562.1c-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V617.4c8.2-4.7,26.3-19.4,22.4-55.3C288.05,542,274.15,519,258.05,492.3ZM145.45,12a31.3,31.3,0,1,1-31.3,31.3A31.28,31.28,0,0,1,145.45,12Zm-39.8,47.9a43.08,43.08,0,0,0,79.6,0c27.4,13,37,41.2,40,53.8-14.7,1.4-26.6,7.3-35.1,17.2-8-8.6-24.5-23.8-44.1-25.9h-1.3c-19.6,2.1-36.1,17.3-44.1,25.9-8.5-9.9-20.4-15.8-35.1-17.2C68.65,101.1,78.15,72.9,105.65,59.9Zm-65.3,67.4a84.68,84.68,0,0,1,17.5-2.1H59c16.7.1,29,6.3,36.4,18.3a5.81,5.81,0,0,0,4.8,2.8,6.11,6.11,0,0,0,5-2.3c.2-.2,18.7-24.4,40.4-27.2,21.6,2.8,40.2,26.9,40.4,27.2a5.5,5.5,0,0,0,5,2.3,6,6,0,0,0,4.8-2.8c7.4-12,19.7-18.2,36.4-18.3h1.1a78.35,78.35,0,0,1,17.5,2.1c-31.5,34.7-39.5,86.5-41.3,103.6H81.75C79.85,213.8,71.85,162,40.35,127.3Zm-5.8,160c1.9-13.8,9.5-28.8,22.6-44.5h176.5c13.2,15.8,20.8,30.7,22.6,44.5H34.55Zm54.8,34.9c-3.8-2-17.2-9.6-22.9-23.1h158.1c-5.6,13.3-19,21.1-22.9,23.1ZM256,648.7H35V619.8H256Zm4.7-40.8H30.25c-4-1.9-21.2-12.3-17.7-44.5,1.9-17.5,15.2-39.5,30.5-65,26-43.1,58.1-96.4,59.9-164.4h85c1.8,67.9,33.9,121.3,59.9,164.4,15.4,25.5,28.6,47.5,30.5,65C282,595.5,264.85,605.9,260.65,607.9Z"/></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

1
assets/rook_black.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 302.2 439.5"><defs><style>.a{fill:#fff;}</style></defs><title>rook_black</title><path d="M84.35,79.7a6,6,0,0,0,5.8,4.8h22.4a5.71,5.71,0,0,0,4.4-2,6.12,6.12,0,0,0,1.5-4.6L110.65,12h80.9l-7.8,65.9a5.53,5.53,0,0,0,1.5,4.6,5.71,5.71,0,0,0,4.4,2h22.4a5.89,5.89,0,0,0,5.8-4.8l13.4-67.8h57.4L262.05,118H40.25L13.65,11.9h57.4Z"/><polygon points="225.15 169.3 210.15 169.3 91.95 169.3 76.85 169.3 58.25 129.8 243.75 129.8 225.15 169.3"/><path d="M204.25,181.2c1.6,66.2,29.7,94.9,52.4,118.1,14.2,14.5,25.4,26,27.3,43.2,3.5,32.2-13.7,42.5-17.7,44.5H35.85c-4.1-2-21.2-12.3-17.7-44.5,1.9-17.3,13.1-28.7,27.3-43.2,22.7-23.2,50.8-51.8,52.4-118.1Z"/><rect x="40.55" y="398.8" width="221" height="28.9"/><path class="a" d="M1.25,2.3A6.14,6.14,0,0,0,.15,7.4l29.6,117.9a6,6,0,0,0,5.7,4.5h9.7l22.6,48a6,6,0,0,0,5.4,3.4H86c-1.5,61.3-26.7,87-49,109.8-14.6,14.9-28.3,28.9-30.6,50.2-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V396.5c8.2-4.7,26.3-19.4,22.4-55.3-2.3-21.3-16.1-35.4-30.6-50.2-22.3-22.8-47.5-48.5-49-109.8h12.8a6,6,0,0,0,5.4-3.4l22.6-48h9.7a5.78,5.78,0,0,0,5.7-4.5L302.05,7.4A6.22,6.22,0,0,0,301,2.3a6,6,0,0,0-4.7-2.3h-69.8a5.89,5.89,0,0,0-5.8,4.8l-13.4,67.8h-10.9l7.8-65.9a5.53,5.53,0,0,0-1.5-4.6,5.71,5.71,0,0,0-4.4-2H104a5.71,5.71,0,0,0-4.4,2,6.12,6.12,0,0,0-1.5,4.6l7.8,65.9H95L81.55,4.8A6,6,0,0,0,75.75,0H6A6.46,6.46,0,0,0,1.25,2.3Zm39.3,396.5h221v28.9h-221Zm57.2-217.6h106.5c1.6,66.2,29.7,94.9,52.4,118.1,14.2,14.5,25.4,26,27.3,43.2,3.5,32.2-13.7,42.5-17.7,44.5H35.85c-4.1-2-21.2-12.3-17.7-44.5,1.9-17.3,13.1-28.7,27.3-43.2C68.05,276.1,96.15,247.4,97.75,181.2Zm-39.5-51.4h185.5l-18.6,39.5H76.75ZM13.55,11.9H71l13.4,67.8a6,6,0,0,0,5.8,4.8h22.4a5.71,5.71,0,0,0,4.4-2,6.12,6.12,0,0,0,1.5-4.6L110.65,12h80.9l-7.8,65.9a5.53,5.53,0,0,0,1.5,4.6,5.71,5.71,0,0,0,4.4,2h22.4a5.89,5.89,0,0,0,5.8-4.8l13.4-67.8h57.4L262.05,118H40.25Z"/></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

1
assets/rook_white.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 301.9 439.5"><defs><style>.a{fill:#fff;}</style></defs><title>rook_white</title><path class="a" d="M217.65,79.7a6,6,0,0,1-5.8,4.8h-22.4a5.71,5.71,0,0,1-4.4-2,6.12,6.12,0,0,1-1.5-4.6l7.8-65.9h-80.9l7.8,65.9a5.53,5.53,0,0,1-1.5,4.6,5.71,5.71,0,0,1-4.4,2H90a5.89,5.89,0,0,1-5.8-4.8L70.75,11.9H13.35L40,118h221.8l26.6-106.1H231Z"/><polygon class="a" points="76.75 169.3 91.85 169.3 210.05 169.3 225.15 169.3 243.75 129.8 58.15 129.8 76.75 169.3"/><path class="a" d="M97.65,181.2c-1.6,66.2-29.7,94.9-52.4,118.1-14.2,14.5-25.4,26-27.3,43.2-3.5,32.2,13.7,42.5,17.7,44.5h230.4c4.1-2,21.2-12.3,17.7-44.5-1.9-17.3-13.1-28.7-27.3-43.2-22.7-23.2-50.8-51.8-52.4-118.1Z"/><rect class="a" x="40.45" y="398.8" width="221" height="28.9"/><path d="M296.05.1h-69.8a5.89,5.89,0,0,0-5.8,4.8L207,72.6h-10.9l7.8-65.9a5.53,5.53,0,0,0-1.5-4.6,5.71,5.71,0,0,0-4.4-2h-94.3a5.71,5.71,0,0,0-4.4,2,6.12,6.12,0,0,0-1.5,4.6l7.8,65.9H95L81.55,4.8A6,6,0,0,0,75.75,0H6a6,6,0,0,0-4.7,2.3A6.14,6.14,0,0,0,.15,7.4l29.6,117.9a6,6,0,0,0,5.7,4.5h9.7l22.6,48a6,6,0,0,0,5.4,3.4H86c-1.5,61.3-26.7,87-49,109.8-14.6,14.9-28.3,28.9-30.6,50.2-3.9,36,14.1,50.6,22.4,55.3v37.1a5.91,5.91,0,0,0,5.9,5.9h232.9a5.91,5.91,0,0,0,5.9-5.9V396.5c8.2-4.7,26.3-19.4,22.4-55.3-2.3-21.3-16.1-35.4-30.6-50.2-22.3-22.8-47.5-48.5-49-109.8h12.8a6,6,0,0,0,5.4-3.4l22.6-48h9.7a5.78,5.78,0,0,0,5.7-4.5L301.75,7.4a6.22,6.22,0,0,0-1.1-5.1A5.83,5.83,0,0,0,296.05.1Zm-34.6,427.7h-221V398.9h221Zm-4.9-128.5c14.2,14.5,25.4,26,27.3,43.2,3.5,32.1-13.6,42.5-17.7,44.5H35.75c-4-1.9-21.2-12.3-17.7-44.5,1.9-17.3,13.1-28.7,27.3-43.2,22.7-23.2,50.8-51.8,52.4-118.1h106.5C205.75,247.4,233.85,276.1,256.55,299.3Zm-31.4-130H76.75l-18.6-39.5h185.5Zm36.7-51.3H40.05L13.45,11.9h57.4l13.4,67.8a6,6,0,0,0,5.8,4.8h22.4a5.71,5.71,0,0,0,4.4-2,6.12,6.12,0,0,0,1.5-4.6L110.55,12h80.9l-7.8,65.9a5.53,5.53,0,0,0,1.5,4.6,5.71,5.71,0,0,0,4.4,2H212a5.89,5.89,0,0,0,5.8-4.8l13.4-67.8h57.4Z"/></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

14
index.html Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chess.js</title>
<link href="style.css" rel="stylesheet"/>
</head>
<body>
<div id="game-container"></div>
<script src="main.js"></script>
</body>
</html>

578
main.js Normal file
View File

@@ -0,0 +1,578 @@
HTMLElement.prototype.addChild = function (tagName, classList) {
const el = document.createElement(tagName);
if (typeof classList === 'string') {
classList = [classList];
}
el.classList.add(...classList);
this.appendChild(el);
return el;
};
const container = document.getElementById('game-container');
const figuresContainer = container.addChild('div', 'figures');
const deadFiguresContainers = {
black: container.addChild('div', ['dead-figures', 'black']),
white: container.addChild('div', ['dead-figures', 'white']),
};
const board = [];
const figures = [];
let currentPlayer = 'w';
let castlings = {
w: {
short: true,
long: true,
},
b: {
short: true,
long: true,
},
};
let enpassant = null;
let halfTurns = 0;
let turn = 1;
let selectedFigure;
class Field {
constructor(x, y, el) {
this.element = el;
this.x = x;
this.y = y;
if ((x % 2 === 0 && y % 2 === 0) || (x % 2 !== 0 && y % 2 !== 0)) {
this.color = 'w';
} else {
this.color = 'b';
}
this.element.classList.add(this.color === 'w' ? 'white' : 'black');
this.element.addEventListener('click', () => {
const figure = figures.find(figure => figure.color === currentPlayer && figure.x === this.x && figure.y === this.y);
if (!!selectedFigure) {
selectedFigure.deselectFigure();
}
if (!!figure) {
figure.selectFigure();
}
return false;
});
this.element.addEventListener('contextmenu', (e) => {
e.preventDefault();
if (!!selectedFigure) {
selectedFigure.moveTo(this.x, this.y);
}
return false;
});
this.isFocused = false;
}
setFocus(isFocused) {
if (this.isFocused === isFocused)
return;
this.isFocused = isFocused;
if (isFocused) {
this.element.classList.add('possible-target');
} else {
this.element.classList.remove('possible-target');
}
}
}
class Figure {
constructor(x, y, color, name, char) {
this.element = figuresContainer.addChild('div', ['figure', color === 'b' ? 'black' : 'white', name]);
this.element.style.transform = `translate(${x * 100}%, ${y * 100}%)`;
this.hasMoved = false;
this.x = x;
this.y = y;
this.color = color;
this.char = char;
}
destroy() {
const index = figures.findIndex(figure => figure === this);
figures.splice(index, 1);
this.element.parentNode.removeChild(this.element);
this.element.style.transform = 'none';
if (this.color === 'b') {
deadFiguresContainers.black.appendChild(this.element);
} else {
deadFiguresContainers.white.appendChild(this.element);
}
}
getMoveSet() {
return [];
}
getMoves(moveX, moveY, x, y) {
if (x < 0 || x >= 8 || y < 0 || y >= 8)
return [];
const moves = [];
let stepX = moveX,
stepY = moveY,
repeatX = false,
repeatY = false;
if (typeof moveX === 'string') {
stepX = parseInt(moveX.split('*')[0]);
repeatX = true;
}
if (typeof moveY === 'string') {
stepY = parseInt(moveY.split('*')[0]);
repeatY = true;
}
x += stepX;
y += stepY;
if (x < 0 || x >= 8 || y < 0 || y >= 8)
return [];
const figure = figures.find(figure => figure.color === this.color && figure.x === x && figure.y === y);
if (!!figure)
return [];
moves.push([x, y]);
if (repeatX || repeatY) {
moves.push(...this.getMoves(moveX, moveY, x, y));
}
return moves;
}
getPossibleTargets() {
const moveSet = this.getMoveSet();
const targets = [];
moveSet.forEach(move => {
const moved = this.getMoves(move[0], move[1], this.x, this.y);
targets.push(...moved.map(move => board[move[0]][move[1]]));
});
return targets;
}
moveTo(x, y) {
this.deselectFigure();
const targets = this.getPossibleTargets();
if (!targets.includes(board[x][y])) {
return;
}
if (checkKing(this.color)) {
return;
}
const figure = figures.find(figure => figure.x === x && figure.y === y);
if (!!figure) {
if (figure.color === this.color) {
return;
} else {
figure.destroy();
}
}
if (!this.hasMoved) {
this.hasMoved = true;
}
this.x = x;
this.y = y;
this.element.style.transform = `translate(${this.x * 100}%, ${this.y * 100}%)`;
switchSides();
}
selectFigure() {
if (!!selectedFigure)
selectedFigure.deselectFigure();
selectedFigure = this;
const targets = this.getPossibleTargets();
targets.forEach(target => {
target.setFocus(true);
});
container.classList.add('focused');
}
deselectFigure() {
selectedFigure = null;
const targets = this.getPossibleTargets();
targets.forEach(target => {
target.setFocus(false);
});
container.classList.remove('focused');
}
getExportChar() {
if (this.color === 'w') {
return this.char.toUpperCase();
} else {
return this.char.toLowerCase();
}
}
static deselectAll() {
selectedFigure = null;
board.forEach(col => {
col.forEach(field => {
field.setFocus(false);
});
});
}
}
class Pawn extends Figure {
constructor(x, y, color) {
super(x, y, color, 'pawn', 'p');
}
getMoveSet() {
let moves = [];
if (this.color === 'b') {
moves.push([0, 1, true]);
if (!this.hasMoved) {
moves.push([0, 2, true]);
}
moves.push([1, 1, false]);
moves.push([-1, 1, false]);
} else {
moves.push([0, -1, true]);
if (!this.hasMoved) {
moves.push([0, -2, true]);
}
moves.push([1, -1, false]);
moves.push([-1, -1, false]);
}
for (let i = 0; i < moves.length; i++) {
const move = moves[i];
const figure = getFigure(this.x + move[0], this.y + move[1]);
if ((move[2] && !!figure) || (!move[2] && !figure)) {
moves.splice(i, 1);
i--;
}
}
moves = moves.map(move => [move[0], move[1]]);
return moves;
}
moveTo(x, y) {
super.moveTo(x, y);
if (this.color === 'w' && this.y === 0) {
this.destroy();
// TODO: Add new figure
} else if (this.color === 'b' && this.y === 7) {
this.destroy();
// TODO: Add new figure
}
}
}
class Rook extends Figure {
constructor(x, y, color) {
super(x, y, color, 'rook', 'r');
}
getMoveSet() {
return [
[0, '1*'],
['1*', 0],
[0, '-1*'],
['-1*', 0],
];
}
}
class Knight extends Figure {
constructor(x, y, color) {
super(x, y, color, 'knight', 'n');
}
getMoveSet() {
return [
[2, 1],
[2, -1],
[1, 2],
[-1, 2],
[-2, 1],
[-2, -1],
[1, -2],
[-1, -2],
];
}
}
class Bishop extends Figure {
constructor(x, y, color) {
super(x, y, color, 'bishop', 'b');
}
getMoveSet() {
return [
['1*', '1*'],
['-1*', '1*'],
['-1*', '-1*'],
['1*', '-1*'],
];
}
}
class Queen extends Figure {
constructor(x, y, color) {
super(x, y, color, 'queen', 'q');
}
getMoveSet() {
return [
['1*', 0],
['-1*', 0],
['1*', '1*'],
['-1*', '1*'],
['-1*', '-1*'],
['1*', '-1*'],
[0, '1*'],
[0, '-1*'],
];
}
}
class King extends Figure {
constructor(x, y, color) {
super(x, y, color, 'king', 'k');
}
getMoveSet() {
return [
[-1, 0],
[-1, -1],
[0, -1],
[1, -1],
[1, 0],
[1, 1],
[0, 1],
[-1, 1],
];
}
}
function createBoard() {
const boardEl = container.addChild('div', 'board');
for (let x = 0; x < 8; x++) {
board.push([]);
const colEl = boardEl.addChild('div', 'col');
for (let y = 0; y < 8; y++) {
const element = colEl.addChild('div', 'field');
const field = new Field(x, y, element);
board[x].push(field);
}
}
}
function createFigures(color) {
for (let i = 0; i < 8; i++) {
figures.push(new Pawn(i, color === 'b' ? 1 : 6, color));
}
figures.push(new Rook(0, color === 'b' ? 0 : 7, color));
figures.push(new Knight(1, color === 'b' ? 0 : 7, color));
figures.push(new Bishop(2, color === 'b' ? 0 : 7, color));
figures.push(new Queen(3, color === 'b' ? 0 : 7, color));
figures.push(new King(4, color === 'b' ? 0 : 7, color));
figures.push(new Bishop(5, color === 'b' ? 0 : 7, color));
figures.push(new Knight(6, color === 'b' ? 0 : 7, color));
figures.push(new Rook(7, color === 'b' ? 0 : 7, color));
}
function getFigure(x, y) {
return figures.find(figure => figure.x === x && figure.y === y);
}
function checkKing(color) {
const king = figures.find(figure => figure instanceof King && figure.color === color);
let isChecked = false;
figures.forEach(figure => {
if (figure.color === color)
return;
const possibleMoves = figure.getPossibleTargets();
possibleMoves.forEach(move => {
if (move[0] === king.x && move[1] === king.y) {
isChecked = true;
return false;
}
});
if (isChecked)
return false;
});
return isChecked;
}
function switchSides() {
currentPlayer = currentPlayer === 'b' ? 'w' : 'b';
if (currentPlayer === 'b') {
container.classList.add('black-turn');
} else {
container.classList.remove('black-turn');
turn++;
}
}
function exportGame() {
let exportedGame = '';
for (let y = 0; y < 8; y++) {
let emptyCount = 0;
for (let x = 0; x < 8; x++) {
const figure = getFigure(x, y);
if (!!figure) {
if (emptyCount > 0) {
exportedGame += emptyCount;
emptyCount = 0;
}
exportedGame += figure.getExportChar();
} else {
emptyCount++;
}
}
if (emptyCount > 0) {
exportedGame += emptyCount;
}
if (y !== 7) {
exportedGame += '/';
}
}
exportedGame += ` ${currentPlayer} `;
let castling = false;
if (castlings.w.short) {
exportedGame += 'K';
castling = true;
}
if (castlings.w.long) {
exportedGame += 'Q';
castling = true;
}
if (castlings.b.short) {
exportedGame += 'k';
castling = true;
}
if (castlings.b.long) {
exportedGame += 'q';
castling = true;
}
if (!castling) {
exportedGame += '-';
}
exportedGame += ` ${!!enpassant ? coordinatesToString(enpassant) : '-'} ${halfTurns} ${turn}`;
return exportedGame;
}
const letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
function coordinatesToString(coordinates) {
return letters[coordinates[0]] + (8 - coordinates[1]);
}
function stringToCoordinates() {
}
const figuresTable = {
p: Pawn,
r: Rook,
n: Knight,
b: Bishop,
q: Queen,
k: King,
};
function importGame(string) {
const groups = string.split(' ');
const rows = groups[0].split('/');
if (rows.length !== 8)
return false;
rows.forEach((row, y) => {
let len = 0;
for (let x = 0; x < row.length; x++) {
const char = row.charAt(x);
if (char.isNumber()) {
len += parseInt(char);
} else {
const figureType = figuresTable[char.toLowerCase()];
console.log(char, figureType);
const figure = new figureType(x, y, char.isUpperCase() ? 'w' : 'b');
figures.push(figure);
len++;
}
}
if(len !== 8) {
return false;
}
});
}
function isDefiniteTurn() {
}
String.prototype.isNumber = function () {
return !isNaN(parseInt(this), 10);
};
String.prototype.isUpperCase = function () {
return this.toString() === this.toUpperCase();
};
createBoard();
// createFigures('w');
// createFigures('b');
importGame('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1');

183
style.css Normal file
View File

@@ -0,0 +1,183 @@
#game-container {
position: relative;
display: grid;
width: 800px;
height: 1220px;
grid-gap: 10px;
grid-template-areas: "dead-black" "field" "dead-white";
grid-template-rows: 1fr 4fr 1fr;
-webkit-transform-origin: center center;
-moz-transform-origin: center center;
-ms-transform-origin: center center;
-o-transform-origin: center center;
transform-origin: center center;
-webkit-transition: transform 1s 1s;
-moz-transition: transform 1s 1s;
-ms-transition: transform 1s 1s;
-o-transition: transform 1s 1s;
transition: transform 1s 1s;
}
#game-container.black-turn {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
#game-container .board {
position: relative;
grid-area: field;
}
#game-container .board .col {
display: inline-block;
width: 12.5%;
height: 100%;
}
#game-container .board .col .field {
position: relative;
box-sizing: border-box;
width: 100%;
height: 12.5%;
}
#game-container .board .col .field.white {
background-color: #eee;
}
#game-container .board .col .field.black {
background-color: #000;
}
#game-container .board .col .field.possible-target {
border: 4px solid #f0f;
}
#game-container.focused .board .col .field:after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .1);
content: "";
pointer-events: none;
}
#game-container.focused .board .col .field.possible-target:after {
background: transparent;
}
#game-container .figures {
position: relative;
z-index: 1;
pointer-events: none;
grid-area: field;
}
#game-container .figures .figure {
position: absolute;
top: 0;
left: 0;
width: 12.5%;
height: 12.5%;
transition: transform .3s;
}
.figure:before {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 75%;
height: 75%;
background-position: center center;
background-repeat: no-repeat;
background-size: 100% 100%;
color: #f0f;
content: '';
-webkit-transition: transform 1s 1s;
-moz-transition: transform 1s 1s;
-ms-transition: transform 1s 1s;
-o-transition: transform 1s 1s;
transition: transform 1s 1s;
}
.black-turn .figure:before {
-webkit-transform: translate(-50%, -50%) rotate(-180deg);
-moz-transform: translate(-50%, -50%) rotate(-180deg);
-ms-transform: translate(-50%, -50%) rotate(-180deg);
-o-transform: translate(-50%, -50%) rotate(-180deg);
transform: translate(-50%, -50%) rotate(-180deg);
}
.pawn.white:before {
background-image: url("assets/pawn_white.svg");
}
.rook.white:before {
background-image: url("assets/rook_white.svg");
}
.knight.white:before {
background-image: url("assets/knight_white.svg");
}
.bishop.white:before {
background-image: url("assets/bishop_white.svg");
}
.queen.white:before {
background-image: url("assets/queen_white.svg");
}
.king.white:before {
background-image: url("assets/king_white.svg");
}
.pawn.black:before {
background-image: url("assets/pawn_black.svg");
}
.rook.black:before {
background-image: url("assets/rook_black.svg");
}
.knight.black:before {
background-image: url("assets/knight_black.svg");
}
.bishop.black:before {
background-image: url("assets/bishop_black.svg");
}
.queen.black:before {
background-image: url("assets/queen_black.svg");
}
.king.black:before {
background-image: url("assets/king_black.svg");
}
.dead-figures {
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-template-rows: repeat(2, 1fr);
}
.dead-figures .figure {
position: relative;
width: 100%;
height: 100%;
}
.dead-figures.black {
grid-area: dead-white;
}
.dead-figures.white {
grid-area: dead-black;
}