Exhibit 19 of 23

The emote wheel

Pick a dance from the wheel and the robot from the club floor dances it. The ring is laid out by trigonometry in CSS; the dancing is @keyframes chosen by :has().

The exhibit

Pick a dance

How it works

Every spoke knows its index, --i, from its style attribute. Its angle is --i × 45deg − 90deg, so the first sits at twelve o’clock, and translate: calc(cos(var(--a)) * var(--rx)) calc(sin(var(--a)) * var(--ry)) moves it out from the middle to the rim. There are two radii, --rx across and --ry down, so on a narrow screen the ring becomes an ellipse. No positions were worked out by hand; change the radii and the ring grows.

The spokes are the labels of radio buttons. .emotes:has(#mv-wave:checked) .arm.r gives the robot’s right arm the wave keyframes, and so on for each dance, limb by limb. “Stand still” is picked to start with, so nothing moves until you ask.

The key CSS

Cut from this exhibit’s stylesheet as it is served.

/* the ring: each spoke's angle from its index, and its place from cos() and sin() of it */
@supports (width: calc(1px * sin(30deg))) {
  /* an ellipse on narrow screens: wide as it can be, and as tall as it needs to keep the spokes apart */
  .x-wheel .ring { --rx: min(150px, 50vw - 96px); --ry: 150px; position: relative; width: calc(2 * var(--rx) + 100px); height: calc(2 * var(--ry) + 56px); display: grid; place-items: center; }
  .x-wheel .spoke {
    --a: calc(var(--i) * 45deg - 90deg);   /* the first spoke at twelve o'clock, then every 45 degrees */
    position: absolute; left: 50%; top: 50%;
    translate: calc(cos(var(--a)) * var(--rx) - 50%) calc(sin(var(--a)) * var(--ry) - 50%);
  }
}
/* without trigonometry: the spokes sit in a plain grid above the robot */
@supports not (width: calc(1px * sin(30deg))) {
  .x-wheel .ring { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 420px; }
  .x-wheel .dancer { flex-basis: 100%; margin: 20px auto 0; }
}

/* the picked dance: :has() on the wheel starts the right keyframes on the right limbs */
.x-wheel .emotes:has(#mv-wave:checked) .arm.r { animation: wave .6s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-bob:checked) .dancer { animation: bob .5s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-spin:checked) .dancer { animation: spin 1.6s linear infinite; }
.x-wheel .emotes:has(#mv-robot:checked) .arm.l { animation: robot-l 1s steps(1) infinite; }
.x-wheel .emotes:has(#mv-robot:checked) .arm.r { animation: robot-r 1s steps(1) infinite; }
.x-wheel .emotes:has(#mv-robot:checked) .head { animation: robot-head 1s steps(1) infinite; }
.x-wheel .emotes:has(#mv-step:checked) .dancer { animation: step 1s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-step:checked) .leg.l { animation: kick .5s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-step:checked) .leg.r { animation: kick .5s ease-in-out infinite alternate-reverse; }
.x-wheel .emotes:has(#mv-jump:checked) .dancer { animation: jump .7s cubic-bezier(.3, 0, .3, 1) infinite alternate; }
.x-wheel .emotes:has(#mv-jump:checked) .arm.l { animation: flap-l .7s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-jump:checked) .arm.r { animation: flap-r .7s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-up:checked) .arm.l { animation: up-l .5s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-up:checked) .arm.r { animation: up-r .5s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-up:checked) .dancer { animation: bob .5s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-shuffle:checked) .leg.l { animation: kick .25s ease-in-out infinite alternate; }
.x-wheel .emotes:has(#mv-shuffle:checked) .leg.r { animation: kick .25s ease-in-out infinite alternate-reverse; }
.x-wheel .emotes:has(#mv-shuffle:checked) .dancer { animation: step .5s ease-in-out infinite alternate; }

/* reduced motion: every dance is a held pose (its keyframes, paused part way through) */
@media (prefers-reduced-motion: reduce) {
  .x-wheel .part, .x-wheel .dancer { animation-play-state: paused !important; animation-delay: -.3s !important; }
}

Accessibility

The dances are radio buttons in a fieldset, so Tab reaches the wheel and the arrow keys go round it, each one announced by name. The robot is a picture with a label; what it is doing is written under it, but that line is decoration, and a screen reader hears only which radio is checked. Under reduced motion nothing loops: each dance becomes a held pose. Once picked, a dance keeps going until you pick Stand still, which a script could also stop on its own after a while.

Browser support

  • sin() and cos() Works in this browser.Not in this browser: The dances sit in a plain grid above the robot instead of round it. Checked 2026-11-13: Chromium 140 yes, Firefox 141 yes.
  • :has() Works in this browser.Not in this browser: Without :has() it can’t work; the page says so instead of half-working. Checked 2026-11-13: Chromium 140 yes, Firefox 141 yes.
  • :checked + ~ Works in this browser.Not in this browser: Nothing to fall back from; every browser has had it for years. Checked 2026-11-13: Chromium 140 yes, Firefox 141 yes.
Slop at the top