You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cursor.tsx 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import React from 'react'
  2. import styled from 'styles'
  3. export default function Cursor({
  4. color = 'dodgerblue',
  5. point = [0, 0],
  6. }: {
  7. color?: string
  8. point: number[]
  9. }): JSX.Element {
  10. const transform = `translate(${point[0] - 12} ${point[1] - 10})`
  11. return (
  12. <StyledCursor
  13. color={color}
  14. transform={transform}
  15. width="35px"
  16. height="35px"
  17. viewBox="0 0 35 35"
  18. version="1.1"
  19. pointerEvents="none"
  20. xmlns="http://www.w3.org/2000/svg"
  21. xmlnsXlink="http://www.w3.org/1999/xlink"
  22. >
  23. <path
  24. d="M12,24.4219 L12,8.4069 L23.591,20.0259 L16.81,20.0259 L16.399,20.1499 L12,24.4219 Z"
  25. fill="#ffffff"
  26. />
  27. <path
  28. d="M21.0845,25.0962 L17.4795,26.6312 L12.7975,15.5422 L16.4835,13.9892 L21.0845,25.0962 Z"
  29. fill="#ffffff"
  30. />
  31. <path
  32. d="M19.751,24.4155 L17.907,25.1895 L14.807,17.8155 L16.648,17.0405 L19.751,24.4155 Z"
  33. fill="currentColor"
  34. />
  35. <path
  36. d="M13,10.814 L13,22.002 L15.969,19.136 L16.397,18.997 L21.165,18.997 L13,10.814 Z"
  37. fill="currentColor"
  38. />
  39. </StyledCursor>
  40. )
  41. }
  42. const StyledCursor = styled('g', {
  43. position: 'absolute',
  44. zIndex: 1000,
  45. top: 0,
  46. left: 0,
  47. })