kitbash Sign in Connect agent
Components

Lit statement card

A frosted silver card with one large grotesk statement whose words light from grey to ink as it scrolls into view.

Part of the style

Notched Bezel Cards

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --bezel: #fff9e7;
  --night: #5d5381;
  --night-raised: #413466;
  --silver: #8474b7;
  --silver-shade: #000001;
  --ink: #18003a;
  --ink-mid: #8474b7;
  --ink-soft: #000001;
  --ink-faint: #000001;
  --ink-ghost: #000001;
  --on-dark: #000001;
  --on-dark-soft: #000001;
  --line-dark: rgba(0, 0, 1, 0.16);
  --steel: #8363c7;
  --glow: #170134;
  --deep: #000002;
  --glow-soft: #26064d;
  --signal: #310965;
}
</style>

<section class="statement" aria-label="About">
  <div class="statement__card">
    <span class="statement__sheen" aria-hidden="true"></span>
    <p class="statement__label">About &amp;</p>
    <p class="statement__text">A creative director, speaker and teacher with twenty years at the desk, making slow, careful stories for glass makers, publishers and small museums across print, screen and film.</p>
    <dl class="statement__facts">
      <div class="statement__fact"><dt>Based in</dt><dd>Lisbon &amp; Porto</dd></div>
      <div class="statement__fact"><dt>Teaching</dt><dd>Escola Alta, Visual Narrative</dd></div>
      <div class="statement__fact"><dt>Speaking</dt><dd>Twelve talks this year</dd></div>
    </dl>
  </div>
</section>

<style>
  .statement {
    padding: var(--frame);
    background: var(--bezel);
  }
  .statement__card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: var(--space-l);
    padding: var(--section-space) var(--edge);
    overflow: hidden;
    border-radius: var(--radius-panel);
    background: var(--silver);
    box-shadow: var(--shadow-card);
    text-align: center;
    isolation: isolate;
  }
  .statement__sheen {
    position: absolute;
    inset: -20%;
    z-index: -1;
    background: linear-gradient(120deg, transparent 30%, var(--silver-shade) 48%, transparent 54%, transparent 66%, var(--silver-shade) 78%, transparent 92%);
    opacity: 0.7;
    pointer-events: none;
  }
  .statement__label {
    margin: 0;
    color: var(--ink-faint);
    font: 400 var(--text-micro)/1 var(--font-serif);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .statement__text {
    max-width: 24ch;
    margin: 0;
    color: var(--ink);
    font: 500 var(--text-head)/1.2 var(--font-grotesk);
    letter-spacing: var(--track-tight);
    text-wrap: balance;
  }
  .statement__word {
    color: var(--ink-ghost);
    transition: color var(--quick) var(--ease-soft);
  }
  .statement__word.is-lit { color: var(--ink); }

  .statement__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
    width: min(100%, 720px);
    margin: var(--space-m) 0 0;
    padding-top: var(--space-m);
    border-top: var(--hairline) solid var(--silver-shade);
  }
  .statement__fact { display: grid; gap: var(--space-xs); }
  .statement__fact dt {
    color: var(--ink-faint);
    font: 500 var(--text-micro)/1.3 var(--font-grotesk);
    letter-spacing: var(--track-caps);
    text-transform: uppercase;
  }
  .statement__fact dd {
    margin: 0;
    color: var(--ink-soft);
    font: 400 var(--text-body)/1.4 var(--font-serif);
  }

  @media (max-width: 40rem) {
    .statement__facts { grid-template-columns: 1fr; }
  }
  @media (prefers-reduced-motion: reduce) {
    .statement__word { color: var(--ink); transition: none; }
  }
</style>

<script>
(() => {
  const still = matchMedia('(prefers-reduced-motion: reduce)');
  for (const root of document.querySelectorAll('.statement')) {
    const text = root.querySelector('.statement__text');
    const words = [];
    const walk = (node) => {
      for (const child of [...node.childNodes]) {
        if (child.nodeType === 3) {
          const parts = child.textContent.split(/(\s+)/);
          const frag = document.createDocumentFragment();
          for (const part of parts) {
            if (!part) continue;
            if (/^\s+$/.test(part)) { frag.append(part); continue; }
            const span = document.createElement('span');
            span.className = 'statement__word';
            span.textContent = part;
            words.push(span);
            frag.append(span);
          }
          child.replaceWith(frag);
        } else if (child.nodeType === 1) {
          walk(child);
        }
      }
    };
    walk(text);

    let pending = false;
    const update = () => {
      pending = false;
      if (still.matches) { words.forEach((w) => w.classList.add('is-lit')); return; }
      const box = text.getBoundingClientRect();
      const view = window.innerHeight || 720;
      const progress = Math.min(1, Math.max(0, (view * 0.5 - box.top) / (box.height * 1.2)));
      const lit = Math.round(progress * words.length);
      words.forEach((word, index) => word.classList.toggle('is-lit', index < lit));
    };
    const ask = () => { if (!pending) { pending = true; requestAnimationFrame(update); } };
    let watching = false;
    new IntersectionObserver(([entry]) => {
      if (entry.isIntersecting && !watching) { watching = true; addEventListener('scroll', ask, { passive: true }); }
      if (!entry.isIntersecting && watching) { watching = false; removeEventListener('scroll', ask); }
      ask();
    }).observe(root);
    addEventListener('resize', ask);
    update();
  }
})();
</script>

Similar components

Quote and three rails

Quote and three rails

Drifting statement

Drifting statement

Italic-emphasis statement

Italic-emphasis statement

Condensed black statement

Condensed black statement

Statement with pills

Statement with pills

Spread-letter practice

Spread-letter practice

Credits statement

Credits statement

Letter and footer

Letter and footer