"use client"; import { motion, useReducedMotion } from "motion/react"; type PixelLoaderProps = { className?: string; color?: 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; }; // Clockwise path round the outer cells of a 3x3 grid; cell 4 is the centre. const RING = [0, 1, 2, 5, 8, 7, 6, 3]; /* PixelLoader: a lit pixel runs round a 3x3 grid, leaving a fading trail. */ export function PixelLoader({ className = "", color = "#a78bfa", size = 56, speed = 1, label = "Loading", }: PixelLoaderProps) { const reduce = useReducedMotion(); const cycle = 1.2 / speed; const gap = size * 0.08; const cell = (size - gap * 2) / 3; return (