kitbash Sign in Connect agent
Components

Filling statement

A drifting row of grey customer marks with a handwritten aside, then a huge statement whose lead-in sits in a grey box and whose words fill to black as you scroll.

Part of the style

Sky Pill App Window

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

Preview

Code
<style>
/* Goes after the pack's base.css */
@import url("https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;0,6..96,500;1,6..96,400&family=Inter+Tight:wght@400;500;700&display=swap");
:root {
  --font-body: "Inter Tight", "Helvetica Neue", sans-serif;
  --font-hand: "Bodoni Moda", "Didot", serif;
}
</style>

<section class="statement">
  <div class="statement__inner">
    <p class="statement__kicker">Kept by growers at</p>
    <div class="statement__marquee">
      <div class="statement__track">
        <span class="statement__logo statement__logo--serif">Hollin &amp; Daughters</span>
        <span class="statement__logo statement__logo--caps">Westmere</span>
        <span class="statement__logo statement__logo--round">greenrow</span>
        <span class="statement__logo statement__logo--italic">Pellow Farm</span>
        <span class="statement__logo statement__logo--caps">Orchid Cellar</span>
        <span class="statement__logo statement__logo--round">tilth.co</span>
        <span class="statement__logo statement__logo--serif">Brackenridge</span>
      </div>
    </div>
    <p class="statement__aside">
      <svg class="statement__arrow" viewBox="0 0 48 70" width="40" height="58" aria-hidden="true"><path d="M44 66C14 64 4 44 10 24 14 12 24 6 34 4M26 1l9 3-6 7" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
      * Each of these runs ten or more benches on it
    </p>

    <h2 class="statement__text">
      <span class="statement__lead">Before the kettle boils:</span>
      Water the benches. Log the seed trays. Order the compost. Send the market list.
    </h2>
    <a class="statement__button" href="#">Start growing</a>
  </div>
</section>

<style>
  .statement {
    padding: var(--space-xl) var(--edge) var(--section-space);
  }
  .statement__inner {
    max-width: var(--column);
    margin: 0 auto;
  }
  .statement__kicker {
    margin: 0 0 var(--space-s);
    color: var(--ink-faint);
    font-size: var(--text-m);
  }
  .statement__marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  }
  .statement__track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: statement-roll 40s linear infinite;
  }
  .statement__marquee:hover .statement__track {
    animation-play-state: paused;
  }
  .statement__logo {
    flex: none;
    padding-right: clamp(32px, 5vw, 56px);
    color: var(--ink-faint);
    font-size: 22px;
    line-height: 56px;
    white-space: nowrap;
    opacity: 0.85;
  }
  .statement__logo--serif {
    font-style: italic;
    font-weight: 600;
    letter-spacing: -0.03em;
  }
  .statement__logo--caps {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
  }
  .statement__logo--round {
    font-weight: 700;
    letter-spacing: -0.04em;
  }
  .statement__logo--italic {
    font-family: var(--font-hand);
    font-size: 30px;
  }
  @keyframes statement-roll {
    to { transform: translateX(-50%); }
  }
  .statement__aside {
    position: relative;
    margin: var(--space-xs) 0 0;
    padding-left: var(--space-s);
    color: var(--ink-faint);
    font-family: var(--font-hand);
    font-size: 22px;
    line-height: 1.2;
  }
  .statement__arrow {
    position: absolute;
    left: -46px;
    top: -44px;
    color: var(--ink-faint);
  }
  .statement__text {
    margin: clamp(64px, 9vw, 120px) 0 var(--space-l);
    font-size: var(--display);
    font-weight: 700;
    line-height: var(--leading-head);
    letter-spacing: var(--track-tight);
  }
  .statement__lead {
    padding: 0 0.08em;
    background: var(--line);
    color: var(--ink-faint);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }
  .statement__word {
    color: var(--ink-faint);
    transition: color var(--move) var(--ease);
  }
  .statement__word.is-lit {
    color: var(--ink);
  }
  .statement__button {
    display: inline-flex;
    align-items: center;
    min-height: 50px;
    padding: 0 var(--space-l);
    border-radius: var(--radius-m);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--quick) var(--ease), transform var(--move) var(--ease);
  }
  .statement__button:hover {
    background: var(--accent-deep);
  }
  .statement__button:active {
    transform: translateY(1px);
  }
  .statement__button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  @media (max-width: 1100px) {
    .statement__arrow {
      display: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .statement__track {
      animation: none;
    }
    .statement__word {
      color: var(--ink);
    }
  }
</style>

<script>
  (() => {
    const still = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    for (const root of document.querySelectorAll('.statement')) {
      const track = root.querySelector('.statement__track');
      for (const item of [...track.children]) {
        const copy = item.cloneNode(true);
        copy.setAttribute('aria-hidden', 'true');
        track.append(copy);
      }

      // Wrap each word after the lead-in so it can fill from grey to black.
      const text = root.querySelector('.statement__text');
      for (const node of [...text.childNodes]) {
        if (node.nodeType !== Node.TEXT_NODE || !node.textContent.trim()) continue;
        const frag = document.createDocumentFragment();
        for (const part of node.textContent.split(/(\s+)/)) {
          if (!part.trim()) { frag.append(part); continue; }
          const word = document.createElement('span');
          word.className = 'statement__word';
          word.textContent = part;
          frag.append(word);
        }
        node.replaceWith(frag);
      }
      const words = [...root.querySelectorAll('.statement__word')];
      if (still) continue;

      let ticking = false;
      const paint = () => {
        ticking = false;
        const box = text.getBoundingClientRect();
        const view = window.innerHeight;
        const progress = Math.min(1, Math.max(0, (view * 0.92 - box.top) / (view * 0.45)));
        const lit = Math.round(progress * words.length);
        words.forEach((word, i) => word.classList.toggle('is-lit', i < lit));
      };
      const ask = () => { if (!ticking) { ticking = true; requestAnimationFrame(paint); } };
      const watch = new IntersectionObserver(([entry]) => {
        if (entry.isIntersecting) { window.addEventListener('scroll', ask, { passive: true }); ask(); }
        else window.removeEventListener('scroll', ask);
      });
      watch.observe(text);
      window.addEventListener('resize', ask);
    }
  })();
</script>

Similar components

Script statement

Script statement

Window glimpse and statement

Window glimpse and statement

Matted diff feature

Matted diff feature

Dark ask panel

Dark ask panel

Published page

Published page

Situation and answer

Situation and answer

Privacy panel

Privacy panel

Night statement and figures

Night statement and figures