kitbash Sign in Connect agent
Components

Mat-top hero

A drawn cutting mat on a wooden desk with a cut-out object, a giant wordmark, a glass caption card, a side tab and a dashed pill menu.

Part of the style

Cutting Mat Desk

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --page: #b8d4e2;
  --night: #e5f6ff;
  --cream: #0d0909;
  --cream-line: rgba(13, 9, 9, 0.302);
  --shade: rgba(207, 235, 249, 0.922);
  --signal: #635353;
  --cream-soft: rgba(205, 201, 201, 0.502);
  --paper: #565252;
  --desk: #868080;
  --desk-deep: #7f7c7c;
  --signal-glow: rgba(123, 106, 106, 0.2);
  --umber: #858181;
  --mat: #877575;
  --mat-deep: #8e7b7b;
  --cream-veil: rgba(111, 94, 94, 0.11);
}
</style>

<section class="hero">
  <div class="hero__desk" aria-hidden="true">
    <div class="hero__mat">
      <div class="hero__ruler hero__ruler--side"></div>
      <div class="hero__ruler hero__ruler--foot"></div>
    </div>
    <svg class="hero__pencil" viewBox="0 0 400 24">
      <path class="hero__pencil-body" d="M60 2 H392 a4 4 0 0 1 4 4 V18 a4 4 0 0 1 -4 4 H60 Z" />
      <path class="hero__pencil-wood" d="M60 2 L12 12 L60 22 Z" />
      <path class="hero__pencil-lead" d="M24 9.5 L12 12 L24 14.5 Z" />
      <path class="hero__pencil-band" d="M354 2 H372 V22 H354 Z" />
    </svg>
  </div>

  <header class="hero__bar">
    <span class="hero__dot" aria-hidden="true"></span>
    <nav class="hero__nav" aria-label="Main">
      <a class="hero__link is-active" href="#">Intro</a>
      <a class="hero__link" href="#">Features</a>
      <a class="hero__link" href="#">Product</a>
      <a class="hero__link" href="#">Contact</a>
    </nav>
    <button class="hero__menu" type="button" aria-expanded="false">Menu</button>
  </header>
  <a class="hero__tab" href="#">Norrow-1 Model</a>

  <div class="hero__head">
    <p class="hero__tagline">Points north. Rarely argues.</p>
    <h1 class="hero__wordmark">Norrow</h1>
  </div>

  <div class="hero__object">
    <img class="hero__photo" src="assets/compass-equinoctial.jpg" alt="A brass pocket compass with an engraved octagonal dial" width="1200" height="1181" />
  </div>

  <p class="hero__lede">Built to hold a heading through fog, pockets and second thoughts. Norrow makes getting lost feel optional.</p>

  <aside class="hero__card">
    <p class="hero__card-title">Made by two people in a small brass workshop.</p>
    <p class="hero__card-note">The world's most overthought pocket compass.</p>
  </aside>

  <a class="hero__scroll" href="#"><span class="hero__scroll-ring" aria-hidden="true"></span>Scroll to continue</a>
</section>

<style>
  .hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    gap: var(--space-m) var(--gap);
    min-height: clamp(640px, 62.5vw, 900px);
    padding: var(--space-m) calc(var(--edge) + 44px) var(--space-l) var(--edge);
    overflow: hidden;
    isolation: isolate;
    color: var(--cream);
  }

  /* The desk, the mat and the pencil: drawn, fixed style. */
  .hero__desk {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      repeating-linear-gradient(94deg, transparent 0 26px, color-mix(in srgb, var(--desk-deep) 22%, transparent) 26px 28px, transparent 28px 61px),
      radial-gradient(120% 90% at 30% 20%, var(--desk), var(--desk-deep));
  }
  .hero__mat {
    position: absolute;
    left: 25%;
    top: -6%;
    width: 86%;
    height: 94%;
    border-radius: 18px;
    transform: rotate(-3deg);
    background:
      repeating-linear-gradient(90deg, var(--cream-line) 0 var(--rule), transparent var(--rule) var(--mat-cell)),
      repeating-linear-gradient(0deg, var(--cream-line) 0 var(--rule), transparent var(--rule) var(--mat-cell)),
      radial-gradient(90% 80% at 40% 40%, var(--mat), var(--mat-deep));
    background-position: 48px 0, 0 calc(100% - 48px), 0 0;
    box-shadow: var(--shadow-object);
  }
  .hero__ruler {
    position: absolute;
    display: flex;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--cream-soft);
  }
  .hero__ruler--side {
    left: 10px;
    top: 0;
    bottom: 48px;
    flex-direction: column-reverse;
    justify-content: space-between;
  }
  .hero__ruler--foot {
    left: 48px;
    right: 0;
    bottom: 14px;
    justify-content: space-between;
  }
  .hero__pencil {
    position: absolute;
    left: -4%;
    bottom: 16%;
    width: clamp(180px, 26vw, 380px);
    transform: rotate(-32deg);
    filter: drop-shadow(10px 14px 8px var(--shade));
  }
  .hero__pencil-body { fill: var(--mat-deep); }
  .hero__pencil-wood { fill: var(--paper); }
  .hero__pencil-lead { fill: var(--night); }
  .hero__pencil-band { fill: var(--signal); }

  /* Top bar */
  .hero__bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
  }
  .hero__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cream);
  }
  .hero__nav {
    display: flex;
    gap: var(--space-m);
  }
  .hero__link,
  .hero__menu,
  .hero__scroll {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: inherit;
    font: 500 var(--text-xs)/1.1 var(--font-display);
    text-transform: uppercase;
    text-decoration: none;
  }
  .hero__link {
    justify-content: center;
    min-width: 44px;
    padding-inline: 2px;
    background: linear-gradient(90deg, currentColor 50%, transparent 50%) 0 calc(50% + 10px) / 4px var(--rule) repeat-x;
    background-size: 4px 0;
    transition: background-size var(--quick) var(--ease-plain);
  }
  .hero__link.is-active,
  .hero__link:hover,
  .hero__link:focus-visible {
    background-size: 4px var(--rule);
  }
  .hero__menu {
    display: none;
    gap: var(--space-xs);
    padding: 0 var(--space-m);
    border: var(--dash) dashed var(--cream);
    border-radius: var(--radius-pill);
    background: transparent;
    cursor: pointer;
  }
  .hero__menu::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
  }
  .hero__menu.is-open::before {
    background: var(--signal);
  }
  .hero__tab {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: var(--space-s);
    width: 44px;
    padding: var(--space-m) 0;
    writing-mode: vertical-rl;
    background: var(--cream);
    color: var(--night);
    font: 500 var(--text-xs)/44px var(--font-display);
    text-transform: uppercase;
    text-decoration: none;
    transition: padding-block var(--time) var(--ease-plain);
  }
  .hero__tab::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-inline: auto;
    border-radius: 50%;
    background: currentColor;
  }
  .hero__tab:hover,
  .hero__tab:focus-visible {
    padding-block: var(--space-m) var(--space-xl);
  }

  /* Wordmark and copy */
  .hero__head {
    grid-column: 1 / -1;
    position: relative;
    z-index: 2;
  }
  .hero__tagline {
    margin: 0 0 0.2em 0.35em;
    padding-left: 30%;
    font-size: var(--text-m);
    font-weight: 500;
    line-height: 1.1;
    text-transform: uppercase;
  }
  .hero__wordmark {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--display);
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: -0.01em;
    text-transform: uppercase;
  }

  .hero__object {
    --lean-x: 0px;
    --lean-y: 0px;
    position: absolute;
    left: 50%;
    top: 54%;
    width: clamp(220px, 27vw, 400px);
    aspect-ratio: 1;
    margin: calc(clamp(220px, 27vw, 400px) / -2) 0 0 calc(clamp(220px, 27vw, 400px) / -2);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: calc(var(--lean-x) * -1.4) calc(30px - var(--lean-y) * 1.4) 44px -8px var(--shade);
    transform: translate(var(--lean-x), var(--lean-y));
    transition: transform var(--time) var(--ease-plain), box-shadow var(--time) var(--ease-plain);
    animation: hero-float 6s ease-in-out infinite;
  }
  .hero__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 47% 36%;
    transform: scale(1.62);
    transform-origin: 47% 34%;
  }
  @keyframes hero-float {
    50% { translate: 0 -6px; rotate: 2deg; }
  }

  .hero__lede {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
    justify-self: end;
    position: relative;
    z-index: 2;
    max-width: 20ch;
    margin: 0;
    font-size: clamp(var(--text-m), 2vw, 28.5px);
    font-weight: 500;
    line-height: 1.26;
    text-shadow: 0 2px 18px var(--mat-deep);
  }

  .hero__card {
    grid-column: 1;
    grid-row: 4;
    position: relative;
    z-index: 2;
    display: grid;
    gap: var(--space-xl);
    width: min(270px, 100%);
    padding: var(--space-m);
    border: var(--rule) solid var(--cream-line);
    background: var(--cream-veil);
    backdrop-filter: blur(14px);
  }
  .hero__card-title {
    margin: 0;
    font-size: var(--text-l);
    font-weight: 500;
    line-height: 1.12;
    text-transform: uppercase;
  }
  .hero__card-note {
    margin: 0;
    padding-top: var(--space-m);
    border-top: var(--rule) dotted var(--cream);
    font-size: var(--text-s);
    font-weight: 500;
    line-height: 1.4;
    text-align: right;
  }

  .hero__scroll {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
    gap: var(--space-s);
    position: relative;
    z-index: 2;
  }
  .hero__scroll-ring {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: var(--rule) dashed currentColor;
    border-radius: 50%;
  }
  .hero__scroll-ring::after {
    content: "";
    width: 5px;
    height: 5px;
    margin-top: -3px;
    border: solid currentColor;
    border-width: 0 var(--rule) var(--rule) 0;
    transform: rotate(45deg);
  }

  @media (max-width: 720px) {
    .hero {
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: auto auto auto 1fr auto;
      min-height: 820px;
      padding-right: var(--edge);
    }
    .hero__nav,
    .hero__tab { display: none; }
    .hero__menu { display: inline-flex; }
    .hero__nav.is-open {
      position: absolute;
      top: 70px;
      right: var(--edge);
      z-index: 5;
      display: grid;
      gap: 0;
      min-width: 180px;
      padding: var(--space-s) var(--space-m);
      border-radius: var(--radius-s);
      background: var(--cream);
      color: var(--night);
    }
    .hero__tagline { padding-left: 0; margin-left: 0.1em; }
    .hero__wordmark { font-size: clamp(64px, 19vw, 140px); }
    .hero__mat { left: -10%; top: 30%; width: 120%; height: 80%; }
    .hero__lede { grid-column: 1; grid-row: 3; justify-self: start; max-width: 22ch; }
    .hero__object { top: 55%; width: 200px; margin: -100px 0 0 -100px; }
    .hero__card { grid-row: 5; width: min(240px, 70%); gap: var(--space-m); }
    .hero__card-title { font-size: var(--text-m); }
    .hero__scroll { display: none; }
    .hero__pencil { bottom: auto; top: 46%; left: auto; right: -30%; }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero__object { animation: none; transform: none; }
  }
</style>

<script>
  (() => {
    const still = matchMedia('(prefers-reduced-motion: reduce)');
    document.querySelectorAll('.hero').forEach((root) => {
      for (const ruler of root.querySelectorAll('.hero__ruler')) {
        const count = ruler.classList.contains('hero__ruler--side') ? 16 : 24;
        for (let mark = 0; mark <= count; mark += 1) {
          const label = document.createElement('span');
          label.textContent = mark * 10;
          ruler.append(label);
        }
      }
      const object = root.querySelector('.hero__object');
      root.addEventListener('pointermove', (event) => {
        if (still.matches) return;
        const box = root.getBoundingClientRect();
        const x = (event.clientX - box.left) / box.width - 0.5;
        const y = (event.clientY - box.top) / box.height - 0.5;
        object.style.setProperty('--lean-x', `${(x * 24).toFixed(1)}px`);
        object.style.setProperty('--lean-y', `${(y * 18).toFixed(1)}px`);
      });
      root.addEventListener('pointerleave', () => {
        object.style.setProperty('--lean-x', '0px');
        object.style.setProperty('--lean-y', '0px');
      });
      const menu = root.querySelector('.hero__menu');
      const nav = root.querySelector('.hero__nav');
      menu.addEventListener('click', () => {
        const open = !nav.classList.contains('is-open');
        nav.classList.toggle('is-open', open);
        menu.classList.toggle('is-open', open);
        menu.setAttribute('aria-expanded', String(open));
      });
    });
  })();
</script>

Similar components

Sky wordmark hero

Sky wordmark hero

Pill-stuck hero

Pill-stuck hero

Sky hero

Sky hero

Start screen HUD

Start screen HUD

Split words

Split words

Masthead

Masthead

Split hero

Split hero

Split wordmark hero

Split wordmark hero