// AuraScore — multiple visualizations // variant: 'orb' | 'ring' | 'gauge' | 'blob' function AuraScore({ score = 82, variant = 'orb', size = 240, animated = true }) { if (variant === 'orb') return ; if (variant === 'ring') return ; if (variant === 'gauge') return ; if (variant === 'blob') return ; return null; } function AuraOrb({ score, size, animated }) { const id = React.useId(); return (
{/* outer halo rotating */}
{/* inner disc */}
{score}
aura score
{/* orbiting sparkles */}
); } function AuraRing({ score, size, animated }) { const id = React.useId(); const r = size * 0.42; const c = 2 * Math.PI * r; const pct = score / 100; return (
{score}
/ 100
); } function AuraGauge({ score, size, animated }) { const id = React.useId(); const h = size * 0.65; const pct = score / 100; // arc from -135 to 135 const startA = -135, endA = 135; const a = startA + (endA - startA) * pct; const toRad = d => (d - 90) * Math.PI / 180; const cx = size/2, cy = size/2; const r = size * 0.4; const needleX = cx + Math.cos(toRad(a + 90)) * r * 0.85; const needleY = cy + Math.sin(toRad(a + 90)) * r * 0.85; const labels = ['cooked', 'meh', 'ok', 'strong', 'legend']; return (
{/* arc */} {/* ticks */} {[0,25,50,75,100].map((t,i) => { const ta = -135 + (270 * t/100); const x1 = cx + Math.cos(toRad(ta+90)) * (r - size*0.09); const y1 = cy + Math.sin(toRad(ta+90)) * (r - size*0.09); const x2 = cx + Math.cos(toRad(ta+90)) * (r - size*0.17); const y2 = cy + Math.sin(toRad(ta+90)) * (r - size*0.17); return ; })} {/* needle */}
{score}
{labels[Math.min(4, Math.floor(score/20))]}
); } function describeArc(cx, cy, r, startAngle, endAngle) { const toRad = d => (d - 90) * Math.PI / 180; const s = { x: cx + Math.cos(toRad(startAngle+90)) * r, y: cy + Math.sin(toRad(startAngle+90)) * r }; const e = { x: cx + Math.cos(toRad(endAngle+90)) * r, y: cy + Math.sin(toRad(endAngle+90)) * r }; const large = endAngle - startAngle > 180 ? 1 : 0; return `M ${s.x} ${s.y} A ${r} ${r} 0 ${large} 1 ${e.x} ${e.y}`; } function AuraBlob({ score, size, animated }) { // score drives blob complexity/color const id = React.useId(); return (
{animated && }
{score}
aura
); } window.AuraScore = AuraScore;