Update loading components

This commit is contained in:
2026-02-24 22:16:46 -05:00
parent a61e7ce19a
commit 637b3a0c34
43 changed files with 1363 additions and 930 deletions

View File

@@ -1,21 +1,30 @@
import type { LoadingPulseProps } from "$/types/LoadingTypes";
import { usePrefersReducedMotion } from "$/util/AccessibilityUtil";
export default function Drop({
size,
width,
height,
className,
animationDuration = 1.2,
animationDuration = 1200,
color,
stroke,
fill
}: LoadingPulseProps){
fill,
ariaLabel = "Loading"
}: Readonly<LoadingPulseProps>){
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/pulse.svg
const reducedMotion = usePrefersReducedMotion();
const dur = reducedMotion ? animationDuration / 100 : animationDuration / 1000;
return (
<svg
width={width}
height={height}
width={size ?? width}
height={size ?? height}
role="status"
aria-live="polite"
aria-label={ariaLabel}
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
@@ -24,13 +33,13 @@ export default function Drop({
cy="12"
r="0"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
>
<animate
attributeName="r"
calcMode="spline"
dur={animationDuration}
dur={dur}
values="0;11"
keySplines=".52,.6,.25,.99"
repeatCount="indefinite"
@@ -38,7 +47,7 @@ export default function Drop({
<animate
attributeName="opacity"
calcMode="spline"
dur={animationDuration}
dur={dur}
values="1;0"
keySplines=".52,.6,.25,.99"
repeatCount="indefinite"