kitbash Sign in Connect agent
Components

Split hero

Sticky sidebar with wordmark, a canvas wireframe letter turning slowly and a numbered index with a travelling underline; content side with boxed navigation, two pills joined by a line and a light serif statement. On phones it stacks with a round menu button.

Part of the style

Wireframe Ledger

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --paper: #053e03;
  --ink: #a0fb01;
  --ink-mid: rgba(160, 251, 1, 0.6);
  --ink-soft: rgba(160, 251, 1, 0.45);
  --rule: rgba(160, 251, 1, 0.16);
  --rule-strong: #a0fb01;
  --mist: #0c4c08;
  --fog: #135a0f;
  --sand: #0d4e09;
  --on-wine: #053e03;
  --wine: #87b14f;
  --signal: #ace236;
}
</style>

<section class="hero">
  <aside class="hero__side">
    <div class="hero__bar">
      <a class="hero__mark" href="#" aria-label="Keel, home">KEEL</a>
      <button class="hero__round" type="button" aria-label="Back to top"><span class="hero__round-letter">K</span></button>
      <button class="hero__burger" type="button" aria-label="Menu" aria-expanded="false"><span></span></button>
    </div>
    <div class="hero__stage">
      <canvas class="hero__canvas" role="img" aria-label="Wireframe drawing of a block letter K, turning slowly"></canvas>
    </div>
    <nav class="hero__index" aria-label="Holdings">
      <p class="hero__index-head"><span class="hero__tick" aria-hidden="true"></span>Holdings</p>
      <ol class="hero__list">
        <li><a class="hero__row is-active" href="#" aria-current="true"><span>01</span>Saltmarsh Ferries</a></li>
        <li><a class="hero__row" href="#"><span>02</span>Dunlin Drydock</a></li>
        <li><a class="hero__row" href="#"><span>03</span>The quiet harbour thesis</a></li>
      </ol>
      <span class="hero__underline" aria-hidden="true"></span>
    </nav>
  </aside>

  <div class="hero__main">
    <nav class="hero__nav" aria-label="Main">
      <a class="hero__link is-current" href="#" aria-current="page">Holdings</a>
      <a class="hero__link" href="#">People</a>
      <a class="hero__link" href="#">Contact</a>
      <a class="hero__link" href="#">Logbook</a>
    </nav>
    <div class="hero__copy">
      <p class="hero__pills"><span class="hero__pill">Yard discipline</span><span class="hero__join" aria-hidden="true"></span><span class="hero__pill">Venture nerve</span></p>
      <h1 class="hero__statement">Electric hulls will quietly rewrite the harbour. Keel buys working fleets and refits them for the next fifty years.</h1>
    </div>
  </div>
</section>

<style>
  .hero {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: clamp(36rem, 52vw, 50rem);
    background: var(--paper);
    color: var(--ink);
  }
  .hero__side {
    position: sticky;
    top: 0;
    align-self: start;
    display: grid;
    grid-template-rows: auto minmax(12rem, 1fr) auto;
    height: clamp(36rem, 52vw, 50rem);
    padding: var(--gutter);
    border-right: var(--hairline) solid var(--rule);
  }
  .hero__bar {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
  }
  .hero__mark {
    margin-right: auto;
    color: var(--ink);
    font-family: var(--font-mark);
    font-size: 1.75rem;
    line-height: var(--tap);
    letter-spacing: -0.02em;
    text-decoration: none;
  }
  .hero__round,
  .hero__burger {
    display: none;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
  }
  .hero__round::before,
  .hero__burger span {
    content: "";
    grid-area: 1 / 1;
  }
  .hero__round {
    font: 400 0.8125rem/1 var(--font-mark);
  }
  .hero__round-letter {
    grid-area: 1 / 1;
  }
  .hero__round::before {
    width: 1.75rem;
    height: 1.75rem;
    border: var(--hairline) solid var(--ink);
    border-radius: var(--radius-round);
  }
  .hero__burger span {
    width: 1.625rem;
    height: 1.625rem;
    border: var(--hairline) solid var(--ink);
    background:
      linear-gradient(var(--ink), var(--ink)) center 35% / 55% var(--hairline) no-repeat,
      linear-gradient(var(--ink), var(--ink)) center 50% / 55% var(--hairline) no-repeat,
      linear-gradient(var(--ink), var(--ink)) center 65% / 55% var(--hairline) no-repeat;
  }
  .hero__stage {
    position: relative;
    min-height: 0;
    color: var(--ink);
  }
  .hero__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .hero__index {
    position: relative;
    font-size: var(--text-label);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
  }
  .hero__index-head,
  .hero__row {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: var(--tap);
    margin: 0;
    border-top: var(--hairline) solid var(--rule);
  }
  .hero__tick {
    width: 2.25rem;
    height: 10px;
    background:
      linear-gradient(var(--ink), var(--ink)) left / var(--hairline) 100% no-repeat,
      linear-gradient(var(--ink), var(--ink)) left center / 10px var(--hairline) no-repeat;
  }
  .hero__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: var(--hairline) solid var(--rule);
  }
  .hero__row {
    color: var(--ink-soft);
    text-decoration: none;
    transition: color var(--quick) var(--ease-colour);
  }
  .hero__row span {
    width: 2.25rem;
    flex: none;
  }
  .hero__row:hover,
  .hero__row.is-active {
    color: var(--ink);
  }
  .hero__underline {
    position: absolute;
    left: 0;
    top: 0;
    width: 4rem;
    height: var(--hairline);
    background: var(--rule-strong);
    transform: translateY(var(--underline-y, 0));
    transition: transform var(--mid) var(--ease);
  }

  .hero__main {
    display: grid;
    grid-template-rows: auto 1fr;
    padding: var(--gutter) var(--gutter) var(--space-xl) calc(var(--gutter) * 1.25);
  }
  .hero__nav {
    display: flex;
    justify-self: end;
    font-size: var(--text-label);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
  }
  .hero__link {
    display: grid;
    place-items: center;
    min-height: var(--tap);
    padding: 0 var(--space-s);
    border: var(--hairline) solid var(--rule-strong);
    color: var(--ink);
    text-decoration: none;
    transition: background-color var(--quick) var(--ease-colour), color var(--quick) var(--ease-colour);
  }
  .hero__link + .hero__link {
    border-left: 0;
  }
  .hero__link:hover {
    background: var(--mist);
  }
  .hero__link.is-current {
    background: var(--ink);
    color: var(--paper);
  }
  .hero__copy {
    align-self: start;
    max-width: 44rem;
    padding-top: clamp(1.5rem, 5vw, 4.5rem);
  }
  .hero__pills {
    display: flex;
    align-items: center;
    margin: 0 0 var(--space-l);
    font-size: var(--text-label);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
  }
  .hero__pill {
    padding: 0.4rem 0.75rem;
    border: var(--hairline) solid var(--ink);
    border-radius: var(--radius-round);
    white-space: nowrap;
  }
  .hero__pill:first-child {
    border-radius: var(--radius-box);
  }
  .hero__join {
    width: 1.5rem;
    height: var(--hairline);
    background: var(--ink);
  }
  .hero__statement {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--display-l);
    font-weight: 300;
    line-height: 0.98;
    letter-spacing: var(--track-display);
    text-wrap: balance;
  }

  @media (max-width: 48rem) {
    .hero {
      grid-template-columns: minmax(0, 1fr);
      min-height: 0;
    }
    .hero__side {
      position: static;
      display: contents;
    }
    .hero__bar {
      order: 0;
      margin: 0 var(--gutter);
      padding: var(--gutter) 0 var(--space-s);
      border-bottom: var(--hairline) solid var(--rule);
    }
    .hero__round,
    .hero__burger {
      display: grid;
    }
    .hero__main {
      order: 1;
      padding: var(--space-m) var(--gutter) 0;
    }
    .hero__nav {
      display: none;
      justify-self: stretch;
      flex-direction: column;
      margin-bottom: var(--space-m);
    }
    .hero.is-open .hero__nav {
      display: flex;
    }
    .hero__link {
      justify-items: start;
    }
    .hero__link + .hero__link {
      border-left: var(--hairline) solid var(--rule-strong);
      border-top: 0;
    }
    .hero__copy {
      padding-top: 0;
    }
    .hero__stage {
      order: 2;
      height: 18rem;
    }
    .hero__index {
      order: 3;
      margin: 0 var(--gutter) var(--space-l);
    }
  }
</style>

<script>
(() => {
  const still = matchMedia('(prefers-reduced-motion: reduce)');

  // A block K, drawn on a 3.4 by 4 grid with y pointing down.
  const outline = [[0, 0], [1, 0], [1, 1.6], [2.2, 0], [3.4, 0], [1.9, 2], [3.4, 4], [2.2, 4], [1, 2.4], [1, 4], [0, 4]]
    .map(([x, y]) => [x - 1.7, y - 2]);
  const depth = 0.45;
  const pitch = -0.42;

  function project([x, y, z], yaw, scale, width, height) {
    const turnedX = x * Math.cos(yaw) + z * Math.sin(yaw);
    const turnedZ = -x * Math.sin(yaw) + z * Math.cos(yaw);
    const liftedY = y * Math.cos(pitch) - turnedZ * Math.sin(pitch);
    return [width / 2 + turnedX * scale, height / 2 + liftedY * scale];
  }

  function face(context, points) {
    context.beginPath();
    points.forEach(([x, y], index) => (index ? context.lineTo(x, y) : context.moveTo(x, y)));
    context.closePath();
    context.stroke();
  }

  function paint(context, width, height, seconds) {
    const yaw = -0.55 + Math.sin(seconds * (Math.PI * 2 / 12)) * 0.45;
    const scale = Math.min(width / 6, height / 5.6);
    const front = outline.map(([x, y]) => project([x, y, depth], yaw, scale, width, height));
    const back = outline.map(([x, y]) => project([x, y, -depth], yaw, scale, width, height));
    context.clearRect(0, 0, width, height);
    context.strokeStyle = getComputedStyle(context.canvas).color;
    context.lineWidth = 1;
    context.lineJoin = 'round';
    context.globalAlpha = 0.3;
    face(context, back);
    context.globalAlpha = 0.65;
    context.beginPath();
    front.forEach(([x, y], index) => { context.moveTo(x, y); context.lineTo(...back[index]); });
    context.stroke();
    context.globalAlpha = 1;
    face(context, front);
  }

  function runCanvas(canvas) {
    const context = canvas.getContext('2d');
    let frame = 0;
    const fit = () => {
      const density = Math.min(2, devicePixelRatio || 1);
      canvas.width = canvas.clientWidth * density;
      canvas.height = canvas.clientHeight * density;
      context.setTransform(density, 0, 0, density, 0, 0);
      paint(context, canvas.clientWidth, canvas.clientHeight, performance.now() / 1000);
    };
    const tick = (now) => {
      paint(context, canvas.clientWidth, canvas.clientHeight, now / 1000);
      frame = requestAnimationFrame(tick);
    };
    new ResizeObserver(fit).observe(canvas);
    new IntersectionObserver(([entry]) => {
      cancelAnimationFrame(frame);
      if (entry.isIntersecting && !still.matches) frame = requestAnimationFrame(tick);
    }).observe(canvas);
  }

  function runIndex(index) {
    const rows = [...index.querySelectorAll('.hero__row')];
    const underline = index.querySelector('.hero__underline');
    const place = () => {
      const active = index.querySelector('.hero__row.is-active');
      underline.style.setProperty('--underline-y', `${active.offsetTop + active.offsetHeight - 1}px`);
    };
    rows.forEach((row) => row.addEventListener('click', (event) => {
      event.preventDefault();
      rows.forEach((other) => { other.classList.toggle('is-active', other === row); other.removeAttribute('aria-current'); });
      row.setAttribute('aria-current', 'true');
      place();
    }));
    new ResizeObserver(place).observe(index);
  }

  function runMenu(root) {
    const burger = root.querySelector('.hero__burger');
    burger.addEventListener('click', () => {
      const open = root.classList.toggle('is-open');
      burger.setAttribute('aria-expanded', String(open));
    });
  }

  document.querySelectorAll('.hero').forEach((root) => {
    root.querySelectorAll('.hero__canvas').forEach(runCanvas);
    root.querySelectorAll('.hero__index').forEach(runIndex);
    runMenu(root);
  });
})();
</script>

Similar components

Masthead

Masthead

Sky hero

Sky hero

Hero with device panel

Hero with device panel

Sticker headline hero

Sticker headline hero

Fitted headline sheet

Fitted headline sheet

Masthead

Masthead

Cover

Cover

3D hero scene

3D hero scene