kitbash Sign in Connect agent
Components

Catchphrase and tickets

A black box with a catchphrase spread across four lines word by word, a tilted oval badge and a halftone picture, with three tilted tickets in blue, pink and black piled over its lower edge. Tickets lift and level out on hover.

Part of the style

Backroom Tunnel

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --metal: #5c563d;
  --backstage: #f1f7ef;
  --spot: #4f4930;
  --neon: #6d7259;
  --echo: #806855;
}
</style>

<section class="encore" aria-label="Find out more">
  <div class="encore__box">
    <h2 class="encore__label">Find out more</h2>

    <div class="encore__media">
      <canvas class="encore__picture" role="img" aria-label="Halftone photo of three coils of press cable hanging from hooks on a pegboard"></canvas>
    </div>

    <div class="encore__phrase-wrap">
      <p class="encore__phrase">
        <span class="encore__line"><span class="encore__word">Ready</span><span class="encore__word">to pull</span></span>
        <span class="encore__line"><span class="encore__word">your</span></span>
        <span class="encore__line"><span class="encore__word">first</span><span class="encore__word">real</span></span>
        <span class="encore__line"><span class="encore__word">print?</span></span>
      </p>
      <a class="encore__badge" href="#">
        <svg class="encore__oval" viewBox="0 0 181 93" preserveAspectRatio="none" aria-hidden="true">
          <path d="M28 18.5C55 4.2 128 1.6 158 16.4c21 10.4 25 32.6 11.4 49.2C152 86.8 96 93 55.6 86.2 21.4 80.4 2.6 64.4 3.4 45.6 4 31.4 16.6 22.2 41.2 13.4"></path>
        </svg>
        <span class="encore__badge-text">Try a trade for one night</span>
      </a>
    </div>
  </div>

  <ul class="encore__tickets">
    <li class="encore__ticket encore__ticket--echo">
      <a class="encore__ticket-link" href="#">
        <span class="encore__ticket-word">Jobs</span>
        <span class="encore__stub">
          <span class="encore__arrow">
            <svg class="encore__ring" viewBox="0 0 58 47" preserveAspectRatio="none" aria-hidden="true"><path d="M29.6 2.4C45.2 2 56 11.6 55.6 24.2 55.2 36.8 43 45 28.4 44.6 13.8 44.2 2.4 35.4 2.6 23.2 2.8 11 14.4 2.8 29.6 2.4z"></path></svg>
            <svg class="encore__icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 12h15M13 6l6 6-6 6"></path></svg>
          </span>
        </span>
      </a>
    </li>
    <li class="encore__ticket encore__ticket--neon">
      <a class="encore__ticket-link" href="#">
        <span class="encore__ticket-word">Trades</span>
        <span class="encore__stub">
          <span class="encore__arrow">
            <svg class="encore__ring" viewBox="0 0 58 47" preserveAspectRatio="none" aria-hidden="true"><path d="M29.6 2.4C45.2 2 56 11.6 55.6 24.2 55.2 36.8 43 45 28.4 44.6 13.8 44.2 2.4 35.4 2.6 23.2 2.8 11 14.4 2.8 29.6 2.4z"></path></svg>
            <svg class="encore__icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 12h15M13 6l6 6-6 6"></path></svg>
          </span>
        </span>
      </a>
    </li>
    <li class="encore__ticket encore__ticket--noir">
      <a class="encore__ticket-link" href="#">
        <span class="encore__ticket-word">Voices</span>
        <span class="encore__stub">
          <span class="encore__arrow">
            <svg class="encore__ring" viewBox="0 0 58 47" preserveAspectRatio="none" aria-hidden="true"><path d="M29.6 2.4C45.2 2 56 11.6 55.6 24.2 55.2 36.8 43 45 28.4 44.6 13.8 44.2 2.4 35.4 2.6 23.2 2.8 11 14.4 2.8 29.6 2.4z"></path></svg>
            <svg class="encore__icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 12h15M13 6l6 6-6 6"></path></svg>
          </span>
        </span>
      </a>
    </li>
  </ul>
</section>

<style>
  .encore {
    overflow-x: clip;
    padding: var(--edge) var(--edge) var(--space-6);
    background: var(--metal);
  }

  .encore__box {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: var(--space-6) var(--space-4) var(--space-4);
    border-radius: var(--radius-main);
    background: var(--backstage);
    color: var(--metal);
  }
  @media (min-width: 768px) {
    .encore__box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  .encore__label {
    grid-column: 1 / -1;
    margin: 0;
    font: 400 var(--t-c1)/1.1 var(--font-label);
    font-stretch: calc(var(--label-width) * 1%);
    text-transform: uppercase;
  }

  .encore__media {
    order: 2;
    align-self: end;
    width: 82%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-main);
  }
  .encore__picture {
    width: 100%;
    height: 100%;
    color: var(--metal);
  }

  .encore__phrase-wrap {
    position: relative;
    order: 1;
    margin: 0 0 calc(96px + 8vw) auto;
    width: 100%;
    max-width: calc(14.2ch * 1);
    font: 400 var(--t-h1-alt)/0.99 var(--font-label);
    font-stretch: calc(var(--label-width) * 1%);
    letter-spacing: -0.0276em;
    text-transform: uppercase;
  }
  @media (min-width: 768px) {
    .encore__media { order: 0; }
    .encore__phrase-wrap { order: 0; }
  }
  .encore__phrase {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
  }
  .encore__line {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 var(--space-3);
  }
  .encore__line:nth-child(2) { justify-content: center; }
  .encore__line:nth-child(4) { justify-content: flex-end; }
  .encore__word { white-space: nowrap; }

  .encore__badge {
    position: absolute;
    top: 30%;
    left: -12%;
    display: grid;
    place-items: center;
    width: 181px;
    min-height: 93px;
    padding: 16px 26px;
    color: var(--metal);
    text-decoration: none;
    rotate: -10deg;
    transition: color var(--time) var(--ease);
  }
  .encore__oval {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: var(--backstage);
    stroke: var(--metal);
    stroke-width: var(--outline);
    stroke-linecap: round;
    transition: fill var(--time) var(--ease), stroke var(--time) var(--ease);
  }
  .encore__oval path { vector-effect: non-scaling-stroke; }
  .encore__badge-text {
    position: relative;
    max-width: 10ch;
    font: 400 var(--t-c1)/1 var(--font-label);
    font-stretch: calc(var(--label-width) * 1%);
    letter-spacing: 0;
    text-align: center;
  }
  .encore__badge:hover,
  .encore__badge:focus-visible { color: var(--backstage); }
  .encore__badge:hover .encore__oval,
  .encore__badge:focus-visible .encore__oval { fill: var(--metal); }
  .encore__badge:focus-visible { outline: none; }
  .encore__badge:focus-visible .encore__oval { stroke: var(--neon); }

  .encore__tickets {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
    padding: 0;
    list-style: none;
  }
  .encore__ticket {
    --encore-ty: 0%;
    --encore-tx: 0%;
    --encore-tilt: 0deg;
    margin-top: var(--encore-mt, 0);
    transform: translateY(var(--encore-ty)) translateX(var(--encore-tx)) rotate(var(--encore-tilt));
    transition: transform var(--time) var(--ease);
  }
  .encore__ticket:nth-child(1) { --encore-mt: -30%; --encore-tx: 3%; --encore-tilt: 4deg; }
  .encore__ticket:nth-child(2) { --encore-mt: -6%; --encore-tx: -8%; --encore-tilt: -7deg; }
  .encore__ticket:nth-child(3) { --encore-mt: -5%; --encore-tx: 9%; --encore-tilt: 3deg; }
  @media (min-width: 1200px) {
    .encore__ticket:nth-child(1) { --encore-tx: 0%; --encore-tilt: 5deg; }
    .encore__ticket:nth-child(2) { --encore-mt: -11%; --encore-tx: -18%; --encore-tilt: -10deg; }
    .encore__ticket:nth-child(3) { --encore-mt: -15%; --encore-tx: 20%; --encore-tilt: 4.5deg; }
  }
  @media (hover: hover) {
    .encore__ticket:nth-child(1):hover { --encore-ty: -15%; --encore-tilt: 2deg; }
    .encore__ticket:nth-child(2):hover { --encore-ty: -15%; --encore-tilt: -5deg; }
    .encore__ticket:nth-child(3):hover { --encore-ty: -15%; --encore-tilt: 1.5deg; }
  }
  .encore__ticket:nth-child(1):focus-within { --encore-ty: -15%; --encore-tilt: 2deg; }
  .encore__ticket:nth-child(2):focus-within { --encore-ty: -15%; --encore-tilt: -5deg; }
  .encore__ticket:nth-child(3):focus-within { --encore-ty: -15%; --encore-tilt: 1.5deg; }

  .encore__ticket--echo { --encore-bg: var(--echo); --encore-ink: var(--backstage); }
  .encore__ticket--neon { --encore-bg: var(--neon); --encore-ink: var(--backstage); }
  .encore__ticket--noir { --encore-bg: var(--backstage); --encore-ink: var(--metal); }

  .encore__ticket-link {
    display: flex;
    align-items: stretch;
    width: clamp(290px, 33vw, 470px);
    min-height: clamp(104px, 11vw, 158px);
    border-radius: var(--radius-main);
    background: var(--encore-bg);
    color: var(--encore-ink);
    text-decoration: none;
  }
  .encore__ticket-link:focus-visible { outline: 3px solid var(--neon); outline-offset: 4px; }
  .encore__ticket--neon .encore__ticket-link:focus-visible { outline-color: var(--backstage); }
  .encore__ticket-word {
    display: flex;
    flex: 1;
    align-items: center;
    padding: 0 var(--space-7);
    font: 800 var(--t-h3)/0.95 var(--font-poster);
    letter-spacing: -0.039em;
    text-transform: uppercase;
  }
  .encore__stub {
    display: flex;
    align-items: center;
    padding: 0 var(--space-7);
    background: linear-gradient(var(--encore-ink) 55%, transparent 0) left top / 2px 9px repeat-y;
  }
  .encore__arrow {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 47px;
  }
  .encore__ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: transparent;
    stroke: var(--encore-ink);
    stroke-width: var(--outline);
    transition: fill var(--time) var(--ease), stroke var(--time) var(--ease);
  }
  .encore__ring path { vector-effect: non-scaling-stroke; }
  .encore__icon {
    position: relative;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--encore-ink);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke var(--time) var(--ease);
  }
  .encore__ticket:hover .encore__ring,
  .encore__ticket:focus-within .encore__ring { fill: var(--encore-ink); }
  .encore__ticket:hover .encore__icon,
  .encore__ticket:focus-within .encore__icon { stroke: var(--encore-bg); }

  @media (min-width: 768px) and (max-width: 1199.98px) {
    .encore__badge { top: 18%; left: -52%; }
  }
  @media (max-width: 575.98px) {
    .encore__ticket:nth-child(2) { --encore-tx: -5%; }
    .encore__ticket:nth-child(3) { --encore-tx: 5%; }
    .encore__badge { position: relative; top: auto; left: auto; margin: var(--space-5) 0 0 auto; }
  }
</style>

<script>
(() => {
  const clamp = (value) => Math.min(1, Math.max(0, value));
  const grain = (x, y) => {
    const n = Math.sin(x * 12.9898 + y * 78.233) * 43758.5453;
    return n - Math.floor(n);
  };

  function coil(x, y, cx, cy, radius, thickness) {
    const dx = x - cx;
    const dy = (y - cy) * 1.12;
    const distance = Math.hypot(dx, dy);
    const inside = (distance - (radius - thickness)) / thickness;
    if (inside < 0 || inside > 1) return -1;
    const facing = clamp(-(dx / distance) * 0.6 - (dy / distance) * 0.75);
    const loops = Math.abs(Math.sin(inside * Math.PI * 6)) ** 0.45;
    const roundness = Math.sin(inside * Math.PI);
    return clamp((0.3 + 0.75 * facing) * (0.45 + 0.55 * roundness) * (0.2 + 0.8 * loops));
  }

  function light(x, y) {
    let value = 0.04 + 0.22 * clamp(1 - Math.hypot(x - 0.2, y - 0.15) * 1.4);
    const peg = ((x * 18) % 1 + 1) % 1;
    const row = ((y * 18) % 1 + 1) % 1;
    if (Math.hypot(peg - 0.5, row - 0.5) < 0.16) value = 0;

    for (const [cx, cy, radius, thickness, hook] of [[0.3, 0.42, 0.22, 0.1, 0.16], [0.74, 0.35, 0.17, 0.08, 0.14], [0.58, 0.8, 0.26, 0.12, 0.5]]) {
      if (Math.abs(x - cx) < 0.012 && y > hook && y < cy - radius / 1.12 + 0.02) value = 0.75 - (x - cx) * 20;
      if (Math.abs(y - hook) < 0.012 && Math.abs(x - cx) < 0.03) value = 0.85;
      const ring = coil(x, y, cx, cy, radius, thickness);
      if (ring >= 0) value = ring;
    }
    return clamp(value + (grain(x * 991, y * 997) - 0.5) * 0.08);
  }

  function halftone(canvas) {
    const width = canvas.clientWidth;
    const height = canvas.clientHeight;
    if (!width) return;
    const context = canvas.getContext('2d');
    const density = Math.min(2, devicePixelRatio || 1);
    canvas.width = Math.round(width * density);
    canvas.height = Math.round(height * density);
    context.setTransform(density, 0, 0, density, 0, 0);
    context.clearRect(0, 0, width, height);
    context.fillStyle = getComputedStyle(canvas).color;
    const cell = Math.max(4, width / 110);
    const reach = Math.max(width, height) * 1.5;
    const cos = Math.SQRT1_2;
    for (let u = -reach; u < reach; u += cell) {
      for (let v = -reach; v < reach; v += cell) {
        const x = (u - v) * cos + width / 2;
        const y = (u + v) * cos + height / 2;
        if (x < -cell || y < -cell || x > width + cell || y > height + cell) continue;
        const radius = cell * 0.64 * Math.pow(light(x / width, y / height), 0.8);
        if (radius < 0.35) continue;
        context.beginPath();
        context.arc(x, y, radius, 0, Math.PI * 2);
        context.fill();
      }
    }
  }

  document.querySelectorAll('.encore').forEach((root) => {
    const canvas = root.querySelector('.encore__picture');
    let width = 0;
    let pending = 0;
    new ResizeObserver(() => {
      if (canvas.clientWidth === width) return;
      width = canvas.clientWidth;
      cancelAnimationFrame(pending);
      pending = requestAnimationFrame(() => halftone(canvas));
    }).observe(canvas);
  });
})();
</script>

Similar components

Big call and footer

Big call and footer

Appeal

Appeal

Sign-off and sticker pile

Sign-off and sticker pile

Signup card

Signup card

Closing call and horizon

Closing call and horizon

Figure with call to action

Figure with call to action

Black statement

Black statement

Small caps statement

Small caps statement