Files
MattrixwvReactComponents/lib/component/loading/dot/CircleCenterDots.tsx

241 lines
4.9 KiB
TypeScript

import type { LoadingDotsProps } from "$/types/Loading";
export default function CircleCenterDots({
width,
height,
className,
animationDuration = 0.6,
stroke,
fill
}: LoadingDotsProps){
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/6-dots-scale-middle.svg
const id = crypto.randomUUID().replaceAll("-", "");
return (
<svg
width={width}
height={height}
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<circle
cx="12"
cy="3"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle1_${id}`}
begin={`0;circle3_${id}.end-${animationDuration * 5 / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="16.50"
cy="4.21"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle2_${id}`}
begin={`circle1_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="7.50"
cy="4.21"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle3_${id}`}
begin={`circle5_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="19.79"
cy="7.50"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle4_${id}`}
begin={`circle2_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="4.21"
cy="7.50"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle5_${id}`}
begin={`circle7_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="21.00"
cy="12.00"
r="0"
className={className}
stroke={stroke}
>
<animate
id={`circle6_${id}`}
begin={`circle4_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="3.00"
cy="12.00"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle7_${id}`}
begin={`circle9_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="19.79"
cy="16.50"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle8_${id}`}
begin={`circle6_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="4.21"
cy="16.50"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle9_${id}`}
begin={`circle11_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="16.50"
cy="19.79"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle10_${id}`}
begin={`circle8_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="7.50"
cy="19.79"
r="0"
className={className}
stroke={stroke}
fill={fill}
>
<animate
id={`circle11_${id}`}
begin={`circle12_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
<circle
cx="12"
cy="21"
r="0"
stroke={stroke}
fill={fill}
className={className}
>
<animate
id={`circle12_${id}`}
begin={`circle10_${id}.begin+${animationDuration / 6}s`}
attributeName="r"
calcMode="spline"
dur={animationDuration}
values="0;2;0"
keySplines=".27,.42,.37,.99;.53,0,.61,.73"
/>
</circle>
</svg>
);
}