kitbash Sign in Connect agent
Components

Stage

The signature screen: a giant condensed headline with a rounded green-screen clip floating over its middle, a captions field, corner chips and a neon play disc that turns to a pink pause disc when clicked.

Part of the style

Clip Over Headline

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --ink: #0e1217;
  --black: #020306;
  --paper: #959093;
  --chip: #8b8689;
  --chip-hover: #847e81;
  --ink-soft: #272225;
  --line: #827d80;
  --on-signal: #959093;
  --sky: #6c83a5;
  --signal: #727e94;
  --mint: #747c8d;
  --screen-top: #81858d;
  --screen-bottom: #757b88;
  --stop: #40321f;
}
</style>

<section class="stage" aria-label="Slowbird, now showing">
  <span class="stage__corner" aria-hidden="true"></span>

  <button class="stage__captions" type="button" aria-pressed="false">
    <span class="stage__captions-label">Captions</span>
    <span class="stage__captions-state">off</span>
  </button>

  <h1 class="stage__headline">Slow films of patient animals for patient eyes</h1>

  <figure class="stage__clip">
    <img class="stage__picture" src="assets/tiger.jpg" alt="A tiger lying in long grass below distant hills" width="843" height="637">
    <figcaption class="stage__caption" aria-live="polite">The tiger has not moved for an hour. Neither have we.</figcaption>
    <button class="stage__play" type="button" aria-label="Play the clip">
      <span class="stage__disc stage__disc--play" aria-hidden="true">
        <svg viewBox="0 0 100 100"><path d="M38 28 L72 50 L38 72 Z" /></svg>
      </span>
      <span class="stage__disc stage__disc--pause" aria-hidden="true">
        <svg viewBox="0 0 100 100"><rect x="35" y="30" width="10" height="40" rx="2" /><rect x="55" y="30" width="10" height="40" rx="2" /></svg>
      </span>
    </button>
  </figure>

  <a class="stage__chip stage__chip--left" href="#">A Slowbird screening</a>
  <a class="stage__chip stage__chip--right" href="#">Watch the whole reel</a>
</section>

<style>
  .stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: clamp(560px, 62.5vw, 900px);
    padding: calc(var(--edge) * 5) var(--edge);
    overflow: hidden;
    background: var(--paper);
    isolation: isolate;
  }

  .stage__corner {
    position: absolute;
    top: calc(var(--corner) / -2);
    left: calc(var(--corner) / -2);
    --corner: clamp(180px, 24vw, 350px);
    width: var(--corner);
    height: var(--corner);
    border-radius: var(--radius-round);
    background: var(--signal);
    z-index: -1;
    animation: stage-corner var(--slow) var(--ease-out) both;
  }

  .stage__captions {
    position: absolute;
    top: var(--edge);
    left: var(--edge);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-l);
    min-width: 184px;
    min-height: 44px;
    padding: var(--space-s) var(--space-m);
    border: var(--hairline) solid var(--line);
    border-radius: var(--radius-box);
    background: var(--paper);
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--text-m);
    cursor: pointer;
    transition: color var(--time) var(--ease), border-color var(--time) var(--ease), background var(--time) var(--ease);
  }
  .stage__captions:hover { color: var(--black); border-color: var(--ink-soft); }
  .stage__captions[aria-pressed="true"] { color: var(--black); background: var(--mint); border-color: var(--mint); }
  .stage__captions-state { font-size: var(--text-s); }

  .stage__headline {
    margin: 0;
    max-width: 6.4em;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: var(--display-xl);
    font-weight: 500;
    line-height: var(--display-leading);
    letter-spacing: var(--display-tracking);
    text-align: center;
    text-wrap: balance;
    animation: stage-settle var(--slow) var(--ease-out) 150ms both;
  }

  .stage__clip {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: clamp(240px, 40vw, 576px);
    aspect-ratio: 3 / 2;
    margin: 0;
    border-radius: var(--radius-clip);
    overflow: hidden;
    background: linear-gradient(180deg, var(--screen-top), var(--screen-bottom));
    translate: -50% -50%;
    animation: stage-rise var(--slow) var(--ease-out) 700ms both;
  }

  .stage__picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 40%;
    mix-blend-mode: multiply;
    filter: contrast(1.15);
    scale: 1.4;
    transform-origin: 50% 40%;
  }
  .stage.is-playing .stage__picture { animation: stage-drift 14s linear infinite alternate; }
  .stage.is-paused .stage__picture { animation: stage-drift 14s linear infinite alternate; animation-play-state: paused; }

  .stage__caption {
    position: absolute;
    left: 50%;
    bottom: var(--space-m);
    max-width: calc(100% - 2 * var(--space-m));
    padding: var(--space-xs) var(--space-s);
    border-radius: var(--radius-chip);
    background: var(--black);
    color: var(--paper);
    font-size: var(--text-s);
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    translate: -50% 6px;
    transition: opacity var(--time) var(--ease), translate var(--time) var(--ease-out);
  }
  .stage.is-captioned .stage__caption { opacity: 1; translate: -50% 0; }

  .stage__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .stage__play:focus-visible { outline: 3px solid var(--sky); outline-offset: -3px; border-radius: var(--radius-clip); }

  .stage__disc {
    grid-area: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: var(--radius-round);
    opacity: 0;
    transition: opacity var(--time) var(--ease), scale var(--slow) var(--ease-out);
  }
  .stage__disc svg { width: 100%; height: 100%; fill: var(--on-signal); }
  .stage__disc--play {
    width: min(var(--disc-big), 90%);
    aspect-ratio: 1;
    background: var(--signal);
    scale: 0.7;
  }
  .stage__disc--pause {
    width: var(--disc-small);
    height: var(--disc-small);
    background: var(--stop);
    scale: 0.6;
  }
  .stage:not(.is-playing) .stage__play:is(:hover, :focus-visible) .stage__disc--play { opacity: 1; scale: 1; }
  .stage.is-playing .stage__play:is(:hover, :focus-visible) .stage__disc--pause { opacity: 1; scale: 1; }

  .stage__chip {
    position: absolute;
    bottom: var(--edge);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-s) var(--space-m) calc(var(--space-s) + 2px);
    border-radius: var(--radius-chip);
    background: var(--chip);
    color: var(--black);
    font-size: var(--text-m);
    text-decoration: none;
    transition: background var(--time) var(--ease), color var(--time) var(--ease);
  }
  .stage__chip--left { left: var(--edge); }
  .stage__chip--right { right: var(--edge); }
  .stage__chip:hover { background: var(--black); color: var(--paper); }
  .stage__chip:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

  @keyframes stage-settle {
    from { opacity: 0; scale: 1.25; }
    to { opacity: 1; scale: 1; }
  }
  @keyframes stage-rise {
    from { opacity: 0; translate: -50% calc(-50% + 24px); }
    to { opacity: 1; translate: -50% -50%; }
  }
  @keyframes stage-corner {
    from { scale: 0; }
    to { scale: 1; }
  }
  @keyframes stage-drift {
    from { scale: 1.4; translate: 0 0; }
    to { scale: 1.6; translate: -4% -2%; }
  }

  @media (max-width: 640px) {
    .stage { min-height: 640px; align-items: center; padding-block: 96px 88px; }
    .stage__headline { max-width: 4.2em; font-size: clamp(4.25rem, 24vw, 8rem); }
    .stage__clip { width: min(64vw, 320px); }
    .stage__chip { font-size: var(--text-s); padding-inline: var(--space-s); }
    .stage__chip--left { max-width: calc(50% - var(--edge) * 1.5); }
    .stage__chip--right { max-width: calc(50% - var(--edge) * 1.5); }
  }

  @media (prefers-reduced-motion: reduce) {
    .stage__headline, .stage__clip, .stage__corner { animation: none; }
    .stage.is-playing .stage__picture { animation: none; }
  }
</style>

<script>
(() => {
  for (const root of document.querySelectorAll('.stage')) {
    const play = root.querySelector('.stage__play');
    const captions = root.querySelector('.stage__captions');
    const state = root.querySelector('.stage__captions-state');
    const picture = root.querySelector('.stage__picture');
    let inView = true;
    play.addEventListener('click', () => {
      const playing = !root.classList.contains('is-playing');
      // Paused keeps the drift where it stopped instead of jumping back.
      root.classList.add('is-paused');
      root.classList.toggle('is-playing', playing);
      picture.style.animationPlayState = playing && inView ? 'running' : 'paused';
      play.setAttribute('aria-label', playing ? 'Pause the clip' : 'Play the clip');
    });
    captions.addEventListener('click', () => {
      const on = captions.getAttribute('aria-pressed') !== 'true';
      captions.setAttribute('aria-pressed', String(on));
      state.textContent = on ? 'on' : 'off';
      root.classList.toggle('is-captioned', on);
    });
    // The drift stops while the stage is off screen.
    const watch = new IntersectionObserver(([entry]) => {
      inView = entry.isIntersecting;
      picture.style.animationPlayState = inView && root.classList.contains('is-playing') ? 'running' : 'paused';
    });
    watch.observe(root);
  }
})();
</script>

Similar components

Film reel

Film reel

Kraft split hero

Kraft split hero

Concertina hero

Concertina hero

Hero with editor window

Hero with editor window

Fog hero with fluid blob

Fog hero with fluid blob

Night water statement

Night water statement

Pebbled portrait hero

Pebbled portrait hero

Tunnel heading

Tunnel heading