mirror of
https://bitbucket.org/Mattrixwv/mattrixwvreactcomponents.git
synced 2025-12-06 21:53:57 -05:00
Most simple components created
This commit is contained in:
157
lib/component/loading/bar/CenterGrowingBars.tsx
Normal file
157
lib/component/loading/bar/CenterGrowingBars.tsx
Normal file
@@ -0,0 +1,157 @@
|
||||
import type { LoadingBarsProps } from "$/types/Loading";
|
||||
|
||||
|
||||
export default function CenterGrowingBars({
|
||||
width,
|
||||
height,
|
||||
className,
|
||||
animationDuration = 0.6,
|
||||
stroke,
|
||||
fill
|
||||
}: LoadingBarsProps){
|
||||
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/bars-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"
|
||||
>
|
||||
<rect
|
||||
x="1"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
begin={`rectangle3_${id}.begin+${animationDuration * 2 / 3}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle3_${id}.begin+${animationDuration * 2 / 3}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="5.8"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
begin={`rectangle3_${id}.begin+${animationDuration / 3}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle3_${id}.begin+${animationDuration / 3}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="10.6"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
id={`rectangle3_${id}`}
|
||||
begin={`0;rectangle5_${id}.end-${animationDuration / 6}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
<animate
|
||||
begin={`0;rectangle5_${id}.end-${animationDuration / 6}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="15.4"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
begin={`rectangle3_${id}.begin+${animationDuration / 3}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle3_${id}.begin+${animationDuration / 3}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="20.2"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
id={`rectangle5_${id}`}
|
||||
begin={`rectangle3_${id}.begin+${animationDuration * 2 / 3}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle3_${id}.begin+${animationDuration * 2 / 3}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".14,.73,.34,1;.65,.26,.82,.45"
|
||||
/>
|
||||
</rect>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
109
lib/component/loading/bar/CircleBars.tsx
Normal file
109
lib/component/loading/bar/CircleBars.tsx
Normal file
@@ -0,0 +1,109 @@
|
||||
import type { LoadingBarsProps } from "$/types/Loading";
|
||||
|
||||
|
||||
export default function CircleBars({
|
||||
width,
|
||||
height,
|
||||
className,
|
||||
animationDuration = 0.75,
|
||||
stroke,
|
||||
fill
|
||||
}: LoadingBarsProps){
|
||||
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/bars-rotate-fade.svg
|
||||
|
||||
|
||||
return (
|
||||
<svg
|
||||
width={width}
|
||||
height={height}
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g>
|
||||
<rect
|
||||
x="11"
|
||||
y="1"
|
||||
width="2"
|
||||
height="5"
|
||||
opacity=".14"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
/>
|
||||
<rect
|
||||
x="11"
|
||||
y="1"
|
||||
width="2"
|
||||
height="5"
|
||||
transform="rotate(30 12 12)"
|
||||
opacity=".29"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
/>
|
||||
<rect
|
||||
x="11"
|
||||
y="1"
|
||||
width="2"
|
||||
height="5"
|
||||
transform="rotate(60 12 12)"
|
||||
opacity=".43"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
/>
|
||||
<rect
|
||||
x="11"
|
||||
y="1"
|
||||
width="2"
|
||||
height="5"
|
||||
transform="rotate(90 12 12)"
|
||||
opacity=".57"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
/>
|
||||
<rect
|
||||
x="11"
|
||||
y="1"
|
||||
width="2"
|
||||
height="5"
|
||||
transform="rotate(120 12 12)"
|
||||
opacity=".71"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
/>
|
||||
<rect
|
||||
x="11"
|
||||
y="1"
|
||||
width="2"
|
||||
height="5"
|
||||
transform="rotate(150 12 12)"
|
||||
opacity=".86"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
/>
|
||||
<rect
|
||||
x="11"
|
||||
y="1"
|
||||
width="2"
|
||||
height="5"
|
||||
transform="rotate(180 12 12)"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
/>
|
||||
<animateTransform
|
||||
attributeName="transform"
|
||||
type="rotate"
|
||||
calcMode="discrete"
|
||||
dur={animationDuration}
|
||||
values="0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
</g>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
81
lib/component/loading/bar/FadingBars.tsx
Normal file
81
lib/component/loading/bar/FadingBars.tsx
Normal file
@@ -0,0 +1,81 @@
|
||||
import type { LoadingBarsProps } from "$/types/Loading";
|
||||
|
||||
|
||||
export default function FadingBars({
|
||||
width,
|
||||
height,
|
||||
className,
|
||||
animationDuration = 0.75,
|
||||
stroke,
|
||||
fill
|
||||
}: LoadingBarsProps){
|
||||
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/bars-fade.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="4"
|
||||
width="6"
|
||||
height="14"
|
||||
opacity="1"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
id={`rectangle1_${id}`}
|
||||
begin={`0;rectangle3_${id}.end-${animationDuration / 3}s`}
|
||||
attributeName="opacity"
|
||||
dur={animationDuration}
|
||||
values="1;.2"
|
||||
fill="freeze"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="9"
|
||||
y="4"
|
||||
width="6"
|
||||
height="14"
|
||||
opacity=".4"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 5}s`}
|
||||
attributeName="opacity"
|
||||
dur={animationDuration}
|
||||
values="1;.2"
|
||||
fill="freeze"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="17"
|
||||
y="4"
|
||||
width="6"
|
||||
height="14"
|
||||
opacity=".3"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
id={`rectangle3_${id}`}
|
||||
begin={`rectangle1_${id}.begin+${animationDuration * 2 / 5}s`}
|
||||
attributeName="opacity"
|
||||
dur={animationDuration}
|
||||
values="1;.2"
|
||||
fill="freeze"
|
||||
/>
|
||||
</rect>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
123
lib/component/loading/bar/FadingGrowingBars.tsx
Normal file
123
lib/component/loading/bar/FadingGrowingBars.tsx
Normal file
@@ -0,0 +1,123 @@
|
||||
import type { LoadingBarsProps } from "$/types/Loading";
|
||||
|
||||
|
||||
export default function FadingGrowingBars({
|
||||
width,
|
||||
height,
|
||||
className,
|
||||
animationDuration = 0.75,
|
||||
stroke,
|
||||
fill
|
||||
}: LoadingBarsProps){
|
||||
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/bars-scale-fade.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="4"
|
||||
width="6"
|
||||
height="14"
|
||||
opacity="1"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
id={`rectangle1_${id}`}
|
||||
begin={`0;rectangle3_${id}.end-${animationDuration / 3}s`}
|
||||
attributeName="y"
|
||||
dur={animationDuration}
|
||||
values="1;5"
|
||||
fill="freeze"
|
||||
/>
|
||||
<animate
|
||||
begin={`0;rectangle3_${id}.end-${animationDuration / 3}s`}
|
||||
attributeName="height"
|
||||
dur={animationDuration}
|
||||
values="22;14"
|
||||
fill="freeze"
|
||||
/>
|
||||
<animate
|
||||
begin={`0;rectangle3_${id}.end-${animationDuration / 3}s`}
|
||||
attributeName="opacity"
|
||||
dur={animationDuration}
|
||||
values="1;.2"
|
||||
fill="freeze"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="9"
|
||||
y="4"
|
||||
width="6"
|
||||
height="14"
|
||||
opacity=".4"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 5}s`}
|
||||
attributeName="y"
|
||||
dur={animationDuration}
|
||||
values="1;5"
|
||||
fill="freeze"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 5}s`}
|
||||
attributeName="height"
|
||||
dur={animationDuration}
|
||||
values="22;14"
|
||||
fill="freeze"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 5}s`}
|
||||
attributeName="opacity"
|
||||
dur={animationDuration}
|
||||
values="1;.2"
|
||||
fill="freeze"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="17"
|
||||
y="4"
|
||||
width="6"
|
||||
height="14"
|
||||
opacity=".3"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
id={`rectangle3_${id}`}
|
||||
begin={`rectangle1_${id}.begin+${animationDuration * 2 / 5}s`}
|
||||
attributeName="y"
|
||||
dur={animationDuration}
|
||||
values="1;5"
|
||||
fill="freeze"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration * 2 / 5}s`}
|
||||
attributeName="height"
|
||||
dur={animationDuration}
|
||||
values="22;14"
|
||||
fill="freeze"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration * 2 / 5}s`}
|
||||
attributeName="opacity"
|
||||
dur={animationDuration}
|
||||
values="1;.2"
|
||||
fill="freeze"
|
||||
/>
|
||||
</rect>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
157
lib/component/loading/bar/GrowingBars.tsx
Normal file
157
lib/component/loading/bar/GrowingBars.tsx
Normal file
@@ -0,0 +1,157 @@
|
||||
import type { LoadingBarsProps } from "$/types/Loading";
|
||||
|
||||
|
||||
export default function GrowingBars({
|
||||
width,
|
||||
height,
|
||||
className,
|
||||
animationDuration = 0.6,
|
||||
stroke,
|
||||
fill
|
||||
}: LoadingBarsProps){
|
||||
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/bars-scale.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="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
id={`rectangle1_${id}`}
|
||||
begin={`0;rectangle5_${id}.end-${animationDuration / 6}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
<animate
|
||||
begin={`0;rectangle5_${id}.end-${animationDuration / 6}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="5.8"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 6}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 6}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="10.6"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 3}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 3}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="15.4"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 2}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration / 2}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
</rect>
|
||||
<rect
|
||||
x="20.2"
|
||||
y="6"
|
||||
width="2.8"
|
||||
height="12"
|
||||
className={className}
|
||||
stroke={stroke}
|
||||
fill={fill}
|
||||
>
|
||||
<animate
|
||||
id={`rectangle5_${id}`}
|
||||
begin={`rectangle1_${id}.begin+${animationDuration * 2 / 3}s`}
|
||||
attributeName="y"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="6;1;6"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
<animate
|
||||
begin={`rectangle1_${id}.begin+${animationDuration * 2 / 3}s`}
|
||||
attributeName="height"
|
||||
calcMode="spline"
|
||||
dur={animationDuration}
|
||||
values="12;22;12"
|
||||
keySplines=".36,.61,.3,.98;.36,.61,.3,.98"
|
||||
/>
|
||||
</rect>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user