Spirograph
React + Tailwind
// A wheel of radius r rolling inside a ring of radius R, its pen d from the wheel's centre: a
// hypotrochoid. (R - r) : r = 8 : 3, so the figure closes after three laps with eight lobes.
const R = 88;
const r = 24;
const d = 16.5;
const C = 100;
const LAPS = 3;
const DRAW = 5.4; // seconds of drawing
const T = 6.4; // then a beat to admire it and fade
const k = (R - r) / r;
const pen = (t: number) => [C + (R - r) * Math.cos(t) + d * Math.cos(k * t), C + (R - r) * Math.sin(t) - d * Math.sin(k * t)];
const SAMPLES = 540;
const pts = Array.from({ length: SAMPLES + 1 }, (_, i) => pen((i / SAMPLES) * LAPS * 2 * Math.PI));
const PATH = pts.map(([x, y], i) => `${i ? 'L' : 'M'}${x.toFixed(1)} ${y.toFixed(1)}`).join('');
// The pen moves evenly round the wheel, not evenly along the line, so the line is revealed by
// arc length at each moment: keyframes for the dash, sampled from the real curve.
const lengths = pts.reduce<number[]>((acc, p, i) => (acc.push(i ? acc[i - 1] + Math.hypot(p[0] - pts[i - 1][0], p[1] - pts[i - 1][1]) : 0), acc), []);
const TOTAL = lengths[SAMPLES];
const share = DRAW / T;
const STEPS = 60;
const dash = Array.from({ length: STEPS + 1 }, (_, s) => {
const i = Math.round((s / STEPS) * SAMPLES);
return `${((s / STEPS) * share * 100).toFixed(2)}% { stroke-dashoffset: ${(1 - lengths[i] / TOTAL).toFixed(4)}; }`;
}).join(' ');
const at = `${(share * 100).toFixed(2)}%`;
const css = `
.loader-spirograph { --ring: light-dark(#cbced3, #2e3035); --gear: color-mix(in oklab, light-dark(#ebedf0, #232529) 70%, transparent); --line: light-dark(#373a40, #f1f2f3); width: 196px; height: 196px; }
.loader-spirograph svg { display: block; width: 100%; height: 100%; overflow: visible; }
.loader-spirograph__ring { fill: none; stroke: var(--ring); }
.loader-spirograph__teeth { fill: none; stroke: var(--ring); stroke-width: 3; stroke-dasharray: 2.1 2.1; }
.loader-spirograph__line { fill: none; stroke: var(--line); stroke-width: 1.2; stroke-linejoin: round; stroke-dasharray: 1; animation: loader-spirograph-draw ${T}s linear infinite; }
/* The carrier takes the wheel round the ring; the wheel turns back on itself as it rolls. */
.loader-spirograph__carrier { transform-box: view-box; transform-origin: ${C}px ${C}px; animation: loader-spirograph-carry ${T}s linear infinite; }
.loader-spirograph__wheel { transform-box: view-box; transform-origin: ${C + R - r}px ${C}px; animation: loader-spirograph-roll ${T}s linear infinite; }
.loader-spirograph__disc { fill: var(--gear); stroke: color-mix(in oklab, light-dark(#6d7179, #7d8087) 80%, transparent); stroke-width: 1; }
.loader-spirograph__cog { fill: none; stroke: color-mix(in oklab, light-dark(#6d7179, #7d8087) 80%, transparent); stroke-width: 2.4; stroke-dasharray: 2.1 2.1; }
.loader-spirograph__hole { fill: none; stroke: color-mix(in oklab, light-dark(#6d7179, #7d8087) 70%, transparent); stroke-width: 1; }
.loader-spirograph__pen { fill: var(--line); }
@keyframes loader-spirograph-draw { ${dash} 92% { opacity: 1; } 99% { opacity: 0; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes loader-spirograph-carry { 0% { transform: rotate(0deg); } ${at}, 100% { transform: rotate(${LAPS * 360}deg); } }
@keyframes loader-spirograph-roll { 0% { transform: rotate(0deg); } ${at}, 100% { transform: rotate(${-((LAPS * 360 * R) / r)}deg); } }
@media (prefers-reduced-motion: reduce) {
.loader-spirograph * { animation: none !important; }
.loader-spirograph__line { stroke-dashoffset: 0; }
}
`;
export function Preview() {
const gx = C + R - r;
return (
<>
<style href="kit-loaders-spirograph" precedence="kit">
{css}
</style>
<div className="loader-spirograph" role="status" aria-label="Loading">
<svg viewBox="0 0 200 200" aria-hidden="true">
<circle className="loader-spirograph__ring" cx={C} cy={C} r={R + 7} strokeWidth={10} />
<circle className="loader-spirograph__teeth" cx={C} cy={C} r={R + 1} />
<path className="loader-spirograph__line" d={PATH} pathLength={1} />
<g className="loader-spirograph__carrier">
<g className="loader-spirograph__wheel">
<circle className="loader-spirograph__disc" cx={gx} cy={C} r={r - 1.6} />
<circle className="loader-spirograph__cog" cx={gx} cy={C} r={r - 0.4} />
{[5, 9.5, 13].map((h, i) => (
<circle key={h} className="loader-spirograph__hole" cx={+(gx + h * Math.cos(i * 2.2)).toFixed(1)} cy={+(C + h * Math.sin(i * 2.2)).toFixed(1)} r={1.8} />
))}
<circle className="loader-spirograph__hole" cx={gx + d} cy={C} r={3.4} />
<circle className="loader-spirograph__pen" cx={gx + d} cy={C} r={2} />
</g>
</g>
</svg>
</div>
</>
);
}Markup where the component goes, CSS in your stylesheet. No JavaScript.
HTML
<div class="loader-spirograph" role="status" aria-label="Loading">
<svg viewBox="0 0 200 200" aria-hidden="true">
<circle class="loader-spirograph__ring" cx="100" cy="100" r="95" stroke-width="10"></circle>
<circle class="loader-spirograph__teeth" cx="100" cy="100" r="89"></circle>
<path class="loader-spirograph__line" d="M180.5 100.0L180.4 100.7L180.1 101.4L179.5 102.1L178.7 102.9L177.8 103.7L176.6 104.6L175.2 105.5L173.7 106.5L171.9 107.5L170.0 108.7L167.9 109.9L165.7 111.2L163.3 112.6L160.9 114.1L158.3 115.8L155.6 117.5L152.9 119.3L150.1 121.2L147.2 123.2L144.3 125.3L141.4 127.5L138.5 129.8L135.6 132.1L132.7 134.6L129.8 137.0L127.0 139.5L124.3 142.1L121.6 144.6L119.0 147.2L116.5 149.8L114.1 152.3L111.8 154.8L109.6 157.3L107.5 159.7L105.5 162.1L103.6 164.3L101.9 166.4L100.3 168.5L98.7 170.3L97.3 172.1L96.0 173.7L94.8 175.1L93.7 176.4L92.7 177.4L91.8 178.3L90.9 179.0L90.1 179.4L89.3 179.7L88.6 179.7L87.9 179.5L87.3 179.1L86.6 178.5L86.0 177.6L85.3 176.6L84.6 175.3L83.9 173.8L83.2 172.1L82.4 170.3L81.6 168.2L80.6 166.0L79.7 163.7L78.6 161.1L77.5 158.5L76.2 155.7L74.9 152.8L73.5 149.9L72.0 146.8L70.4 143.7L68.8 140.5L67.0 137.3L65.2 134.1L63.3 130.9L61.3 127.7L59.3 124.5L57.2 121.4L55.1 118.3L52.9 115.3L50.8 112.4L48.6 109.5L46.4 106.7L44.2 104.1L42.1 101.5L40.0 99.1L38.0 96.8L36.0 94.6L34.1 92.6L32.4 90.7L30.7 88.9L29.2 87.2L27.8 85.7L26.5 84.3L25.4 83.0L24.5 81.8L23.7 80.8L23.2 79.8L22.8 78.9L22.7 78.2L22.7 77.4L23.0 76.8L23.5 76.2L24.2 75.6L25.1 75.1L26.2 74.6L27.5 74.1L29.1 73.6L30.8 73.1L32.7 72.6L34.9 72.1L37.2 71.5L39.7 70.9L42.3 70.2L45.1 69.4L48.0 68.6L51.0 67.7L54.1 66.8L57.4 65.7L60.7 64.6L64.0 63.4L67.4 62.2L70.9 60.8L74.3 59.4L77.8 57.9L81.2 56.4L84.6 54.8L88.0 53.1L91.3 51.4L94.5 49.7L97.6 47.9L100.7 46.1L103.6 44.4L106.5 42.6L109.2 40.9L111.8 39.2L114.2 37.6L116.5 36.0L118.7 34.5L120.7 33.1L122.6 31.8L124.3 30.6L125.9 29.6L127.3 28.7L128.6 27.9L129.8 27.3L130.8 26.9L131.7 26.6L132.6 26.6L133.3 26.7L133.9 27.0L134.4 27.6L134.9 28.3L135.3 29.3L135.6 30.4L135.9 31.8L136.2 33.4L136.4 35.2L136.6 37.1L136.9 39.3L137.1 41.7L137.4 44.2L137.7 46.9L138.0 49.7L138.4 52.7L138.9 55.8L139.4 59.0L139.9 62.4L140.5 65.8L141.2 69.3L142.0 72.8L142.8 76.4L143.8 80.0L144.7 83.7L145.8 87.3L146.9 90.9L148.0 94.4L149.2 98.0L150.5 101.4L151.8 104.8L153.1 108.1L154.4 111.2L155.7 114.3L157.1 117.2L158.4 120.0L159.7 122.7L160.9 125.2L162.1 127.6L163.2 129.8L164.2 131.8L165.1 133.7L166.0 135.5L166.7 137.0L167.3 138.5L167.7 139.7L168.0 140.8L168.1 141.8L168.1 142.6L167.8 143.3L167.4 143.9L166.9 144.3L166.1 144.7L165.1 144.9L163.9 145.1L162.5 145.2L160.9 145.3L159.2 145.3L157.2 145.2L155.0 145.2L152.7 145.1L150.2 145.0L147.5 144.9L144.6 144.8L141.6 144.8L138.5 144.8L135.3 144.8L131.9 144.9L128.4 145.0L124.9 145.2L121.3 145.4L117.6 145.7L113.9 146.1L110.2 146.6L106.4 147.1L102.7 147.6L99.0 148.3L95.3 149.0L91.8 149.7L88.2 150.5L84.8 151.3L81.4 152.2L78.2 153.1L75.1 154.0L72.1 154.9L69.3 155.7L66.6 156.6L64.1 157.4L61.7 158.2L59.5 159.0L57.5 159.6L55.7 160.2L54.0 160.7L52.5 161.1L51.2 161.3L50.0 161.5L49.0 161.5L48.2 161.3L47.5 161.0L47.0 160.6L46.6 159.9L46.4 159.1L46.3 158.1L46.2 156.9L46.3 155.6L46.5 154.0L46.7 152.3L47.1 150.4L47.4 148.2L47.9 146.0L48.3 143.5L48.8 140.9L49.2 138.1L49.7 135.1L50.2 132.0L50.6 128.8L51.0 125.5L51.4 122.1L51.7 118.5L52.0 114.9L52.2 111.2L52.4 107.5L52.5 103.8L52.5 100.0L52.5 96.2L52.4 92.5L52.2 88.8L52.0 85.1L51.7 81.5L51.4 77.9L51.0 74.5L50.6 71.2L50.2 68.0L49.7 64.9L49.2 61.9L48.8 59.1L48.3 56.5L47.9 54.0L47.4 51.8L47.1 49.6L46.7 47.7L46.5 46.0L46.3 44.4L46.2 43.1L46.3 41.9L46.4 40.9L46.6 40.1L47.0 39.4L47.5 39.0L48.2 38.7L49.0 38.5L50.0 38.5L51.2 38.7L52.5 38.9L54.0 39.3L55.7 39.8L57.5 40.4L59.5 41.0L61.7 41.8L64.1 42.6L66.6 43.4L69.3 44.3L72.1 45.1L75.1 46.0L78.2 46.9L81.4 47.8L84.8 48.7L88.2 49.5L91.7 50.3L95.3 51.0L99.0 51.7L102.7 52.4L106.4 52.9L110.2 53.4L113.9 53.9L117.6 54.3L121.3 54.6L124.9 54.8L128.4 55.0L131.9 55.1L135.3 55.2L138.5 55.2L141.6 55.2L144.6 55.2L147.5 55.1L150.2 55.0L152.7 54.9L155.0 54.8L157.2 54.8L159.2 54.7L160.9 54.7L162.5 54.8L163.9 54.9L165.1 55.1L166.1 55.3L166.9 55.7L167.4 56.1L167.8 56.7L168.1 57.4L168.1 58.2L168.0 59.2L167.7 60.3L167.3 61.5L166.7 63.0L166.0 64.5L165.1 66.3L164.2 68.2L163.2 70.2L162.1 72.4L160.9 74.8L159.7 77.3L158.4 80.0L157.1 82.8L155.8 85.7L154.4 88.8L153.1 91.9L151.8 95.2L150.5 98.6L149.2 102.0L148.0 105.6L146.9 109.1L145.8 112.7L144.7 116.3L143.8 120.0L142.8 123.6L142.0 127.2L141.2 130.7L140.5 134.2L139.9 137.6L139.4 141.0L138.9 144.2L138.4 147.3L138.0 150.3L137.7 153.1L137.4 155.8L137.1 158.3L136.9 160.7L136.6 162.9L136.4 164.8L136.2 166.6L135.9 168.2L135.6 169.6L135.3 170.7L134.9 171.7L134.4 172.4L133.9 173.0L133.3 173.3L132.6 173.4L131.7 173.4L130.8 173.1L129.8 172.7L128.6 172.1L127.3 171.3L125.9 170.4L124.3 169.4L122.6 168.2L120.7 166.9L118.7 165.5L116.5 164.0L114.2 162.4L111.8 160.8L109.2 159.1L106.5 157.4L103.6 155.6L100.7 153.9L97.6 152.1L94.5 150.3L91.3 148.6L88.0 146.9L84.6 145.2L81.2 143.6L77.8 142.1L74.3 140.6L70.9 139.2L67.4 137.8L64.0 136.6L60.7 135.4L57.4 134.3L54.1 133.2L51.0 132.3L48.0 131.4L45.1 130.6L42.3 129.8L39.7 129.1L37.2 128.5L34.9 127.9L32.7 127.4L30.8 126.9L29.1 126.4L27.5 125.9L26.2 125.4L25.1 124.9L24.2 124.4L23.5 123.8L23.0 123.2L22.7 122.6L22.7 121.8L22.8 121.1L23.2 120.2L23.7 119.2L24.5 118.2L25.4 117.0L26.5 115.7L27.7 114.3L29.2 112.8L30.7 111.1L32.4 109.3L34.1 107.4L36.0 105.4L38.0 103.2L40.0 100.9L42.1 98.5L44.2 95.9L46.4 93.3L48.6 90.5L50.8 87.6L52.9 84.7L55.1 81.7L57.2 78.6L59.3 75.5L61.3 72.3L63.3 69.1L65.2 65.9L67.0 62.7L68.8 59.5L70.4 56.3L72.0 53.2L73.5 50.1L74.9 47.2L76.2 44.3L77.5 41.5L78.6 38.9L79.7 36.3L80.6 34.0L81.6 31.8L82.4 29.7L83.2 27.9L83.9 26.2L84.6 24.7L85.3 23.4L86.0 22.4L86.6 21.5L87.3 20.9L87.9 20.5L88.6 20.3L89.3 20.3L90.1 20.6L90.9 21.0L91.8 21.7L92.7 22.6L93.7 23.6L94.8 24.9L96.0 26.3L97.3 27.9L98.7 29.7L100.3 31.5L101.9 33.6L103.6 35.7L105.5 37.9L107.5 40.3L109.6 42.7L111.8 45.2L114.1 47.7L116.5 50.2L119.0 52.8L121.6 55.4L124.3 57.9L127.0 60.5L129.8 63.0L132.7 65.4L135.6 67.9L138.5 70.2L141.4 72.5L144.3 74.7L147.2 76.8L150.1 78.8L152.9 80.7L155.6 82.5L158.3 84.2L160.9 85.9L163.3 87.4L165.7 88.8L167.9 90.1L170.0 91.3L171.9 92.5L173.7 93.5L175.2 94.5L176.6 95.4L177.8 96.3L178.7 97.1L179.5 97.9L180.1 98.6L180.4 99.3L180.5 100.0" pathLength="1"></path>
<g class="loader-spirograph__carrier">
<g class="loader-spirograph__wheel">
<circle class="loader-spirograph__disc" cx="164" cy="100" r="22.4"></circle>
<circle class="loader-spirograph__cog" cx="164" cy="100" r="23.6"></circle>
<circle class="loader-spirograph__hole" cx="169" cy="100" r="1.8"></circle>
<circle class="loader-spirograph__hole" cx="158.4" cy="107.7" r="1.8"></circle>
<circle class="loader-spirograph__hole" cx="160" cy="87.6" r="1.8"></circle>
<circle class="loader-spirograph__hole" cx="180.5" cy="100" r="3.4"></circle>
<circle class="loader-spirograph__pen" cx="180.5" cy="100" r="2"></circle>
</g>
</g>
</svg>
</div>CSS
.loader-spirograph { --ring: light-dark(#cbced3, #2e3035); --gear: color-mix(in oklab, light-dark(#ebedf0, #232529) 70%, transparent); --line: light-dark(#373a40, #f1f2f3); width: 196px; height: 196px; }
.loader-spirograph svg { display: block; width: 100%; height: 100%; overflow: visible; }
.loader-spirograph__ring { fill: none; stroke: var(--ring); }
.loader-spirograph__teeth { fill: none; stroke: var(--ring); stroke-width: 3; stroke-dasharray: 2.1 2.1; }
.loader-spirograph__line { fill: none; stroke: var(--line); stroke-width: 1.2; stroke-linejoin: round; stroke-dasharray: 1; animation: loader-spirograph-draw 6.4s linear infinite; }
/* The carrier takes the wheel round the ring; the wheel turns back on itself as it rolls. */
.loader-spirograph__carrier { transform-box: view-box; transform-origin: 100px 100px; animation: loader-spirograph-carry 6.4s linear infinite; }
.loader-spirograph__wheel { transform-box: view-box; transform-origin: 164px 100px; animation: loader-spirograph-roll 6.4s linear infinite; }
.loader-spirograph__disc { fill: var(--gear); stroke: color-mix(in oklab, light-dark(#6d7179, #7d8087) 80%, transparent); stroke-width: 1; }
.loader-spirograph__cog { fill: none; stroke: color-mix(in oklab, light-dark(#6d7179, #7d8087) 80%, transparent); stroke-width: 2.4; stroke-dasharray: 2.1 2.1; }
.loader-spirograph__hole { fill: none; stroke: color-mix(in oklab, light-dark(#6d7179, #7d8087) 70%, transparent); stroke-width: 1; }
.loader-spirograph__pen { fill: var(--line); }
@keyframes loader-spirograph-draw { 0.00% { stroke-dashoffset: 1.0000; } 1.41% { stroke-dashoffset: 0.9913; } 2.81% { stroke-dashoffset: 0.9723; } 4.22% { stroke-dashoffset: 0.9477; } 5.63% { stroke-dashoffset: 0.9253; } 7.03% { stroke-dashoffset: 0.9117; } 8.44% { stroke-dashoffset: 0.9057; } 9.84% { stroke-dashoffset: 0.8911; } 11.25% { stroke-dashoffset: 0.8682; } 12.66% { stroke-dashoffset: 0.8439; } 14.06% { stroke-dashoffset: 0.8256; } 15.47% { stroke-dashoffset: 0.8178; } 16.88% { stroke-dashoffset: 0.8082; } 18.28% { stroke-dashoffset: 0.7883; } 19.69% { stroke-dashoffset: 0.7637; } 21.09% { stroke-dashoffset: 0.7418; } 22.50% { stroke-dashoffset: 0.7293; } 23.91% { stroke-dashoffset: 0.7230; } 25.31% { stroke-dashoffset: 0.7075; } 26.72% { stroke-dashoffset: 0.6841; } 28.13% { stroke-dashoffset: 0.6600; } 29.53% { stroke-dashoffset: 0.6426; } 30.94% { stroke-dashoffset: 0.6355; } 32.34% { stroke-dashoffset: 0.6249; } 33.75% { stroke-dashoffset: 0.6044; } 35.16% { stroke-dashoffset: 0.5796; } 36.56% { stroke-dashoffset: 0.5584; } 37.97% { stroke-dashoffset: 0.5469; } 39.38% { stroke-dashoffset: 0.5402; } 40.78% { stroke-dashoffset: 0.5238; } 42.19% { stroke-dashoffset: 0.5000; } 43.59% { stroke-dashoffset: 0.4762; } 45.00% { stroke-dashoffset: 0.4598; } 46.41% { stroke-dashoffset: 0.4531; } 47.81% { stroke-dashoffset: 0.4416; } 49.22% { stroke-dashoffset: 0.4204; } 50.63% { stroke-dashoffset: 0.3956; } 52.03% { stroke-dashoffset: 0.3751; } 53.44% { stroke-dashoffset: 0.3645; } 54.84% { stroke-dashoffset: 0.3574; } 56.25% { stroke-dashoffset: 0.3400; } 57.66% { stroke-dashoffset: 0.3159; } 59.06% { stroke-dashoffset: 0.2925; } 60.47% { stroke-dashoffset: 0.2770; } 61.87% { stroke-dashoffset: 0.2707; } 63.28% { stroke-dashoffset: 0.2582; } 64.69% { stroke-dashoffset: 0.2363; } 66.09% { stroke-dashoffset: 0.2117; } 67.50% { stroke-dashoffset: 0.1918; } 68.91% { stroke-dashoffset: 0.1822; } 70.31% { stroke-dashoffset: 0.1744; } 71.72% { stroke-dashoffset: 0.1561; } 73.13% { stroke-dashoffset: 0.1318; } 74.53% { stroke-dashoffset: 0.1089; } 75.94% { stroke-dashoffset: 0.0943; } 77.34% { stroke-dashoffset: 0.0883; } 78.75% { stroke-dashoffset: 0.0747; } 80.16% { stroke-dashoffset: 0.0523; } 81.56% { stroke-dashoffset: 0.0277; } 82.97% { stroke-dashoffset: 0.0087; } 84.38% { stroke-dashoffset: 0.0000; } 92% { opacity: 1; } 99% { opacity: 0; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes loader-spirograph-carry { 0% { transform: rotate(0deg); } 84.38%, 100% { transform: rotate(1080deg); } }
@keyframes loader-spirograph-roll { 0% { transform: rotate(0deg); } 84.38%, 100% { transform: rotate(-3960deg); } }
@media (prefers-reduced-motion: reduce) {
.loader-spirograph * { animation: none !important; }
.loader-spirograph__line { stroke-dashoffset: 0; }
}Goal: Create a "Spirograph" loader.
Visual behavior: A toothed wheel rolls round inside a ring and its pen draws the eight-petal figure in step with it, then the line fades.
Technique:
- Pure CSS: every motion is a keyframe animation, so the plain HTML version needs no script.
- The figure is a real hypotrochoid: a wheel with an 8 : 3 ratio to the ring, so the line closes after three laps with eight petals.
- The pen moves evenly round the wheel, not evenly along the line, so the dash keyframes are sampled by arc length to keep the line under the pen.
- The wheel turns as it rolls, carrier and wheel each on their own rotation, then the finished figure holds and fades before the next run.
Accessibility: The root has role="status" and aria-label="Loading"; everything inside it is aria-hidden. Under prefers-reduced-motion the finished figure shows with the wheel at rest.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: neutral only. Black, white and grays, no hues. Use the color values above as written, or my project's closest neutral tokens.
Return a single self-contained component. No dependencies.Goal: Create a "Spirograph" loader.
Visual behavior: A toothed wheel rolls round inside a ring and its pen draws the eight-petal figure in step with it, then the line fades.
Technique:
- Pure CSS: every motion is a keyframe animation, so the plain HTML version needs no script.
- The figure is a real hypotrochoid: a wheel with an 8 : 3 ratio to the ring, so the line closes after three laps with eight petals.
- The pen moves evenly round the wheel, not evenly along the line, so the dash keyframes are sampled by arc length to keep the line under the pen.
- The wheel turns as it rolls, carrier and wheel each on their own rotation, then the finished figure holds and fades before the next run.
Accessibility: The root has role="status" and aria-label="Loading"; everything inside it is aria-hidden. Under prefers-reduced-motion the finished figure shows with the wheel at rest.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: use my project's existing color tokens. The color values above are grayscale placeholders. Map each one by its role (surface, text, border, accent, glow) to my theme, and keep their relative lightness so contrast and the effect still read.
Return a single self-contained component. No dependencies.Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Free to use in any project, commercial included. MIT-0, no attribution required. Licence
About this component
A toothed wheel rolls round inside a ring and its pen draws the eight-petal figure in step with it, then the line fades.
- Dependencies
- None
- Difficulty
- Advanced
- Triggers
- continuous, loop, draw
- Techniques
- svg, stroke dashoffset, keyframes, transform only
- Reduced motion
- Respected
- Theme
- Light and dark (follows your page's color-scheme)
The root has role="status" and aria-label="Loading"; everything inside it is aria-hidden. Under prefers-reduced-motion the finished figure shows with the wheel at rest.