import { cn } from '@/lib/utils'; /** * LoadingAnimation — SVG pixel claw (8×6) that walks right and eats dots. * Pincers pivot from the root joint with 12° open/close. */ const sizeConfig = { sm: { svgW: 24, svgH: 18, dotSize: 3, dotGap: 5, dots: 3, height: 'h-8' }, md: { svgW: 48, svgH: 36, dotSize: 4, dotGap: 8, dots: 5, height: 'h-12' }, lg: { svgW: 64, svgH: 48, dotSize: 5, dotGap: 10, dots: 6, height: 'h-16' }, } as const; interface Props { size?: 'sm' | 'md' | 'lg'; label?: string; className?: string; } function PixelClaw({ width, height }: { width: number; height: number }) { return ( {/* Top pincer — pivots from root (3,2) */} {/* Body */} {/* Bottom pincer — pivots from root (3,4) */} ); } export function LoadingAnimation({ size = 'md', label, className }: Props) { const cfg = sizeConfig[size]; return (
{/* Claw walks right */}
{/* Dots that get eaten */}
{Array.from({ length: cfg.dots }).map((_, i) => (
))}
{label && ( {label} )}
); }