kitbash Sign in Connect agent
Components

Intro loader

Grey screen with a pulsing dot and a corner counter that runs to 100, then the wordmark slides in at the top left. A replay button runs it again.

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 */
@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;800&family=Newsreader:opsz,wght@6..72,400;6..72,600&display=swap");
:root {
  --paper: #81b5d7;
  --ink: #14110b;
  --ink-mid: rgba(20, 17, 11, 0.6);
  --ink-soft: rgba(20, 17, 11, 0.45);
  --rule: rgba(20, 17, 11, 0.16);
  --rule-strong: #14110b;
  --mist: #77a7c6;
  --fog: #6c98b5;
  --sand: #75a4c3;
  --on-wine: #81b5d7;
  --wine: #203c4b;
  --signal: #a31e12;
  --font-display: "Newsreader", "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mark: "Newsreader", "Iowan Old Style", "Times New Roman", serif;
}
</style>

<section class="loader" aria-label="Intro">
  <p class="loader__mark" aria-label="Keel">KEEL</p>
  <span class="loader__dot" aria-hidden="true"></span>
  <p class="loader__count" aria-live="off"><span class="loader__tick" aria-hidden="true"></span><span class="loader__number">00</span></p>
  <button class="loader__replay" type="button">Replay intro</button>
</section>

<style>
  .loader {
    position: relative;
    height: clamp(22rem, 58vw, 40rem);
    background: var(--mist);
    color: var(--ink);
    overflow: hidden;
  }
  .loader__mark {
    position: absolute;
    top: var(--gutter);
    left: var(--gutter);
    margin: 0;
    font-family: var(--font-mark);
    font-size: clamp(2rem, 1.2rem + 3.4vw, 4rem);
    line-height: 1;
    letter-spacing: -0.02em;
    transition: transform var(--mid) var(--ease), opacity var(--mid) var(--ease);
  }
  .loader.is-counting .loader__mark {
    transform: translateY(40%);
    opacity: 0;
  }
  .loader__dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: var(--radius-round);
    background: var(--ink);
    opacity: 0;
    transition: opacity var(--quick) var(--ease-colour);
  }
  .loader.is-counting .loader__dot {
    opacity: 1;
    animation: loader-pulse 0.9s var(--ease) infinite alternate;
  }
  @keyframes loader-pulse {
    to { transform: scale(0.45); opacity: 0.4; }
  }
  .loader__count {
    position: absolute;
    left: var(--gutter);
    bottom: var(--gutter);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin: 0;
    font-size: var(--text-label);
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--track-label);
  }
  .loader__tick {
    width: 12px;
    height: 10px;
    border-left: var(--hairline) solid var(--ink);
    background: linear-gradient(var(--ink), var(--ink)) left center / 100% var(--hairline) no-repeat;
  }
  .loader__replay {
    position: absolute;
    right: var(--gutter);
    bottom: calc(var(--gutter) - 0.9rem);
    min-height: var(--tap);
    padding: 0 var(--space-s);
    border: 0;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--text-label);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--quick) var(--ease-colour);
  }
  .loader__replay:hover { color: var(--ink); }
</style>

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

  function setup(root) {
    const number = root.querySelector('.loader__number');
    let frame = 0;

    const show = (value) => { number.textContent = String(value).padStart(2, '0'); };

    const finish = () => {
      cancelAnimationFrame(frame);
      show(100);
      root.classList.remove('is-counting');
    };

    const play = () => {
      if (still.matches) return finish();
      cancelAnimationFrame(frame);
      root.classList.add('is-counting');
      const start = performance.now();
      const tick = (now) => {
        const progress = Math.min(1, (now - start) / duration);
        show(Math.round(progress * 100));
        if (progress < 1) frame = requestAnimationFrame(tick);
        else finish();
      };
      frame = requestAnimationFrame(tick);
    };

    root.querySelector('.loader__replay').addEventListener('click', play);
    let played = false;
    const watcher = new IntersectionObserver(([entry]) => {
      if (!entry.isIntersecting) return finish();
      if (played) return;
      played = true;
      play();
    });
    watcher.observe(root);
  }

  document.querySelectorAll('.loader').forEach(setup);
})();
</script>

Similar components

Spine opening

Spine opening

Blur-in statement

Blur-in statement

Scramble loader

Scramble loader

Lens-scale intro

Lens-scale intro

Letter gathering intro

Letter gathering intro

Thumbnail ring loader

Thumbnail ring loader

Badge intro

Badge intro

Wordmark intro

Wordmark intro