"use client"; import { motion, useReducedMotion } from "motion/react"; type SolarLoaderProps = { className?: string; color?: string; /** Colour of the orbiting planet. */ accent?: string; /** Loader width in pixels. */ size?: number; /** 1 is the default pace; 2 is twice as fast. */ speed?: number; /** Read out by screen readers. */ label?: string; }; /* SolarLoader: a small sun with turning rays, and one planet circling it. */ export function SolarLoader({ className = "", color = "#fbbf24", accent = "#a78bfa", size = 72, speed = 1, label = "Loading", }: SolarLoaderProps) { const reduce = useReducedMotion(); const orbit = 2.4 / speed; const planet = size * 0.12; return (
{label} {/* Orbit track */} {/* Rays: a striped conic ring, masked to a band round the sun */} {/* Sun core */} {/* Planet: sits at the top of a turning wrapper */} {!reduce && ( )}
); }