kitbash Sign in Connect agent
Components

Dial showcase

The signature piece. A grained mint panel with a close-up of the instrument: curved tempo words, ticks, polished markers, a set hand and a pendulum needle swinging on the beat. A sun and moon switch turns the panel black and the numerals to glowing lume; five face swatches recolour the panel and its glow.

Part of the style

Quiet Instrument

7 parts that belong together, with their tokens, type and rules.

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --page: #b7a6ee;
  --card: #c1b0f9;
  --ink: #160e1b;
  --ink-mid: rgba(22, 14, 27, 0.7);
  --ink-soft: #5d5281;
  --ink-faint: #4f446e;
  --chip: #b3a2e9;
  --emboss: #a898db;
  --night: #140c1a;
  --graphite: #17091f;
  --on-dark: #bcabf4;
  --mint-soft: #b2a1e7;
  --face-paper: #baa9f2;
  --face-paper-ink: #372840;
  --face-glacier: #998ac8;
  --face-glacier-ink: #43324e;
  --face-harbour-ink: #b4a3ea;
  --chrome-light: #c1b0f9;
  --chrome: #ae9de2;
  --chrome-dark: #7b6ea2;
  --lume: #937bb8;
  --mint: #a96ace;
  --aqua: #c353fc;
  --lume-ice: #b75be9;
  --mint-ink: #310047;
  --face-court: #b621f6;
  --green: #680d8f;
  --deep: #592b71;
  --deep-dark: #432255;
  --lume-lime: #a36dc4;
  --face-court-ink: #986cb3;
  --face-harbour: #674d7b;
}
</style>

<section class="dial">
  <div class="dial__panel" data-face="mint">
    <svg class="dial__grain" aria-hidden="true" focusable="false">
      <filter id="dial-grain">
        <feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" stitchTiles="stitch" />
        <feColorMatrix type="saturate" values="0" />
      </filter>
      <rect width="100%" height="100%" filter="url(#dial-grain)" />
    </svg>

    <h2 class="dial__title">A face for every room.</h2>
    <p class="dial__text">Crisp ink in daylight, a slow glow after dark, and care in every single tick.</p>

    <svg class="dial__face" viewBox="0 0 520 298" role="img" aria-label="Close-up of the tempo dial: numerals from 60 to 140, polished markers, a hand set to 72 and a pendulum needle swinging on the beat.">
      <defs>
        <filter id="dial-lift" x="-30%" y="-30%" width="170%" height="170%">
          <feDropShadow class="dial__lift-shadow" dx="3" dy="5" stdDeviation="3.5" />
        </filter>
        <filter id="dial-glow" x="-20%" y="-20%" width="140%" height="140%">
          <feGaussianBlur stdDeviation="5" result="halo" />
          <feMerge><feMergeNode in="halo" /><feMergeNode in="SourceGraphic" /></feMerge>
        </filter>
        <linearGradient id="dial-chrome" x1="0" y1="0" x2="1" y2="0">
          <stop class="dial__stop-edge" offset="0" />
          <stop class="dial__stop-lit" offset="0.38" />
          <stop class="dial__stop-body" offset="0.72" />
          <stop class="dial__stop-edge" offset="1" />
        </linearGradient>
        <path id="dial-ring" d="M73.1 416.8A244 244 0 1 1 446.9 416.8" />
        <g id="dial-marker">
          <rect class="dial__marker" x="255" y="27" width="10" height="38" rx="5" />
          <rect class="dial__marker-inlay" x="258" y="31" width="4" height="30" rx="2" />
        </g>
      </defs>

      <g class="dial__lit">
        <text class="dial__words">
          <textPath href="#dial-ring" startOffset="26.9%">ADAGIO</textPath>
          <textPath href="#dial-ring" startOffset="42.3%">ANDANTE</textPath>
          <textPath href="#dial-ring" startOffset="58.5%">MODERATO</textPath>
          <textPath href="#dial-ring" startOffset="73.8%">ALLEGRO</textPath>
        </text>
        <path class="dial__ticks" d="M75.4 368.3A214 214 0 1 1 444.6 368.3" pathLength="240.8" />
        <g class="dial__numerals">
          <text x="133.6" y="333">40</text>
          <text x="116.2" y="234.6">60</text>
          <text x="166.2" y="148.2">80</text>
          <text x="260" y="114">100</text>
          <text x="353.8" y="148.2">120</text>
          <text x="403.8" y="234.6">140</text>
          <text x="386.4" y="333">160</text>
        </g>
      </g>
      <g class="dial__markers">
        <use href="#dial-marker" transform="rotate(-120 260 260)" />
        <use href="#dial-marker" transform="rotate(-100 260 260)" />
        <use href="#dial-marker" transform="rotate(-80 260 260)" />
        <use href="#dial-marker" transform="rotate(-60 260 260)" />
        <use href="#dial-marker" transform="rotate(-40 260 260)" />
        <use href="#dial-marker" transform="rotate(-20 260 260)" />
        <use href="#dial-marker" />
        <use href="#dial-marker" transform="rotate(20 260 260)" />
        <use href="#dial-marker" transform="rotate(40 260 260)" />
        <use href="#dial-marker" transform="rotate(60 260 260)" />
        <use href="#dial-marker" transform="rotate(80 260 260)" />
        <use href="#dial-marker" transform="rotate(100 260 260)" />
        <use href="#dial-marker" transform="rotate(120 260 260)" />
      </g>
      <g class="dial__hands">
        <g transform="rotate(-56 260 260)">
          <rect class="dial__hand" x="253.5" y="112" width="13" height="168" rx="6.5" />
          <rect class="dial__hand-inlay" x="257.5" y="121" width="5" height="100" rx="2.5" />
        </g>
        <g class="dial__pendulum">
          <line class="dial__needle-edge" x1="260" y1="308" x2="260" y2="50" />
          <line class="dial__needle" x1="260" y1="308" x2="260" y2="50" />
          <rect class="dial__weight" x="249" y="122" width="22" height="30" rx="5" />
        </g>
        <circle class="dial__pivot" cx="260" cy="260" r="13" />
        <circle class="dial__pivot-eye" cx="260" cy="260" r="4.5" />
      </g>
    </svg>

    <div class="dial__controls">
      <button class="dial__mode" type="button" role="switch" aria-checked="false" aria-label="Night glow">
        <span class="dial__mode-knob"></span>
        <svg class="dial__mode-icon dial__mode-icon--sun" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
          <circle cx="12" cy="12" r="3.6" />
          <path d="M12 3.5v2M12 18.5v2M3.5 12h2M18.5 12h2M6 6l1.4 1.4M16.6 16.6 18 18M18 6l-1.4 1.4M7.4 16.6 6 18" />
        </svg>
        <svg class="dial__mode-icon dial__mode-icon--moon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
          <path d="M19.5 14.2A7.8 7.8 0 0 1 9.8 4.5a7.8 7.8 0 1 0 9.7 9.7Z" />
        </svg>
      </button>

      <svg class="dial__sprite" aria-hidden="true" focusable="false">
        <symbol id="dial-chip" viewBox="0 0 64 64">
          <circle class="dial__chip-ticks" cx="32" cy="98" r="76" pathLength="360" />
          <rect class="dial__chip-marker" x="29" y="11" width="6" height="21" rx="3" />
          <text class="dial__chip-number" x="32" y="45">100</text>
        </symbol>
      </svg>
      <div class="dial__faces" role="group" aria-label="Face">
        <button class="dial__swatch is-selected" type="button" aria-pressed="true" data-face="mint">
          <svg class="dial__chip" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><use href="#dial-chip" /></svg>
          <span class="dial__label">Mint</span>
        </button>
        <button class="dial__swatch" type="button" aria-pressed="false" data-face="paper">
          <svg class="dial__chip" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><use href="#dial-chip" /></svg>
          <span class="dial__label">Paper</span>
        </button>
        <button class="dial__swatch" type="button" aria-pressed="false" data-face="glacier">
          <svg class="dial__chip" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><use href="#dial-chip" /></svg>
          <span class="dial__label">Glacier</span>
        </button>
        <button class="dial__swatch" type="button" aria-pressed="false" data-face="harbour">
          <svg class="dial__chip" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><use href="#dial-chip" /></svg>
          <span class="dial__label">Harbour</span>
        </button>
        <button class="dial__swatch" type="button" aria-pressed="false" data-face="court">
          <svg class="dial__chip" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><use href="#dial-chip" /></svg>
          <span class="dial__label">Court</span>
        </button>
      </div>
    </div>
  </div>
</section>

<style>
  .dial {
    padding: calc(var(--gutter) / 2) var(--edge);
  }

  /* A face is three colours: the field, the ink printed on it, and the glow it gets at night. */
  .dial [data-face="mint"] {
    --dial-face: var(--mint);
    --dial-ink: var(--mint-ink);
    --dial-lume: var(--lume);
  }
  .dial [data-face="paper"] {
    --dial-face: var(--face-paper);
    --dial-ink: var(--face-paper-ink);
    --dial-lume: var(--lume);
  }
  .dial [data-face="glacier"] {
    --dial-face: var(--face-glacier);
    --dial-ink: var(--face-glacier-ink);
    --dial-lume: var(--lume-ice);
  }
  .dial [data-face="harbour"] {
    --dial-face: var(--face-harbour);
    --dial-ink: var(--face-harbour-ink);
    --dial-lume: var(--lume-ice);
  }
  .dial [data-face="court"] {
    --dial-face: var(--face-court);
    --dial-ink: var(--face-court-ink);
    --dial-lume: var(--lume-lime);
  }

  .dial__panel {
    --dial-text: var(--ink);
    --dial-metal: url(#dial-chrome);
    --dial-metal-edge: var(--chrome-dark);
    --dial-inlay: var(--chrome-light);
    position: relative;
    isolation: isolate;
    display: grid;
    justify-items: center;
    overflow: hidden;
    padding: var(--card-pad) var(--card-pad-s) clamp(1.5rem, 3.4vw, 3rem);
    border-radius: var(--radius-card);
    background: var(--dial-face);
    color: var(--dial-text);
    text-align: center;
    transition: background-color var(--time-slow) var(--ease-out), color var(--time-slow) var(--ease-out);
  }
  .dial__panel[data-face="harbour"],
  .dial__panel[data-face="court"],
  .dial__panel.is-night {
    --dial-text: var(--on-dark);
  }
  .dial__panel.is-night {
    --dial-face: var(--night);
    --dial-ink: var(--dial-lume);
    --dial-metal: color-mix(in srgb, var(--chrome-dark) 28%, var(--night));
    --dial-metal-edge: color-mix(in srgb, var(--chrome-dark) 55%, var(--night));
    --dial-inlay: var(--dial-lume);
  }
  .dial__grain {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    mix-blend-mode: soft-light;
    opacity: 0.55;
    pointer-events: none;
  }

  .dial__title {
    margin: 0 0 var(--space-xs);
    font-size: var(--head-s);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: var(--tracking-head);
    text-wrap: balance;
  }
  .dial__text {
    max-width: 26rem;
    margin: 0;
    line-height: 1.4;
    text-wrap: balance;
  }

  .dial__face {
    display: block;
    width: min(100%, clamp(17rem, 52vw, 56rem));
    height: auto;
    margin-top: var(--space-l);
    -webkit-mask-image: linear-gradient(to bottom, var(--night) 80%, transparent);
    mask-image: linear-gradient(to bottom, var(--night) 80%, transparent);
  }
  .dial__lift-shadow {
    flood-color: var(--ink);
    flood-opacity: 0.26;
  }
  .dial__stop-edge {
    stop-color: var(--chrome-dark);
  }
  .dial__stop-lit {
    stop-color: var(--chrome-light);
  }
  .dial__stop-body {
    stop-color: var(--chrome);
  }

  .dial__words,
  .dial__numerals,
  .dial__chip-number {
    font-family: var(--font-dial);
    text-anchor: middle;
  }
  .dial__words {
    fill: color-mix(in srgb, var(--dial-ink) 80%, transparent);
    font-size: 11.5px;
    letter-spacing: var(--tracking-dial);
  }
  .dial__ticks {
    fill: none;
    stroke: var(--dial-ink);
    stroke-width: 15;
    stroke-dasharray: 0.8 3.2;
  }
  .dial__numerals {
    fill: var(--dial-ink);
    font-size: 31px;
    dominant-baseline: central;
  }
  .dial__words,
  .dial__ticks,
  .dial__numerals,
  .dial__marker,
  .dial__marker-inlay,
  .dial__hand,
  .dial__hand-inlay,
  .dial__needle,
  .dial__needle-edge,
  .dial__weight,
  .dial__pivot {
    transition: fill var(--time-slow) var(--ease-out), stroke var(--time-slow) var(--ease-out);
  }

  /* Day: polished metal that casts a shadow. Night: the metal goes dark and the inlays light up.
     The markers are <use> copies, so their paint comes down as inherited properties, not from selectors. */
  .dial__markers,
  .dial__hands {
    filter: url(#dial-lift);
  }
  .dial__marker,
  .dial__hand,
  .dial__weight {
    fill: var(--dial-metal);
    stroke: var(--dial-metal-edge);
    stroke-width: 1.2;
  }
  .dial__marker-inlay,
  .dial__hand-inlay {
    fill: var(--dial-inlay);
  }
  .dial__pendulum {
    transform-origin: 260px 260px;
    animation: dial-swing var(--beat) var(--ease-swing) infinite alternate;
  }
  .dial__needle-edge {
    stroke: var(--chrome-dark);
    stroke-width: 4.4;
    stroke-linecap: round;
  }
  .dial__needle {
    stroke: var(--chrome-light);
    stroke-width: 2.2;
    stroke-linecap: round;
  }
  .dial__pivot {
    fill: var(--dial-metal);
    stroke: var(--dial-metal-edge);
    stroke-width: 1.5;
  }
  .dial__pivot-eye {
    fill: var(--dial-metal-edge);
  }

  .dial__panel.is-night .dial__lit,
  .dial__panel.is-night .dial__markers {
    filter: url(#dial-glow);
  }
  .dial__panel.is-night .dial__hands {
    filter: none;
  }
  .dial__panel.is-night .dial__needle-edge {
    stroke: transparent;
  }
  .dial__panel.is-night .dial__needle {
    stroke: color-mix(in srgb, var(--dial-lume) 60%, var(--chrome-light));
  }
  .dial__panel.is-night .dial__weight {
    stroke: var(--dial-lume);
  }
  .dial__panel.is-night .dial__grain {
    opacity: 0.12;
  }

  .dial__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-s) var(--space-l);
    margin-top: var(--space-m);
  }
  .dial__mode {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 3rem);
    align-items: center;
    justify-items: center;
    height: 3.5rem;
    margin-top: 0.625rem;
    padding: 0 0.25rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--card) 45%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card) 55%, transparent), 0 0.5rem 1.25rem -0.5rem color-mix(in srgb, var(--ink) 30%, transparent);
    cursor: pointer;
    transition: background-color var(--time-slow) var(--ease-out);
  }
  .dial__panel.is-night .dial__mode {
    background: color-mix(in srgb, var(--on-dark) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-dark) 12%, transparent);
  }
  .dial__mode-knob {
    position: absolute;
    top: 0.375rem;
    left: 0.375rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--card);
    box-shadow: var(--shadow-knob);
    transition: transform var(--time) var(--ease-spring);
  }
  .dial__panel.is-night .dial__mode-knob {
    transform: translateX(3rem);
  }
  .dial__mode-icon {
    position: relative;
    width: 1.375rem;
    height: 1.375rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: color-mix(in srgb, var(--dial-text) 60%, transparent);
    transition: color var(--time) var(--ease-out);
  }
  .dial__panel:not(.is-night) .dial__mode-icon--sun,
  .dial__panel.is-night .dial__mode-icon--moon {
    color: var(--ink);
  }

  .dial__sprite {
    position: absolute;
    width: 0;
    height: 0;
  }
  .dial__faces {
    display: flex;
    gap: clamp(0.375rem, 1.6vw, 1rem);
  }
  .dial__swatch {
    display: grid;
    justify-items: center;
    gap: 0.625rem;
    min-width: var(--tap);
    padding: 0.375rem 0.125rem 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: var(--text-xs);
    line-height: 1.2;
    cursor: pointer;
  }
  .dial__chip {
    display: block;
    width: clamp(3rem, 6.6vw, 4rem);
    height: auto;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--dial-face);
    box-shadow: 0 0.375rem 0.75rem -0.375rem color-mix(in srgb, var(--ink) 40%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--card) 30%, transparent);
    outline: 3px solid transparent;
    outline-offset: 3px;
    transition: outline-color var(--time) var(--ease-out), transform var(--time) var(--ease-spring);
  }
  .dial__chip-ticks {
    fill: none;
    stroke: var(--dial-ink);
    stroke-width: 6;
    stroke-dasharray: 1 5;
    stroke-dashoffset: 0.5;
  }
  .dial__chip-marker {
    fill: var(--chrome-light);
    stroke: var(--chrome-dark);
  }
  .dial__chip-number {
    fill: var(--dial-ink);
    font-size: 10.5px;
  }
  .dial__swatch:hover .dial__chip {
    transform: scale(1.06);
  }
  .dial__swatch.is-selected .dial__chip {
    outline-color: currentColor;
  }
  .dial__label {
    opacity: 0.7;
  }
  .dial__swatch.is-selected .dial__label {
    font-weight: 600;
    opacity: 1;
  }
  .dial__mode:focus-visible,
  .dial__swatch:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: var(--radius-inner);
  }
  .dial__mode:focus-visible {
    border-radius: var(--radius-pill);
  }

  @keyframes dial-swing {
    from {
      transform: rotate(-26deg);
    }
    to {
      transform: rotate(26deg);
    }
  }

  @media (max-width: 40rem) {
    .dial__panel {
      padding-inline: var(--space-s);
      border-radius: var(--radius-window);
    }
    .dial__mode {
      margin-top: 0;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .dial__pendulum {
      animation: none;
      transform: rotate(16deg);
    }
    .dial__panel,
    .dial__panel *,
    .dial__chip {
      transition-duration: 0s;
    }
  }
</style>

<script>
  (() => {
    const NIGHT = "is-night";
    const SELECTED = "is-selected";

    const setUpNightSwitch = (panel) => {
      const toggle = panel.querySelector(".dial__mode");
      toggle.addEventListener("click", () => {
        const isNight = panel.classList.toggle(NIGHT);
        toggle.setAttribute("aria-checked", String(isNight));
      });
    };

    const setUpFacePicker = (panel) => {
      const swatches = [...panel.querySelectorAll(".dial__swatch")];
      const markPicked = (picked) => (swatch) => {
        const isPicked = swatch === picked;
        swatch.classList.toggle(SELECTED, isPicked);
        swatch.setAttribute("aria-pressed", String(isPicked));
      };
      const pick = (picked) => {
        panel.dataset.face = picked.dataset.face;
        swatches.forEach(markPicked(picked));
      };
      swatches.forEach((swatch) => swatch.addEventListener("click", () => pick(swatch)));
    };

    document.querySelectorAll(".dial__panel").forEach((panel) => {
      setUpNightSwitch(panel);
      setUpFacePicker(panel);
    });
  })();
</script>

Similar components

Product page

Product page

Product grid

Product grid

Flavour picker

Flavour picker

Shop shelf

Shop shelf

Unboxing hero

Unboxing hero

Book shelf

Book shelf

Feature cells

Feature cells

Keypad and knob

Keypad and knob