mirror of
https://bitbucket.org/Mattrixwv/mattrixwvreactcomponents.git
synced 2025-12-06 13:43:59 -05:00
155 lines
3.0 KiB
TypeScript
155 lines
3.0 KiB
TypeScript
import type { LoadingBlocksProps } from "$/types/Loading";
|
|
|
|
|
|
export default function SlidingBlocks3({
|
|
width,
|
|
height,
|
|
className,
|
|
animationDuration = 0.2,
|
|
stroke,
|
|
fill
|
|
}: LoadingBlocksProps){
|
|
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/blocks-shuffle-3.svg
|
|
const id = crypto.randomUUID().replaceAll("-", "");
|
|
|
|
|
|
return (
|
|
<svg
|
|
width={width}
|
|
height={height}
|
|
viewBox="0 0 24 24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<rect
|
|
x="1"
|
|
y="1"
|
|
rx="1"
|
|
width="10"
|
|
height="10"
|
|
className={className}
|
|
stroke={stroke}
|
|
fill={fill}
|
|
>
|
|
<animate
|
|
id={`rectangle1_1_${id}`}
|
|
begin={`0;rectangle3_4_${id}.end`}
|
|
attributeName="x"
|
|
dur={animationDuration}
|
|
values="1;13"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle1_2_${id}`}
|
|
begin={`rectangle3_1_${id}.end`}
|
|
attributeName="y"
|
|
dur={animationDuration}
|
|
values="1;13"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle1_3_${id}`}
|
|
begin={`rectangle3_2_${id}.end`}
|
|
attributeName="x"
|
|
dur={animationDuration}
|
|
values="13;1"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle1_4_${id}`}
|
|
begin={`rectangle3_3_${id}.end`}
|
|
attributeName="y"
|
|
dur={animationDuration}
|
|
values="13;1"
|
|
fill="freeze"
|
|
/>
|
|
</rect>
|
|
<rect
|
|
x="1"
|
|
y="13"
|
|
rx="1"
|
|
width="10"
|
|
height="10"
|
|
className={className}
|
|
stroke={stroke}
|
|
fill={fill}
|
|
>
|
|
<animate
|
|
id={`rectangle2_1_${id}`}
|
|
begin={`rectangle1_1_${id}.end`}
|
|
attributeName="y"
|
|
dur={animationDuration}
|
|
values="13;1"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle2_2_${id}`}
|
|
begin={`rectangle1_2_${id}.end`}
|
|
attributeName="x"
|
|
dur={animationDuration}
|
|
values="1;13"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle2_3_${id}`}
|
|
begin={`rectangle1_3_${id}.end`}
|
|
attributeName="y"
|
|
dur={animationDuration}
|
|
values="1;13"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle2_4_${id}`}
|
|
begin={`rectangle1_4_${id}.end`}
|
|
attributeName="x"
|
|
dur={animationDuration}
|
|
values="13;1"
|
|
fill="freeze"
|
|
/>
|
|
</rect>
|
|
<rect
|
|
x="13"
|
|
y="13"
|
|
rx="1"
|
|
width="10"
|
|
height="10"
|
|
className={className}
|
|
stroke={stroke}
|
|
fill={fill}
|
|
>
|
|
<animate
|
|
id={`rectangle3_1_${id}`}
|
|
begin={`rectangle2_1_${id}.end`}
|
|
attributeName="x"
|
|
dur={animationDuration}
|
|
values="13;1"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle3_2_${id}`}
|
|
begin={`rectangle2_2_${id}.end`}
|
|
attributeName="y"
|
|
dur={animationDuration}
|
|
values="13;1"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle3_3_${id}`}
|
|
begin={`rectangle2_3_${id}.end`}
|
|
attributeName="x"
|
|
dur={animationDuration}
|
|
values="1;13"
|
|
fill="freeze"
|
|
/>
|
|
<animate
|
|
id={`rectangle3_4_${id}`}
|
|
begin={`rectangle2_4_${id}.end`}
|
|
attributeName="y"
|
|
dur={animationDuration}
|
|
values="1;13"
|
|
fill="freeze"
|
|
/>
|
|
</rect>
|
|
</svg>
|
|
);
|
|
}
|