kitbash Sign in Connect agent
Components

About

Round mosaic portrait, a 1940s public domain photograph printed on canvas in two inks (bark and sky), that sharpens in steps when seen, an underlined uppercase name and a one-sentence introduction in large mono.

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 */
@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..700&family=Fraunces:ital,opsz,wght@1,9..144,400..600&display=swap");
:root {
  --reed: #bb57f5;
  --bark: #121212;
  --sand: #b843f7;
  --night: #090909;
  --chalk: #c26cf8;
  --chalk-dim: #c26cf8;
  --shade: rgba(1, 1, 1, 0.28);
  --bark-veil: rgba(18, 18, 18, 0.2);
  --olive: #161001;
  --mustard: #a6851b;
  --harbor: #211802;
  --sky: #947c3a;
  --signal: #947505;
  --skin: #928667;
  --hair: #010000;
  --teal: #161001;
  --font-mono: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mark: "Fraunces", Georgia, serif;
}
</style>

<section class="about">
  <div class="about__inner">
    <canvas class="about__portrait" role="img" aria-label="Portrait of Ada Pell, printed in two inks"></canvas>
    <img class="about__photo" src="assets/ada-portrait.jpg" alt="" width="570" height="600" hidden>
    <div class="about__text">
      <h2 class="about__name">Ada Pell</h2>
      <p class="about__lede">I design the signs that get people from the ferry to the water. Every arrow on North Pier was drawn at this desk.</p>
    </div>
  </div>
</section>

<style>
  .about {
    padding: var(--space-wall) var(--edge);
    background: var(--reed);
    color: var(--bark);
  }
  .about__inner {
    display: grid;
    grid-template-columns: auto minmax(0, var(--measure));
    align-items: end;
    justify-content: center;
    gap: var(--space-7);
  }
  .about__portrait {
    width: clamp(7rem, 4rem + 9vw, 13rem);
    aspect-ratio: 1;
    border-radius: 50%;
    image-rendering: pixelated;
  }
  .about__photo {
    display: none;
  }
  .about__name {
    display: inline-block;
    margin: 0 0 var(--space-4);
    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;
  }
  .about__lede {
    margin: 0;
    font-size: var(--text-xl);
    letter-spacing: var(--tracking-tight);
    line-height: 1.25;
  }

  @media (max-width: 40rem) {
    .about__inner { grid-template-columns: minmax(0, 1fr); }
  }
</style>

<script>
  (() => {
    const still = matchMedia('(prefers-reduced-motion: reduce)').matches;
    const steps = [7, 11, 18, 30, 64, 128];
    const stepTime = 220;
    const FACE = { x: 0.16, y: 0.17, size: 0.58 };

    function readInks(element) {
      const style = getComputedStyle(element);
      return { light: style.getPropertyValue('--sky').trim(), dark: style.getPropertyValue('--bark').trim() };
    }

    // The photograph as a two-ink print: grey tones run from the dark ink to the light one.
    function printPhoto(context, size, photo, inks) {
      const side = Math.min(photo.naturalWidth, photo.naturalHeight) * FACE.size;
      context.filter = 'grayscale(1) contrast(1.25) brightness(1.05)';
      context.drawImage(photo, photo.naturalWidth * FACE.x, photo.naturalHeight * FACE.y, side, side, 0, 0, size, size);
      context.filter = 'none';
      context.globalCompositeOperation = 'screen';
      context.fillStyle = inks.dark;
      context.fillRect(0, 0, size, size);
      context.globalCompositeOperation = 'multiply';
      context.fillStyle = inks.light;
      context.fillRect(0, 0, size, size);
      context.globalCompositeOperation = 'source-over';
    }

    function setUp(canvas, photo) {
      const context = canvas.getContext('2d');
      const source = document.createElement('canvas');
      source.width = source.height = 256;
      printPhoto(source.getContext('2d'), 256, photo, readInks(canvas));

      const showAt = (blocks) => {
        canvas.width = canvas.height = blocks;
        context.imageSmoothingEnabled = true;
        context.drawImage(source, 0, 0, blocks, blocks);
      };

      if (still) { showAt(steps.at(-1)); return; }
      showAt(steps[0]);
      new IntersectionObserver(([entry], observer) => {
        if (!entry.isIntersecting) return;
        observer.disconnect();
        steps.forEach((blocks, index) => setTimeout(() => showAt(blocks), 300 + index * stepTime));
      }, { threshold: 0.3 }).observe(canvas);
    }

    document.querySelectorAll('.about').forEach((root) => {
      const canvas = root.querySelector('.about__portrait');
      const photo = root.querySelector('.about__photo');
      const start = () => setUp(canvas, photo);
      if (photo.complete && photo.naturalWidth) start();
      else photo.addEventListener('load', start, { once: true });
    });
  })();
</script>

Similar components

Founders

Founders

Team portraits

Team portraits

Paper roster card

Paper roster card

Single contact profile

Single contact profile

About with cut-out portrait

About with cut-out portrait

Info sheet

Info sheet

Drawn self-portrait

Drawn self-portrait

Lead paragraph and fact card

Lead paragraph and fact card