kitbash Sign in Connect agent
Components

Filling statement

A centred condensed statement whose words fill from faint orange to ink one after another, with a few words left orange and tilted pill notes popping onto it.

Part of the style

Tangerine Pill Parade

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --blush: #8b8589;
  --cream: #959093;
  --sand: #898487;
  --shell: #8f8a8d;
  --ink: #000001;
  --ink-soft: #0e1217;
  --white: #e5e0e3;
  --orange: #2b3f5d;
  --orange-deep: #546887;
  --orange-faint: rgba(97, 119, 153, 0.45);
}
</style>

<section class="statement">
  <p class="statement__label">A word from the bench</p>
  <div class="statement__body">
    <p class="statement__text">We keep the workshop small on purpose. Two pairs of hands, one repair stand, and every bike gets <span class="statement__hot">the whole afternoon.</span> We fix what you already ride, or make it <span class="statement__hot">ride better.</span></p>
    <span class="statement__pill" style="--x: 58%; --y: 6%; --tilt: 6deg; --order: 0">Two mechanics, no robots</span>
    <span class="statement__pill" style="--x: 4%; --y: 46%; --tilt: -8deg; --order: 1">Coffee on the bench</span>
    <span class="statement__pill" style="--x: 62%; --y: 70%; --tilt: -4deg; --order: 2">Allergic to upsells</span>
  </div>
</section>

<style>
  .statement {
    overflow-x: clip;
    padding: var(--section-space) var(--edge);
    background: var(--cream);
    text-align: center;
  }
  .statement__label {
    margin: 0 0 var(--space-l);
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }
  .statement__body {
    position: relative;
    max-width: 17em;
    margin: 0 auto;
    font-size: var(--display-m);
  }
  .statement__text {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-stretch: var(--display-width);
    font-size: 1em;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }
  .statement__word {
    color: var(--orange-faint);
    transition: color 300ms var(--ease);
    transition-delay: calc(var(--i, 0) * 45ms);
  }
  .statement.is-seen .statement__word { color: var(--ink); }
  .statement.is-seen .statement__hot .statement__word { color: var(--orange); }
  .statement__pill {
    position: absolute;
    left: var(--x);
    top: var(--y);
    padding: 7px 14px;
    border-radius: var(--pill);
    background: var(--orange);
    color: var(--white);
    font-family: var(--font-body);
    font-size: clamp(11px, 1.1vw, 14px);
    font-weight: 500;
    white-space: nowrap;
    rotate: var(--tilt);
    scale: 0;
    transition: scale 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(1300ms + var(--order) * 160ms);
  }
  .statement.is-seen .statement__pill { scale: 1; }

  @media (prefers-reduced-motion: reduce) {
    .statement__word { color: var(--ink); transition: none; }
    .statement__hot .statement__word { color: var(--orange); }
    .statement__pill { scale: 1; transition: none; }
  }
</style>

<script>
  (() => {
    const split = (node, counter) => {
      for (const child of [...node.childNodes]) {
        if (child.nodeType === Node.ELEMENT_NODE) {
          split(child, counter);
          continue;
        }
        if (child.nodeType !== Node.TEXT_NODE) continue;
        const fragment = document.createDocumentFragment();
        for (const part of child.textContent.split(/(\s+)/)) {
          if (!part) continue;
          if (/^\s+$/.test(part)) {
            fragment.append(part);
            continue;
          }
          const word = document.createElement('span');
          word.className = 'statement__word';
          word.style.setProperty('--i', counter.n++);
          word.textContent = part;
          fragment.append(word);
        }
        child.replaceWith(fragment);
      }
    };
    const seen = new IntersectionObserver((entries) => {
      for (const entry of entries) {
        if (!entry.isIntersecting) continue;
        entry.target.classList.add('is-seen');
        seen.unobserve(entry.target);
      }
    }, { threshold: 0.2 });
    for (const root of document.querySelectorAll('.statement')) {
      split(root.querySelector('.statement__text'), { n: 0 });
      seen.observe(root);
    }
  })();
</script>

Similar components

Small caps statement

Small caps statement

Statement with pills

Statement with pills

Words lighting up

Words lighting up

Process reader

Process reader

Situation and answer

Situation and answer

Dictionary entry

Dictionary entry

Spread-letter practice

Spread-letter practice

Script statement

Script statement