kitbash Sign in Connect agent
Components

Process cards on a string

Four coloured process cards (lime, pink, blue, orange-red) clipped with drawn wooden pegs to one sagging string drawn through the pegs. Each hangs at its own angle, swings in on view, sways, and swings again on hover or tap. One string per row when the cards wrap.

Part of the style

Clothesline Pitch

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 {
  --paper: #7d837b;
  --white: #80867e;
  --ink: #121212;
  --ink-soft: #161615;
  --grey: #181714;
  --grey-light: #8a8f88;
  --dim: rgba(18, 18, 18, 0.45);
  --unread: rgba(18, 18, 18, 0.14);
  --unread-dark: rgba(116, 122, 114, 0.22);
  --soft-dark: rgba(116, 122, 114, 0.45);
  --line: rgba(18, 18, 18, 0.2);
  --line-dark: rgba(116, 122, 114, 0.14);
  --night: #151413;
  --card-black: #121212;
  --panel: #1a1918;
  --chip: #272624;
  --edge-dark: #292927;
  --menu-edge: #302f2d;
  --lime: #9b7667;
  --lime-ink: #010000;
  --sun: #9a7d71;
  --live: #9f7d6f;
  --blue: #9f7769;
  --pink: #9b7667;
  --pink-ink: #010000;
  --orange: #412014;
  --violet: #9b7667;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-tight: "Fraunces", Georgia, serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
}
</style>

<section class="clothesline" aria-label="How a project goes">
  <div class="clothesline__head">
    <p class="clothesline__eyebrow">How a project goes</p>
    <h2 class="clothesline__heading">Four steps,<br>one string.</h2>
  </div>

  <div class="clothesline__line">
    <svg class="clothesline__string" aria-hidden="true"></svg>
    <ol class="clothesline__cards">
      <li class="clothesline__hang" style="--rot: -3deg; --c: var(--lime); --fg: var(--lime-ink); --i: 0;">
        <div class="clothesline__card" tabindex="0">
          <svg class="clothesline__peg" viewBox="0 0 28 58" aria-hidden="true"><rect class="clothesline__peg-wood" x="3" y="2" width="10" height="54" rx="4"/><rect class="clothesline__peg-wood clothesline__peg-wood--back" x="15" y="2" width="10" height="54" rx="4"/><circle class="clothesline__peg-spring" cx="14" cy="18" r="6"/></svg>
          <span class="clothesline__num">01</span>
          <span class="clothesline__sticker clothesline__sticker--pill" style="--srot: 8deg; --sx: auto; --sr: -22px; --st: -18px; background: var(--grad-sunset);">free · 20 min</span>
          <div class="clothesline__body">
            <h3 class="clothesline__title">Coffee chat</h3>
            <p class="clothesline__text">Twenty minutes, on me. What the site has to do, who it is for and what it costs. You leave with a plan.</p>
          </div>
        </div>
      </li>
      <li class="clothesline__hang" style="--rot: 2.5deg; --c: var(--pink); --fg: var(--pink-ink); --i: 1;">
        <div class="clothesline__card" tabindex="0">
          <svg class="clothesline__peg" viewBox="0 0 28 58" aria-hidden="true"><rect class="clothesline__peg-wood" x="3" y="2" width="10" height="54" rx="4"/><rect class="clothesline__peg-wood clothesline__peg-wood--back" x="15" y="2" width="10" height="54" rx="4"/><circle class="clothesline__peg-spring" cx="14" cy="18" r="6"/></svg>
          <span class="clothesline__num">02</span>
          <span class="clothesline__sticker clothesline__sticker--face" style="--srot: -14deg; --sr: -26px; --st: 34%;">
            <svg class="clothesline__face" viewBox="0 0 120 120"><circle class="clothesline__face-disc" cx="60" cy="60" r="52"/><ellipse class="clothesline__face-eye" cx="43" cy="50" rx="7" ry="10"/><ellipse class="clothesline__face-eye clothesline__face-eye--wink" cx="77" cy="50" rx="7" ry="10"/><path class="clothesline__face-line" d="M38 74q22 22 44 0"/></svg>
          </span>
          <div class="clothesline__body">
            <h3 class="clothesline__title">Sketch</h3>
            <p class="clothesline__text">Layouts and look in Figma, shaped with your notes until it feels like you on a good day.</p>
          </div>
        </div>
      </li>
      <li class="clothesline__hang" style="--rot: -1.5deg; --c: var(--blue); --fg: var(--white); --i: 2;">
        <div class="clothesline__card" tabindex="0">
          <svg class="clothesline__peg" viewBox="0 0 28 58" aria-hidden="true"><rect class="clothesline__peg-wood" x="3" y="2" width="10" height="54" rx="4"/><rect class="clothesline__peg-wood clothesline__peg-wood--back" x="15" y="2" width="10" height="54" rx="4"/><circle class="clothesline__peg-spring" cx="14" cy="18" r="6"/></svg>
          <span class="clothesline__num">03</span>
          <span class="clothesline__sticker clothesline__sticker--burst" style="--srot: -14deg; --sl: -30px; --st: 40%;">
            <svg class="clothesline__burst" viewBox="0 0 140 140"><polygon class="clothesline__burst-shape" points="70,6 80,30 104,16 104,44 132,44 116,66 136,84 108,92 116,120 90,110 78,134 64,112 42,130 40,102 12,104 24,80 4,62 30,52 20,26 48,32"/><text class="clothesline__burst-num" x="70" y="78" text-anchor="middle">100</text><text class="clothesline__burst-sub" x="70" y="97" text-anchor="middle">SPEED</text></svg>
          </span>
          <div class="clothesline__body">
            <h3 class="clothesline__title">Build</h3>
            <p class="clothesline__text">Hand-built, quick and animated, with a CMS you can use without calling me.</p>
          </div>
        </div>
      </li>
      <li class="clothesline__hang" style="--rot: 3deg; --c: var(--orange); --fg: var(--white); --i: 3;">
        <div class="clothesline__card" tabindex="0">
          <svg class="clothesline__peg" viewBox="0 0 28 58" aria-hidden="true"><rect class="clothesline__peg-wood" x="3" y="2" width="10" height="54" rx="4"/><rect class="clothesline__peg-wood clothesline__peg-wood--back" x="15" y="2" width="10" height="54" rx="4"/><circle class="clothesline__peg-spring" cx="14" cy="18" r="6"/></svg>
          <span class="clothesline__num">04</span>
          <span class="clothesline__sticker clothesline__sticker--pill" style="--srot: -9deg; --sr: -18px; --st: -22px; background: var(--grad-pool);"><i class="clothesline__blink"></i>it's live!</span>
          <div class="clothesline__body">
            <h3 class="clothesline__title">Liftoff</h3>
            <p class="clothesline__text">Live on your domain, handed over with a short video guide and a month of fixes on the house.</p>
          </div>
        </div>
      </li>
    </ol>
  </div>
</section>

<style>
  .clothesline {
    --peg-y: 14px;
    padding: clamp(56px, 8vw, 120px) var(--edge) clamp(72px, 9vw, 140px);
    overflow-x: clip;
    background: var(--night);
    color: var(--white);
  }
  .clothesline__head { margin-bottom: clamp(56px, 8vw, 110px); }
  .clothesline__eyebrow {
    margin: 0 0 16px;
    font: 500 var(--text-xs)/1.2 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .clothesline__heading {
    margin: 0;
    font: 600 clamp(36px, 4.4vw, 63px)/1 var(--font-tight);
    letter-spacing: -0.05em;
  }

  .clothesline__line { position: relative; }
  .clothesline__string {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
  }
  .clothesline__cord {
    fill: none;
    stroke: var(--white);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
  }
  .clothesline.is-armed .clothesline__cord { stroke-dashoffset: 1; }
  .clothesline.is-in .clothesline__cord { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s var(--ease); }

  .clothesline__cards {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 44px);
    align-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .clothesline__hang:nth-child(2) { margin-top: 7.6vw; }
  .clothesline__hang:nth-child(3) { margin-top: 2.1vw; }
  .clothesline__hang:nth-child(4) { margin-top: 9.7vw; }

  /* Each card turns about its own peg: base angle on the hanger, breeze on the hanger, swings on the card. */
  .clothesline__hang {
    transform-origin: 50% calc(-1 * var(--peg-y));
    rotate: var(--rot);
    animation: clothesline-breeze calc(4.6s + var(--i) * 0.7s) ease-in-out calc(var(--i) * -1.3s) infinite alternate;
  }
  .clothesline.is-away .clothesline__hang,
  .clothesline.is-away .clothesline__card { animation-play-state: paused; }
  .clothesline__card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 0.8;
    padding: clamp(16px, 1.8vw, 26px);
    border-radius: var(--radius-hang);
    background: var(--c);
    color: var(--fg);
    cursor: grab;
    transform-origin: 50% calc(-1 * var(--peg-y));
    box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.8);
    outline: none;
  }
  .clothesline__card:focus-visible { box-shadow: 0 0 0 3px var(--night), 0 0 0 6px var(--white); }
  .clothesline.is-in .clothesline__card { animation: clothesline-swing 2s ease-in-out calc(var(--i) * 0.1s) backwards; }
  .clothesline.is-in .clothesline__card.is-settled { animation: none; }
  .clothesline.is-in .clothesline__card.is-nudged { animation: clothesline-nudge 1.3s ease-in-out; }

  .clothesline__peg {
    position: absolute;
    top: calc(-1 * var(--peg-y) - 18px);
    left: 50%;
    z-index: 3;
    width: 26px;
    height: 54px;
    margin-left: -13px;
    overflow: visible;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
  }
  .clothesline__peg-wood { fill: #e7c48c; stroke: #9a6a36; stroke-width: 1.4; }
  .clothesline__peg-wood--back { fill: #d6aa6a; }
  .clothesline__peg-spring { fill: none; stroke: #cfd3d6; stroke-width: 2.6; }

  .clothesline__num { font: 500 var(--text-xs)/1.2 var(--font-mono); }
  .clothesline__title {
    margin: 0 0 10px;
    font: 900 var(--text-card-title)/0.95 var(--font-display);
    font-stretch: var(--display-stretch);
    text-transform: uppercase;
  }
  .clothesline__text { margin: 0; font-size: clamp(13px, 1.08vw, var(--text-body)); line-height: 1.4; }

  /* Stickers stuck over the card edges */
  .clothesline__sticker {
    position: absolute;
    top: var(--st, auto);
    right: var(--sr, auto);
    left: var(--sl, auto);
    z-index: 2;
    display: block;
    transform: rotate(var(--srot));
    filter: var(--sticker-shadow);
    transition: transform var(--lift) var(--spring), filter 0.3s;
  }
  .clothesline__card:hover .clothesline__sticker { transform: rotate(calc(var(--srot) * -0.6)) scale(1.08); filter: var(--sticker-shadow-up); }
  .clothesline__sticker--pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: var(--sticker-border) solid var(--white);
    border-radius: var(--radius-pill);
    color: var(--white);
    font: 800 clamp(13px, 1.1vw, 15px)/1 var(--font-body);
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
  .clothesline__blink { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: clothesline-blink 1s steps(2) infinite; }
  .clothesline__face { width: clamp(52px, 5vw, 76px); overflow: visible; }
  .clothesline__face-disc { fill: var(--sun); stroke: var(--white); stroke-width: 10; paint-order: stroke; }
  .clothesline__face-eye { fill: var(--ink); transform-box: fill-box; transform-origin: center; transition: transform 0.15s; }
  .clothesline__card:hover .clothesline__face-eye--wink { transform: scaleY(0.12); }
  .clothesline__face-line { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; }
  .clothesline__burst { width: clamp(58px, 5.6vw, 84px); overflow: visible; }
  .clothesline__burst-shape { fill: var(--lime); stroke: var(--white); stroke-width: 10; stroke-linejoin: round; paint-order: stroke; transform-box: fill-box; transform-origin: center; transition: transform 0.6s var(--spring); }
  .clothesline__card:hover .clothesline__burst-shape { transform: rotate(36deg); }
  .clothesline__burst-num { fill: var(--lime-ink); font: 800 34px var(--font-body); letter-spacing: -0.04em; }
  .clothesline__burst-sub { fill: var(--lime-ink); font: 800 13px var(--font-body); letter-spacing: 0.08em; }

  @keyframes clothesline-swing {
    0% { opacity: 0; transform: translateY(-40px) rotate(16deg); }
    14% { opacity: 1; transform: translateY(0) rotate(-10deg); }
    34% { transform: rotate(6.5deg); }
    54% { transform: rotate(-3.6deg); }
    72% { transform: rotate(1.8deg); }
    88% { transform: rotate(-0.7deg); }
    100% { transform: rotate(0); }
  }
  @keyframes clothesline-nudge {
    0% { transform: rotate(0); }
    18% { transform: rotate(calc(var(--dir, 1) * 7deg)); }
    40% { transform: rotate(calc(var(--dir, 1) * -4.5deg)); }
    62% { transform: rotate(calc(var(--dir, 1) * 2.4deg)); }
    82% { transform: rotate(calc(var(--dir, 1) * -1deg)); }
    100% { transform: rotate(0); }
  }
  @keyframes clothesline-breeze { from { transform: rotate(-0.6deg); } to { transform: rotate(0.6deg); } }
  @keyframes clothesline-blink { 50% { opacity: 0.2; } }

  @media (max-width: 900px) {
    .clothesline__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 90px; }
    .clothesline__hang:nth-child(n) { margin-top: 0; }
    .clothesline__hang:nth-child(2n) { margin-top: 48px; }
    .clothesline__title { font-size: 34px; }
    .clothesline__text { font-size: var(--text-body); }
  }
  @media (max-width: 560px) {
    .clothesline__cards { grid-template-columns: 1fr; row-gap: 80px; }
    .clothesline__hang:nth-child(n) { width: 78%; margin: 0 0 0 4%; }
    .clothesline__hang:nth-child(2n) { margin: 0 0 0 18%; }
    .clothesline__card { aspect-ratio: auto; min-height: 300px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .clothesline__hang, .clothesline.is-in .clothesline__card, .clothesline__blink { animation: none; }
  }
</style>

<script>
(() => {
  const EDGE_LIFT = 70;
  const EDGE_LIFT_SHARE = 0.08;
  const SAG = 0.14;
  const SVG_NS = 'http://www.w3.org/2000/svg';
  const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches;

  function pegPoints(root) {
    const pegY = parseFloat(getComputedStyle(root).getPropertyValue('--peg-y')) || 14;
    return [...root.querySelectorAll('.clothesline__hang')].map((hang) => ({
      x: hang.offsetLeft + hang.offsetWidth / 2,
      y: hang.offsetTop - pegY,
      row: hang.offsetTop - parseFloat(getComputedStyle(hang).marginTop),
    }));
  }

  function groupByRow(points) {
    const rows = new Map();
    for (const point of points) {
      const key = Math.round(point.row / 20);
      rows.set(key, [...(rows.get(key) || []), point]);
    }
    return [...rows.values()];
  }

  function sagTo(from, to) {
    const dip = Math.abs(to.x - from.x) * SAG;
    return `Q ${(from.x + to.x) / 2} ${Math.max(from.y, to.y) + dip} ${to.x} ${to.y}`;
  }

  function cordPath(row, left, right) {
    const lift = Math.min(EDGE_LIFT, (right - left) * EDGE_LIFT_SHARE);
    const start = { x: left, y: row[0].y - lift };
    const end = { x: right, y: row[row.length - 1].y - lift };
    const stops = [...row, end];
    let from = start;
    return stops.reduce((d, to) => { const part = sagTo(from, to); from = to; return `${d} ${part}`; }, `M ${start.x} ${start.y}`);
  }

  function drawString(root) {
    const svg = root.querySelector('.clothesline__string');
    const line = root.querySelector('.clothesline__line');
    const bleed = line.getBoundingClientRect().left - root.getBoundingClientRect().left;
    const rows = groupByRow(pegPoints(root));
    svg.replaceChildren(...rows.map((row) => {
      const cord = document.createElementNS(SVG_NS, 'path');
      cord.setAttribute('class', 'clothesline__cord');
      cord.setAttribute('pathLength', '1');
      cord.setAttribute('d', cordPath(row, -bleed - 8, line.offsetWidth + bleed + 8));
      return cord;
    }));
  }

  function nudge(card, event) {
    const box = card.getBoundingClientRect();
    const fromLeft = event && event.clientX !== undefined ? event.clientX < box.left + box.width / 2 : true;
    card.style.setProperty('--dir', fromLeft ? 1 : -1);
    card.classList.remove('is-nudged');
    void card.offsetWidth;
    card.classList.add('is-nudged');
  }

  function setUp(root) {
    drawString(root);
    new ResizeObserver(() => drawString(root)).observe(root);
    if (reduced) return;

    root.classList.add('is-armed');
    new IntersectionObserver(([entry]) => {
      root.classList.toggle('is-away', !entry.isIntersecting);
      if (entry.isIntersecting) root.classList.add('is-in');
    }, { threshold: 0.2 }).observe(root);

    root.querySelectorAll('.clothesline__card').forEach((card) => {
      card.addEventListener('pointerenter', (event) => nudge(card, event));
      card.addEventListener('click', (event) => nudge(card, event));
      card.addEventListener('keydown', (event) => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); nudge(card); } });
      card.addEventListener('animationend', (event) => { if (event.target !== card) return; card.classList.add('is-settled'); card.classList.remove('is-nudged'); });
    });
  }

  document.querySelectorAll('.clothesline').forEach(setUp);
})();
</script>

Similar components

Infrastructure checker

Infrastructure checker

Colour specimen

Colour specimen

Work cards

Work cards

Project panes

Project panes

Specimen cards

Specimen cards

Selected work cards

Selected work cards

This week

This week

Edition slips

Edition slips