kitbash Sign in Connect agent
Components

Scroll-lit reading

A dateline row with a live date in green, then a large centred light-serif paragraph with ink pictograms in the line. Words turn from grey to black as you scroll, a green N to S rail fills beside it and a paper boat drifts across.

Part of the style

Graph Paper Novel

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 {
  --page: #26006a;
  --grid-line: #2f1677;
  --ink: #d6e287;
  --ink-soft: #99a43d;
  --ink-dim: #41308d;
  --panel: #2b0d72;
  --sheet: #1e0654;
  --on-dark: #d8d8ff;
  --metal-light: #20015c;
  --metal-mid: #5347a2;
  --metal-dark: #a4b04b;
  --shade: rgba(214, 226, 135, 0.3);
  --shade-light: rgba(214, 226, 135, 0.1);
  --sheen: rgba(26, 0, 78, 0.1);
  --green: #9f332e;
  --green-hover: #fecbc4;
  --scribble: #824b45;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Fraunces", Georgia, serif;
  --font-label: "Fraunces", Georgia, serif;
}
</style>

<section class="dispatch" aria-label="From the book">
  <div class="dispatch__meta">
    <strong class="dispatch__name">True North.</strong>
    <span class="dispatch__subtitle">The Quiet Rules of Getting Home.</span>
    <time class="dispatch__date">March 4, 2027, 5:12 AM</time>
    <strong class="dispatch__place">Halifax, NS</strong>
  </div>

  <p class="dispatch__text">
    Most of us leave the harbour
    <svg class="dispatch__icon" viewBox="0 0 40 30" aria-hidden="true"><path d="M4 21h32l-5 6H9z M20 3v18 M20 4l11 14H20 M20 7l-8 11h8"/></svg>
    as if the sea were a road already drawn, without reading
    <svg class="dispatch__icon" viewBox="0 0 40 30" aria-hidden="true"><path d="M17 28l2-18h2l2 18z M16 10h8 M18 6h4v4h-4z M20 3v3 M24 8l12-4 M24 8l12 4 M16 8L4 4 M16 8L4 12 M18 16h4 M17 22h6"/></svg>
    the wind, without asking which marks truly hold, and trusting that rowing harder will be enough to reach
    <svg class="dispatch__icon" viewBox="0 0 40 30" aria-hidden="true"><path d="M20 7v20 M14 11h12 M8 19c1 6 7 8 12 8s11-2 12-8 M5 21l3-3 3 3 M29 21l3-3 3 3"/><circle cx="20" cy="5" r="2.5"/></svg>
    the shore. But the water keeps its own ledger, its own
    <svg class="dispatch__icon" viewBox="0 0 40 30" aria-hidden="true"><path d="M2 12c4-4 8-4 12 0s8 4 12 0 8-4 12 0 M2 20c4-4 8-4 12 0s8 4 12 0 8-4 12 0"/></svg>
    currents, its penalties and its gifts. True North is the story of a course plotted the hard way, and an invitation to learn that arriving
    <svg class="dispatch__icon" viewBox="0 0 40 30" aria-hidden="true"><path d="M22 3l10 9-10 9-10-9z M22 21c-2 3-6 4-8 7 M17 25l-3 1 M19 22l-4 0"/></svg>
    is not about speed, but about knowing where you stand, and being free to change your heading without fear.
  </p>

  <div class="dispatch__rail" aria-hidden="true">
    <span class="dispatch__pole">N</span>
    <span class="dispatch__track"><span class="dispatch__fill"></span></span>
    <span class="dispatch__pole">S</span>
  </div>

  <svg class="dispatch__boat" viewBox="0 0 160 90" aria-hidden="true">
    <defs>
      <linearGradient id="dispatch-paper" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0" style="stop-color: var(--metal-light)"/>
        <stop offset="1" style="stop-color: var(--metal-mid)"/>
      </linearGradient>
    </defs>
    <path d="M6 48h148l-26 36H32z" style="fill: var(--metal-mid)"/>
    <path d="M6 48l74-44 74 44z" style="fill: url(#dispatch-paper)"/>
    <path d="M80 4l-22 44h44z" style="fill: var(--metal-light)"/>
    <path d="M6 48h148M80 4v44M58 48l22-44 22 44M32 84l48-36 48 36" fill="none" style="stroke: var(--metal-dark)" stroke-width="0.8"/>
    <g fill="none" style="stroke: var(--metal-dark)" stroke-width="0.6" opacity="0.6">
      <path d="M24 40h40M30 34h30M96 40h36M98 34h26M44 62h72M52 70h56"/>
      <path d="M112 30c6 2 10-4 16 0" />
    </g>
  </svg>
</section>

<style>
  .dispatch {
    position: relative;
    padding: var(--space-m) var(--edge) var(--section-space);
    overflow: clip;
  }
  .dispatch__meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-xs) var(--gap);
    font-size: var(--text-s);
    font-weight: 300;
  }
  .dispatch__name,
  .dispatch__place { font-weight: 600; }
  .dispatch__date { color: var(--green); }
  .dispatch__place { text-align: right; }
  .dispatch__text {
    position: relative;
    z-index: 1;
    max-width: 46rem;
    margin: var(--space-l) auto 0;
    font-size: var(--text-xl);
    font-weight: 300;
    line-height: 1.32;
    letter-spacing: -0.01em;
    text-align: center;
    text-wrap: pretty;
  }
  .dispatch__word,
  .dispatch__icon {
    color: var(--ink-dim);
    transition: color var(--quick) ease;
  }
  .dispatch__word.is-lit,
  .dispatch__icon.is-lit { color: var(--ink); }
  .dispatch__icon {
    display: inline-block;
    width: 1.15em;
    height: 0.85em;
    margin: 0 0.12em;
    vertical-align: -0.08em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .dispatch__rail {
    position: absolute;
    top: 10rem;
    right: var(--edge);
    display: grid;
    justify-items: center;
    gap: 0.3rem;
    color: var(--green);
    font-size: var(--text-xs);
  }
  .dispatch__track {
    position: relative;
    width: 1px;
    height: 9rem;
    background: var(--ink-dim);
  }
  .dispatch__fill {
    position: absolute;
    inset: 0 -0.5px;
    background: var(--green);
    transform: scaleY(var(--read, 0));
    transform-origin: top;
    transition: transform var(--quick) linear;
  }
  .dispatch__boat {
    position: absolute;
    z-index: 2;
    top: 38%;
    left: 0;
    width: clamp(5rem, 9vw, 8rem);
    filter: drop-shadow(0 0.4rem 0.4rem var(--shade));
    pointer-events: none;
    animation: dispatch-drift var(--drift) ease-in-out infinite alternate;
  }
  .dispatch.is-offscreen .dispatch__boat { animation-play-state: paused; }

  @keyframes dispatch-drift {
    0% { translate: -20% -6rem; rotate: -14deg; }
    30% { translate: 30vw 2rem; rotate: 8deg; }
    60% { translate: 58vw -3rem; rotate: -6deg; }
    100% { translate: calc(100vw - 9rem) 5rem; rotate: 16deg; }
  }

  @media (max-width: 48rem) {
    .dispatch__meta { grid-template-columns: 1fr 1fr; }
    .dispatch__subtitle { text-align: right; }
    .dispatch__rail { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .dispatch__boat { animation: none; translate: 70vw 4rem; rotate: 8deg; }
  }
</style>

<script>
  (() => {
    const formatDay = new Intl.DateTimeFormat('en-US', { dateStyle: 'long' });
    const formatTime = new Intl.DateTimeFormat('en-US', { timeStyle: 'short' });

    function splitIntoWords(text) {
      for (const node of [...text.childNodes]) {
        if (node.nodeType !== Node.TEXT_NODE) continue;
        const pieces = node.textContent.split(/(\s+)/).filter(Boolean);
        const words = pieces.map((piece) => {
          if (/^\s+$/.test(piece)) return document.createTextNode(' ');
          const word = document.createElement('span');
          word.className = 'dispatch__word';
          word.textContent = piece;
          return word;
        });
        node.replaceWith(...words);
      }
      return [...text.querySelectorAll('.dispatch__word, .dispatch__icon')];
    }

    for (const root of document.querySelectorAll('.dispatch')) {
      const text = root.querySelector('.dispatch__text');
      const rail = root.querySelector('.dispatch__rail');
      const date = root.querySelector('.dispatch__date');
      const words = splitIntoWords(text);
      let visible = false;

      const now = new Date();
      date.textContent = `${formatDay.format(now)}, ${formatTime.format(now)}`;
      date.dateTime = now.toISOString();

      const lightByScroll = () => {
        const box = text.getBoundingClientRect();
        const read = Math.min(Math.max((innerHeight * 0.8 - box.top) / box.height, 0), 1);
        const litCount = Math.round(read * words.length);
        words.forEach((word, index) => word.classList.toggle('is-lit', index < litCount));
        rail.style.setProperty('--read', read.toFixed(3));
      };

      new IntersectionObserver(([entry]) => {
        visible = entry.isIntersecting;
        root.classList.toggle('is-offscreen', !visible);
        if (visible) lightByScroll();
      }).observe(root);

      addEventListener('scroll', () => { if (visible) lightByScroll(); }, { passive: true });
      addEventListener('resize', lightByScroll);
    }
  })();
</script>

Similar components

Text columns with small figures

Text columns with small figures

Essay

Essay

Statement with pictures

Statement with pictures

Chapter stepper

Chapter stepper

Lead entry

Lead entry

Edition page

Edition page

Black statement

Black statement

Reading passage

Reading passage