fix svg
This commit is contained in:
34
src/libs/svg.js
Normal file
34
src/libs/svg.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
export const loadingSvg = `
|
||||||
|
<svg viewBox="0 0 100 100" style="display:block; width:100%; height: 100%;">
|
||||||
|
<circle fill="#209CEE" stroke="none" cx="6" cy="50" r="6">
|
||||||
|
<animateTransform
|
||||||
|
attributeName="transform"
|
||||||
|
dur="1s"
|
||||||
|
type="translate"
|
||||||
|
values="0 15 ; 0 -15; 0 15"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
begin="0.1"
|
||||||
|
/>
|
||||||
|
</circle>
|
||||||
|
<circle fill="#209CEE" stroke="none" cx="30" cy="50" r="6">
|
||||||
|
<animateTransform
|
||||||
|
attributeName="transform"
|
||||||
|
dur="1s"
|
||||||
|
type="translate"
|
||||||
|
values="0 10 ; 0 -10; 0 10"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
begin="0.2"
|
||||||
|
/>
|
||||||
|
</circle>
|
||||||
|
<circle fill="#209CEE" stroke="none" cx="54" cy="50" r="6">
|
||||||
|
<animateTransform
|
||||||
|
attributeName="transform"
|
||||||
|
dur="1s"
|
||||||
|
type="translate"
|
||||||
|
values="0 5 ; 0 -5; 0 5"
|
||||||
|
repeatCount="indefinite"
|
||||||
|
begin="0.3"
|
||||||
|
/>
|
||||||
|
</circle>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
@@ -1,44 +1,14 @@
|
|||||||
import { DEFAULT_COLOR } from "../../config";
|
import { loadingSvg } from "../../libs/svg";
|
||||||
|
|
||||||
export default function LoadingIcon() {
|
export default function LoadingIcon() {
|
||||||
return (
|
return (
|
||||||
<svg
|
<div
|
||||||
viewBox="0 0 100 100"
|
|
||||||
style={{
|
style={{
|
||||||
maxWidth: "1.2em",
|
display: "inline-block",
|
||||||
maxHeight: "1.2em",
|
width: "1.2em",
|
||||||
|
height: "1em",
|
||||||
}}
|
}}
|
||||||
>
|
dangerouslySetInnerHTML={{ __html: loadingSvg }}
|
||||||
<circle fill={DEFAULT_COLOR} stroke="none" cx="6" cy="50" r="6">
|
/>
|
||||||
<animateTransform
|
|
||||||
attributeName="transform"
|
|
||||||
dur="1s"
|
|
||||||
type="translate"
|
|
||||||
values="0 15 ; 0 -15; 0 15"
|
|
||||||
repeatCount="indefinite"
|
|
||||||
begin="0.1"
|
|
||||||
/>
|
|
||||||
</circle>
|
|
||||||
<circle fill={DEFAULT_COLOR} stroke="none" cx="30" cy="50" r="6">
|
|
||||||
<animateTransform
|
|
||||||
attributeName="transform"
|
|
||||||
dur="1s"
|
|
||||||
type="translate"
|
|
||||||
values="0 10 ; 0 -10; 0 10"
|
|
||||||
repeatCount="indefinite"
|
|
||||||
begin="0.2"
|
|
||||||
/>
|
|
||||||
</circle>
|
|
||||||
<circle fill={DEFAULT_COLOR} stroke="none" cx="54" cy="50" r="6">
|
|
||||||
<animateTransform
|
|
||||||
attributeName="transform"
|
|
||||||
dur="1s"
|
|
||||||
type="translate"
|
|
||||||
values="0 5 ; 0 -5; 0 5"
|
|
||||||
repeatCount="indefinite"
|
|
||||||
begin="0.3"
|
|
||||||
/>
|
|
||||||
</circle>
|
|
||||||
</svg>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user