kitbash Sign in Connect agent
Components

Ticker

An endless mint band of live Courier readouts between two hairlines.

Part of the style

Clip Over Headline

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --ink: #1d0c0d;
  --black: #070001;
  --paper: #ff7eb1;
  --chip: #ed75a4;
  --chip-hover: #df6e9b;
  --ink-soft: #5f1f3b;
  --line: #dd6d99;
  --on-signal: #ff7eb1;
  --sky: #e55282;
  --signal: #b56a77;
  --mint: #c28991;
  --screen-top: #92787b;
  --screen-bottom: #9f747a;
  --stop: #623c3f;
}
</style>

<section class="ticker" aria-label="Live from the hides">
  <div class="ticker__head">
    <span class="ticker__live"><span class="ticker__dot" aria-hidden="true"></span>Live from the hides</span>
    <span class="ticker__note">Updated every few seconds, give or take a heron</span>
  </div>
  <div class="ticker__band">
    <div class="ticker__track">
      <span class="ticker__item"><b class="ticker__key">Hide 03</b> heron, still standing <span class="ticker__value">00:41:12</span></span>
      <span class="ticker__item"><b class="ticker__key">Hide 07</b> owl, one eye open <span class="ticker__value">02:03:55</span></span>
      <span class="ticker__item"><b class="ticker__key">Hide 11</b> cat, cushion claimed <span class="ticker__value">05:17:40</span></span>
      <span class="ticker__item"><b class="ticker__key">Hide 02</b> parrot, said one word <span class="ticker__value">00:00:04</span></span>
      <span class="ticker__item"><b class="ticker__key">Viewers</b> watching very little <span class="ticker__value">1,284</span></span>
    </div>
  </div>
</section>

<style>
  .ticker {
    padding: var(--space-l) 0;
    background: var(--paper);
  }
  .ticker__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-s) var(--space-l);
    padding: 0 var(--edge) var(--space-m);
    font-size: var(--text-m);
  }
  .ticker__live {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
    color: var(--black);
  }
  .ticker__dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-round);
    background: var(--stop);
    animation: ticker-blink 1.6s var(--ease) infinite;
  }
  .ticker__note { color: var(--ink-soft); }

  .ticker__band {
    overflow: hidden;
    border-block: var(--hairline) solid var(--ink);
    background: var(--mint);
  }
  .ticker__track {
    display: flex;
    width: max-content;
    animation: ticker-roll 32s linear infinite;
  }
  .ticker__band:hover .ticker__track { animation-play-state: paused; }
  .ticker.is-offscreen .ticker__track,
  .ticker.is-offscreen .ticker__dot { animation-play-state: paused; }
  .ticker__item {
    flex: none;
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-s);
    padding: var(--space-m) var(--space-xl) var(--space-m) 0;
    white-space: nowrap;
    font-size: var(--text-m);
    line-height: var(--text-leading);
  }
  .ticker__key { font-weight: 700; }
  .ticker__value {
    padding: 0 var(--space-xs);
    border-radius: var(--radius-chip);
    background: var(--paper);
  }

  @keyframes ticker-roll { to { transform: translateX(-50%); } }
  @keyframes ticker-blink { 50% { opacity: 0.2; } }

  @media (prefers-reduced-motion: reduce) {
    .ticker__track, .ticker__dot { animation: none; }
    .ticker__band { overflow-x: auto; }
  }
</style>

<script>
(() => {
  for (const root of document.querySelectorAll('.ticker')) {
    const track = root.querySelector('.ticker__track');
    for (const item of [...track.children]) {
      const copy = item.cloneNode(true);
      copy.setAttribute('aria-hidden', 'true');
      track.append(copy);
    }
    new IntersectionObserver(([entry]) => {
      root.classList.toggle('is-offscreen', !entry.isIntersecting);
    }).observe(root);
  }
})();
</script>

Similar components

Orbit rings

Orbit rings

Emblem shelf ticker

Emblem shelf ticker

Earned-coins ticker

Earned-coins ticker

Drifting frames

Drifting frames

Tilted word ticker

Tilted word ticker

Discipline ticker and machine reel

Discipline ticker and machine reel

Reed ribbon

Reed ribbon

Red word band

Red word band