Skip to content

Commit da780c9

Browse files
Update infinity-spin.tsx (#187)
1 parent 4b3e815 commit da780c9

1 file changed

Lines changed: 38 additions & 30 deletions

File tree

src/loader/infinity-spin.tsx

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { DEFAULT_COLOR } from '../type'
44
import { SVG_NAMESPACE } from '../shared/constants'
55

66
type Props = {
7-
color?: string
7+
color?: string
88
width?: string
99
}
1010

@@ -37,34 +37,42 @@ export const InfinitySpin: FunctionComponent<Props> = ({
3737
width = '200',
3838
}): React.ReactElement => {
3939
return (
40-
<svg
41-
xmlns={SVG_NAMESPACE}
42-
width={`${width}`}
43-
height={`${Number(width) * 0.5}`}
44-
viewBox={`0 0 ${width} ${Number(200 * 0.5)}`}
45-
data-testid="infinity-spin"
46-
>
47-
<Path
48-
data-testid="infinity-spin-path-1"
49-
stroke={color}
50-
fill="none"
51-
strokeWidth="4"
52-
strokeLinecap="round"
53-
strokeLinejoin="round"
54-
strokeMiterlimit="10"
55-
d="M93.9,46.4c9.3,9.5,13.8,17.9,23.5,17.9s17.5-7.8,17.5-17.5s-7.8-17.6-17.5-17.5c-9.7,0.1-13.3,7.2-22.1,17.1 c-8.9,8.8-15.7,17.9-25.4,17.9s-17.5-7.8-17.5-17.5s7.8-17.5,17.5-17.5S86.2,38.6,93.9,46.4z"
56-
/>
57-
<path
58-
data-testid="infinity-spin-path-2"
59-
opacity="0.07"
60-
fill="none"
61-
stroke={color}
62-
strokeWidth="4"
63-
strokeLinecap="round"
64-
strokeLinejoin="round"
65-
strokeMiterlimit="10"
66-
d="M93.9,46.4c9.3,9.5,13.8,17.9,23.5,17.9s17.5-7.8,17.5-17.5s-7.8-17.6-17.5-17.5c-9.7,0.1-13.3,7.2-22.1,17.1 c-8.9,8.8-15.7,17.9-25.4,17.9s-17.5-7.8-17.5-17.5s7.8-17.5,17.5-17.5S86.2,38.6,93.9,46.4z"
67-
/>
68-
</svg>
40+
<svg
41+
xmlns={SVG_NAMESPACE}
42+
width={`${width}`}
43+
height={`${Number(width) * 0.5}`}
44+
viewBox={`0 0 ${width} ${Number(200 * 0.5)}`}
45+
data-testid="infinity-spin"
46+
>
47+
<defs>
48+
<linearGradient id="gradientColor" x1="0%" y1="0%" x2="100%" y2="0%">
49+
<stop offset="0%" stopColor="#4fa94d" />
50+
<stop offset="100%" stopColor="#00BFFF" />
51+
</linearGradient>
52+
</defs>
53+
54+
<Path
55+
data-testid="infinity-spin-path-1"
56+
stroke="url(#gradientColor)"
57+
fill="none"
58+
strokeWidth="4"
59+
strokeLinecap="round"
60+
strokeLinejoin="round"
61+
strokeMiterlimit="10"
62+
d="M93.9,46.4c9.3,9.5,13.8,17.9,23.5,17.9s17.5-7.8,17.5-17.5s-7.8-17.6-17.5-17.5c-9.7,0.1-13.3,7.2-22.1,17.1 c-8.9,8.8-15.7,17.9-25.4,17.9s-17.5-7.8-17.5-17.5s7.8-17.5,17.5-17.5S86.2,38.6,93.9,46.4z"
63+
/>
64+
<path
65+
data-testid="infinity-spin-path-2"
66+
opacity="0.07"
67+
fill="none"
68+
stroke="url(#gradientColor)"
69+
strokeWidth="4"
70+
strokeLinecap="round"
71+
strokeLinejoin="round"
72+
strokeMiterlimit="10"
73+
d="M93.9,46.4c9.3,9.5,13.8,17.9,23.5,17.9s17.5-7.8,17.5-17.5s-7.8-17.6-17.5-17.5c-9.7,0.1-13.3,7.2-22.1,17.1 c-8.9,8.8-15.7,17.9-25.4,17.9s-17.5-7.8-17.5-17.5s7.8-17.5,17.5-17.5S86.2,38.6,93.9,46.4z"
74+
/>
75+
</svg>
76+
6977
)
7078
}

0 commit comments

Comments
 (0)