|
|
@@ -1,14 +1,16 @@
|
|
|
import { ComponentProps, For } from "solid-js"
|
|
|
|
|
|
-export function Spinner(props: { class?: string; classList?: ComponentProps<"div">["classList"] }) {
|
|
|
- const squares = Array.from({ length: 16 }, (_, i) => ({
|
|
|
- id: i,
|
|
|
- x: (i % 4) * 4,
|
|
|
- y: Math.floor(i / 4) * 4,
|
|
|
- delay: Math.random() * 3,
|
|
|
- duration: 2 + Math.random() * 2,
|
|
|
- }))
|
|
|
+const outerIndices = new Set([0, 1, 2, 3, 4, 7, 8, 11, 12, 13, 14, 15])
|
|
|
+const squares = Array.from({ length: 16 }, (_, i) => ({
|
|
|
+ id: i,
|
|
|
+ x: (i % 4) * 4,
|
|
|
+ y: Math.floor(i / 4) * 4,
|
|
|
+ delay: Math.random() * 1.5,
|
|
|
+ duration: 1 + Math.random() * 1,
|
|
|
+ outer: outerIndices.has(i),
|
|
|
+}))
|
|
|
|
|
|
+export function Spinner(props: { class?: string; classList?: ComponentProps<"div">["classList"] }) {
|
|
|
return (
|
|
|
<svg
|
|
|
viewBox="0 0 15 15"
|
|
|
@@ -28,7 +30,7 @@ export function Spinner(props: { class?: string; classList?: ComponentProps<"div
|
|
|
height="3"
|
|
|
rx="1"
|
|
|
style={{
|
|
|
- animation: `pulse-opacity ${square.duration}s ease-in-out infinite`,
|
|
|
+ animation: `${square.outer ? "pulse-opacity-dim" : "pulse-opacity"} ${square.duration}s ease-in-out infinite`,
|
|
|
"animation-delay": `${square.delay}s`,
|
|
|
}}
|
|
|
/>
|