diff options
| author | Adam <[email protected]> | 2025-10-31 11:54:27 -0500 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-10-31 12:00:44 -0500 |
| commit | ffc889b99e61c6f21ce68985ee398c3031a5b19b (patch) | |
| tree | b4356c27d343f127265ae020b015e8224b658ba4 /packages/desktop/src/components/spinner.tsx | |
| parent | 36b48a44ac1f0c9593a4abdf1d21980a2bfaee22 (diff) | |
| download | opencode-ffc889b99e61c6f21ce68985ee398c3031a5b19b.tar.gz opencode-ffc889b99e61c6f21ce68985ee398c3031a5b19b.zip | |
wip: desktop work
Diffstat (limited to 'packages/desktop/src/components/spinner.tsx')
| -rw-r--r-- | packages/desktop/src/components/spinner.tsx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/packages/desktop/src/components/spinner.tsx b/packages/desktop/src/components/spinner.tsx new file mode 100644 index 000000000..5fc4cda64 --- /dev/null +++ b/packages/desktop/src/components/spinner.tsx @@ -0,0 +1,39 @@ +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, + })) + + return ( + <svg + viewBox="0 0 15 15" + classList={{ + "size-4": true, + ...(props.classList ?? {}), + [props.class ?? ""]: !!props.class, + }} + fill="currentColor" + > + <For each={squares}> + {(square) => ( + <rect + x={square.x} + y={square.y} + width="3" + height="3" + rx="1" + style={{ + animation: `pulse-opacity ${square.duration}s ease-in-out infinite`, + "animation-delay": `${square.delay}s`, + }} + /> + )} + </For> + </svg> + ) +} |
