kitbash Sign in Connect agent
Components

Edge-to-edge specimen

Single words fitted to the full width in Latin and Cyrillic, each under a hairline label with its size in points, with one centred photograph and caption between the rows.

Part of the style

Inscribed Glyph Night

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

Preview

Code
<section class="specimen" aria-label="Corvid specimen">
  <div class="specimen__row">
    <p class="specimen__label">Corvid Medium <span class="specimen__size">310pt</span></p>
    <p class="specimen__word" lang="en"><span class="specimen__fit">Bellhouse</span></p>
  </div>
  <div class="specimen__row">
    <p class="specimen__label">Corvid Medium <span class="specimen__size">296pt</span></p>
    <p class="specimen__word" lang="ru"><span class="specimen__fit">Колокол</span></p>
  </div>
  <figure class="specimen__plate">
    <img class="specimen__photo" src="assets/cast-bells.jpg" alt="Eight new bells with inscriptions standing in a foundry yard" width="769" height="1000">
    <figcaption class="specimen__caption">
      <span class="specimen__place">FOUNDRY YARD, Ashby</span>
      <span class="specimen__sub">Eight bells waiting for their tower</span>
    </figcaption>
  </figure>
  <div class="specimen__row">
    <p class="specimen__label">Corvid Medium Italic <span class="specimen__size">288pt</span></p>
    <p class="specimen__word specimen__word--italic" lang="en"><span class="specimen__fit">Tolling Hour</span></p>
  </div>
</section>

<style>
  .specimen {
    display: grid;
    gap: var(--space-l);
    padding: var(--space-xl) var(--edge) var(--section-space);
    background: var(--paper);
    color: var(--ink);
  }
  .specimen__row {
    padding-top: var(--space-s);
    border-top: var(--rule) solid var(--rule-colour);
    overflow: hidden;
  }
  .specimen__label {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.6;
  }
  .specimen__size {
    margin-left: var(--space-s);
    color: var(--ink-faint);
  }
  .specimen__word {
    margin: 0;
    padding: 0.04em 0 0.12em;
    font-family: var(--font-display);
    font-size: 16vw;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
  .specimen__word--italic {
    font-style: italic;
  }
  .specimen__fit {
    display: inline-block;
    opacity: 0;
    transform: translateY(28%);
    transition: opacity var(--fade) var(--ease), transform var(--rise) var(--ease);
    transition-delay: calc(var(--order, 0) * 140ms);
  }
  .specimen__row.is-seen .specimen__fit {
    opacity: 1;
    transform: none;
  }

  .specimen__plate {
    position: relative;
    display: grid;
    justify-items: center;
    margin: var(--space-xl) 0;
  }
  .specimen__photo {
    width: min(440px, 80vw);
    aspect-ratio: 769 / 1000;
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-l);
    filter: grayscale(0.6) contrast(1.1) brightness(0.85);
    transform: scale(0.96);
    opacity: 0;
    transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
  }
  .specimen__plate.is-seen .specimen__photo {
    opacity: 1;
    transform: none;
  }
  .specimen__caption {
    justify-self: start;
    display: grid;
    margin-top: var(--space-l);
    font-size: var(--text-s);
    line-height: 1.5;
  }
  .specimen__sub {
    color: var(--ink-mid);
  }

  @media (prefers-reduced-motion: reduce) {
    .specimen__fit,
    .specimen__photo {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }
</style>

<script>
(() => {
  const PT_PER_PX = 0.75;
  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.1 });

  for (const root of document.querySelectorAll('.specimen')) {
    const rows = [...root.querySelectorAll('.specimen__row')];

    // Each word is sized so it runs the full width of its row; its label reports that size in points.
    const fit = () => {
      for (const row of rows) {
        const word = row.querySelector('.specimen__word');
        const span = row.querySelector('.specimen__fit');
        const size = row.querySelector('.specimen__size');
        word.style.fontSize = '100px';
        const natural = span.offsetWidth;
        if (!natural) continue;
        const px = Math.floor((row.clientWidth / natural) * 100 * 0.985);
        word.style.fontSize = px + 'px';
        if (size) size.textContent = Math.round(px / PT_PER_PX) + 'pt';
      }
    };

    rows.forEach((row) => seen.observe(row));
    seen.observe(root.querySelector('.specimen__plate'));
    fit();
    if (document.fonts) document.fonts.ready.then(fit);
    let frame = 0;
    new ResizeObserver(() => {
      cancelAnimationFrame(frame);
      frame = requestAnimationFrame(fit);
    }).observe(root);
  }
})();
</script>

Similar components

Project slice

Project slice

Line-screen archive

Line-screen archive

Colour wash showcase

Colour wash showcase

Project cards

Project cards

Drifting tile wall

Drifting tile wall

Rounded picture row

Rounded picture row

Collage stage

Collage stage

Night viewer

Night viewer