词光 · Word Atlas — Illustrated IELTS vocabulary with 7,298 words, UK/US audio and FSRS review. Open-source app + CC BY 4.0 dataset.
TypeScript chinesedatasetenglish-learningflashcardsfsrsieltslanguage-learningpwareactspaced-repetitionvocabularywebgl
export function Ring({ value, size = 120, stroke = 9, children, tone = "terra" }: { value: number; size?: number; stroke?: number; children?: React.ReactNode; tone?: string }) {
const r = (size - stroke) / 2;
const c = 2 * Math.PI * r;
const v = Math.max(0, Math.min(1, value));
return (
<div className="ring" style={{ width: size, height: size }}>
<svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} aria-hidden="true">
<circle cx={size / 2} cy={size / 2} r={r} fill="none" stroke="var(--line-strong)" strokeWidth={stroke} />
<circle
cx={size / 2}
cy={size / 2}
r={r}
fill="none"
stroke={`var(--${tone})`}
strokeWidth={stroke}
strokeLinecap="round"
strokeDasharray={c}
strokeDashoffset={c * (1 - v)}
transform={`rotate(-90 ${size / 2} ${size / 2})`}
className="ring-arc"
/>
</svg>
<div className="ring-body">{children}</div>
</div>
);
}