kitbash Sign in Connect agent
Components

Numbers

Night chapter where a sand curtain lifts off each panel while its counter runs up, then a mustard arrow pops in. Runs once when seen.

Part of the style

Reed Mono Chapters

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --reed: #0a0d13;
  --bark: #e3fcf2;
  --sand: #000001;
  --night: #fdffff;
  --chalk: #04060b;
  --chalk-dim: #000000;
  --shade: rgba(253, 255, 255, 0.28);
  --bark-veil: rgba(227, 252, 242, 0.2);
  --olive: #5c8174;
  --mustard: #000e09;
  --harbor: #4a8973;
  --sky: #4e7365;
  --signal: #45695d;
  --skin: #66726d;
  --hair: #060908;
  --teal: #4a8973;
}
</style>

<section class="tally">
  <span class="tally__corner" aria-hidden="true">p</span>
  <h2 class="tally__eyebrow">One summer on the pier</h2>
  <ul class="tally__panels">
    <li class="tally__panel">
      <span class="tally__number" data-to="214">214</span>
      <span class="tally__unit">signs set in the ground</span>
      <svg class="tally__arrow" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 19L19 5M9 5h10v10"/></svg>
    </li>
    <li class="tally__panel">
      <span class="tally__number" data-to="38">38</span>
      <span class="tally__unit">pictograms drawn</span>
      <svg class="tally__arrow" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 19L19 5M9 5h10v10"/></svg>
    </li>
    <li class="tally__panel">
      <span class="tally__number" data-to="61">61</span>
      <span class="tally__unit">% fewer people asking the way</span>
      <svg class="tally__arrow" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 19L19 5M9 5h10v10"/></svg>
    </li>
  </ul>
</section>

<style>
  .tally {
    position: relative;
    padding: var(--space-wall) var(--edge);
    background: var(--night);
    color: var(--sand);
  }
  .tally__corner {
    position: absolute;
    top: calc(var(--gutter) - 0.6rem);
    left: var(--gutter);
    color: var(--signal);
    font-family: var(--font-mark);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
  }
  .tally__eyebrow {
    display: inline-block;
    margin: 0 0 var(--space-7);
    padding-bottom: 0.15em;
    border-bottom: var(--rule) solid currentColor;
    font-size: var(--text-m);
    font-weight: 500;
    letter-spacing: var(--tracking-caps);
    line-height: 1;
    text-transform: uppercase;
  }
  .tally__panels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .tally__panel {
    position: relative;
    display: grid;
    align-content: end;
    gap: var(--space-2);
    min-height: clamp(12rem, 9rem + 10vw, 18rem);
    padding: var(--space-4);
    background: var(--harbor);
    overflow: hidden;
  }
  .tally__panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--sand);
    transform-origin: top;
    transition: transform 2s var(--ease-out);
    transition-delay: calc(var(--order, 0) * 150ms + 300ms);
  }
  .tally.is-seen .tally__panel::after { transform: scaleY(0); }
  .tally__number {
    font-size: clamp(3rem, 1.5rem + 5vw, 6rem);
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .tally__unit {
    max-width: 14em;
    font-size: var(--text-s);
    line-height: 1.4;
  }
  .tally__arrow {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: clamp(2rem, 1.5rem + 2vw, 3.25rem);
    fill: none;
    stroke: var(--mustard);
    stroke-width: 2.6;
    stroke-linecap: square;
    scale: 0;
    transition: scale 0.36s var(--ease-pop);
    transition-delay: calc(var(--order, 0) * 150ms + 2450ms);
  }
  .tally.is-seen .tally__arrow { scale: 1; }

  @media (max-width: 48rem) {
    .tally__panels { grid-template-columns: minmax(0, 1fr); }
    .tally__panel { min-height: 9rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    .tally__panel::after { transform: scaleY(0); transition: none; }
    .tally__arrow { scale: 1; transition: none; }
  }
</style>

<script>
  (() => {
    const still = matchMedia('(prefers-reduced-motion: reduce)').matches;
    const runTime = 2000;

    function count(number, delay) {
      const target = Number(number.dataset.to);
      number.textContent = '0';
      const start = performance.now() + delay;
      const tick = (now) => {
        const progress = Math.min(1, Math.max(0, (now - start) / runTime));
        const eased = 1 - Math.pow(1 - progress, 3);
        number.textContent = String(Math.round(target * eased));
        if (progress < 1) requestAnimationFrame(tick);
      };
      requestAnimationFrame(tick);
    }

    const seen = new IntersectionObserver((entries) => {
      for (const entry of entries) {
        if (!entry.isIntersecting) continue;
        seen.unobserve(entry.target);
        entry.target.classList.add('is-seen');
        entry.target.querySelectorAll('.tally__number').forEach((number, order) => count(number, order * 150 + 300));
      }
    }, { threshold: 0.2 });

    for (const root of document.querySelectorAll('.tally')) {
      root.querySelectorAll('.tally__panel').forEach((panel, order) => panel.style.setProperty('--order', order));
      if (!still) seen.observe(root);
    }
  })();
</script>

Similar components

Rolling number row

Rolling number row

Avatar stack and name grid

Avatar stack and name grid

Wallet sheet

Wallet sheet

Bar meters

Bar meters

Holding sheet

Holding sheet

Speckled result figure

Speckled result figure

Dot-matrix tally

Dot-matrix tally

Logo cells and counts

Logo cells and counts