Pawn.jsx 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import React from "react";
  2. import { darken } from "color2k";
  3. import { nanoid } from "nanoid";
  4. function Pawn({ size = 50, color = "#b3b3b3" }) {
  5. const ind = nanoid();
  6. const realSize = size * 1.1;
  7. const colorDarken1 = darken(color, 0.2);
  8. return (
  9. <svg
  10. xmlns="http://www.w3.org/2000/svg"
  11. version="1.1"
  12. xmlnsXlink="http://www.w3.org/1999/xlink"
  13. viewBox="0 0 37.443 82.718"
  14. height={realSize}
  15. width={realSize / 2.25}
  16. >
  17. <defs id={`id__${ind}`}>
  18. <linearGradient id={`prefix__a__${ind}`}>
  19. <stop offset={0} stopColor={color} />
  20. <stop offset={1} stopColor={colorDarken1} />
  21. </linearGradient>
  22. <linearGradient id="prefix__b">
  23. <stop offset={0} stopColor="#2e3436" />
  24. <stop offset={1} stopOpacity={0} stopColor="#2e3436" />
  25. </linearGradient>
  26. <radialGradient
  27. xlinkHref={`#prefix__a__${ind}`}
  28. gradientUnits="userSpaceOnUse"
  29. gradientTransform="matrix(.89625 0 0 1.00955 150.891 -28.515)"
  30. r={36}
  31. cy={30.918}
  32. cx={-119.59}
  33. id={`prefix__j__${ind}`}
  34. />
  35. <radialGradient
  36. xlinkHref="#prefix__b"
  37. gradientUnits="userSpaceOnUse"
  38. gradientTransform="matrix(.5154 0 0 .27324 119.372 6.721)"
  39. r={24.25}
  40. cy={55.827}
  41. cx={-160.19}
  42. id="prefix__i"
  43. />
  44. <radialGradient
  45. xlinkHref={`#prefix__a__${ind}`}
  46. gradientUnits="userSpaceOnUse"
  47. gradientTransform="matrix(.8789 0 0 1.47938 153.494 -1372.36)"
  48. r={49.5}
  49. cy={953.13}
  50. cx={-122.32}
  51. id={`prefix__h__${ind}`}
  52. />
  53. <filter
  54. height={1.66}
  55. width={1.247}
  56. y={-0.33}
  57. x={-0.124}
  58. id={`prefix__g__${ind}`}
  59. >
  60. <feGaussianBlur stdDeviation={2.475} />
  61. </filter>
  62. </defs>
  63. <g strokeWidth={1.198}>
  64. <path
  65. d="M86 291c0 4.97-10.745 9-24 9s-24-4.03-24-9 10.745-9 24-9 24 4.03 24 9z"
  66. transform="matrix(.6253 0 0 .6317 -20.047 -110.543)"
  67. fillOpacity={0.5}
  68. filter={`url(#prefix__g__${ind})`}
  69. />
  70. <path
  71. d="M58.74 56.96c0 18.31-4.214 28.718-20.778 28.718S17.184 75.27 17.184 57.233s10.023-38.981 20.778-38.981c10.755-.273 20.778 20.67 20.778 38.707z"
  72. fill={`url(#prefix__h__${ind})`}
  73. transform="matrix(.8302 0 0 .83868 -12.794 6.302)"
  74. />
  75. <path
  76. d="M38.462 20.131c-4.94 0-9.268 2.158-13 5.588 3.272 3.353 7.664 5.412 12.5 5.412s9.228-2.06 12.5-5.412c-3.232-3.43-7.56-5.588-12-5.588z"
  77. fill="url(#prefix__i)"
  78. transform="matrix(.8302 0 0 .83868 -12.794 6.302)"
  79. />
  80. <path
  81. d="M54.315 8.839c0 9.031-7.321 16.353-16.353 16.353-9.032 0-16.353-7.322-16.353-16.353 0-9.032 7.321-16.354 16.353-16.354 9.032 0 16.353 7.322 16.353 16.354z"
  82. fill={`url(#prefix__j__${ind})`}
  83. transform="matrix(.8302 0 0 .83868 -12.794 6.302)"
  84. />
  85. </g>
  86. </svg>
  87. );
  88. }
  89. export default React.memo(Pawn);