kitbash Sign in Connect agent
Components

Boot screen

Black intro that types a column of capability lines and a warning, with a red load line crawling along the bottom; replays on click.

Part of the style

Hostile HUD

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=Inter:opsz,wght@14..32,400..700&family=Fraunces:ital,opsz,wght@1,9..144,400..600&display=swap");
:root {
  --void: #20101f;
  --night: #352334;
  --night-2: #322031;
  --bar: #473446;
  --text: #bfa8be;
  --text-dim: rgba(191, 168, 190, 0.55);
  --text-ghost: rgba(191, 168, 190, 0.22);
  --rule: rgba(191, 168, 190, 0.14);
  --chrome: #bba4ba;
  --alarm: #383958;
  --signal: #3f4065;
  --alarm-deep: #3d3e52;
  --rgb-r: #474769;
  --frost: #9c7bac;
  --rgb-g: #d77b5d;
  --rgb-b: #543d6d;
  --font-display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}
</style>

<section class="boot" aria-label="Loading Mostly Wrecked">
  <svg class="boot__mark" viewBox="0 0 24 24" aria-hidden="true">
    <path d="M10 2h4v4h6v3h-6v9l5-3 2 3-9 5-9-5 2-3 5 3V9H4V6h6Z" fill="currentColor"/>
  </svg>

  <p class="boot__name boot__item">Mostly Wrecked</p>
  <p class="boot__about boot__item"><span class="boot__cursor"></span>Seabed survey<br>Est. 2019<br>North Sea</p>

  <ul class="boot__list">
    <li class="boot__item">Sonar mapping</li>
    <li class="boot__item">Wreck photography</li>
    <li class="boot__item">Hull inspection</li>
    <li class="boot__item">Salvage paperwork</li>
    <li class="boot__item">Night dives</li>
    <li class="boot__item">Cold water</li>
    <li class="boot__item">Colder water</li>
    <li class="boot__item">Regret</li>
  </ul>

  <div class="boot__warning">
    <p class="boot__item boot__dim">00</p>
    <p class="boot__item">For a worse experience<br>take off your wetsuit</p>
    <p class="boot__item boot__dim">Ok</p>
  </div>

  <div class="boot__foot">
    <span class="boot__count" aria-live="off">000</span>
    <span class="boot__status boot__item">Loading the bottom of the sea</span>
    <button class="boot__replay" type="button">Again +</button>
  </div>

  <span class="boot__load" aria-hidden="true"></span>
</section>

<style>
  .boot {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto 1fr auto auto;
    gap: var(--space-m) var(--space-s);
    height: clamp(480px, 50vw, 720px);
    padding: var(--edge);
    overflow: hidden;
    background: var(--void);
    color: var(--text);
    font-size: var(--text-xs);
    line-height: var(--leading-hud);
  }
  .boot p { margin: 0; }
  .boot__mark {
    grid-column: 1 / 3;
    width: 18px;
    color: var(--text);
  }
  .boot__name { grid-column: 4 / 6; }
  .boot__about {
    grid-column: 7 / 10;
    position: relative;
    padding-left: var(--space-s);
  }
  .boot__cursor {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 1.1em;
    background: var(--text);
    animation: boot-blink 0.9s steps(1, end) infinite;
    animation-play-state: paused;
  }
  .boot.is-live .boot__cursor { animation-play-state: running; }

  .boot__list {
    grid-column: 7 / 10;
    grid-row: 2;
    align-self: center;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .boot__warning {
    grid-column: 7 / 11;
    grid-row: 3;
    display: grid;
    grid-template-columns: 2em 1fr auto;
    gap: var(--space-s);
  }
  .boot__dim { color: var(--text-dim); }

  .boot__foot {
    grid-column: 1 / -1;
    grid-row: 4;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-s);
    align-items: center;
  }
  .boot__count {
    grid-column: 1 / 3;
    font-family: var(--font-mono);
    letter-spacing: 0;
  }
  .boot__status { grid-column: 7 / 10; }
  .boot__replay {
    grid-column: 11 / -1;
    justify-self: end;
    min-height: var(--tap);
    padding: 0 var(--space-m);
    border: 0;
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    transition: color var(--quick) ease, background var(--quick) ease;
  }
  .boot__replay:hover,
  .boot__replay:focus-visible {
    color: var(--void);
    background: var(--text);
    outline: none;
  }

  .boot__load {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--signal);
    transform: scaleX(0);
    transform-origin: 0 0;
  }
  .boot.is-running .boot__load {
    animation: boot-load var(--boot) linear forwards;
  }

  /* Each line is cut in from the left in hard steps, one after another. */
  .boot__item {
    clip-path: inset(0 100% 0 0);
  }
  .boot.is-running .boot__item {
    animation: boot-peek 0.3s var(--step) forwards;
    animation-delay: calc(var(--order, 0) * var(--line-in));
  }
  .boot.is-done .boot__item { clip-path: none; }

  @keyframes boot-peek { to { clip-path: inset(0 0 0 0); } }
  @keyframes boot-load { to { transform: scaleX(1); } }
  @keyframes boot-blink { 50% { opacity: 0; } }

  @media (max-width: 40rem) {
    .boot { grid-template-rows: auto auto 1fr auto auto; }
    .boot__name { grid-column: 4 / -1; grid-row: 1; }
    .boot__about { grid-column: 4 / -1; grid-row: 2; }
    .boot__list { grid-column: 4 / -1; grid-row: 3; }
    .boot__warning { grid-column: 1 / -1; grid-row: 4; }
    .boot__foot { grid-row: 5; }
    .boot__status { grid-row: 1; grid-column: 1 / -1; }
    .boot__count { grid-row: 2; grid-column: 1 / 4; }
    .boot__replay { grid-row: 2; grid-column: 4 / -1; }
  }

  @media (prefers-reduced-motion: reduce) {
    .boot__item { clip-path: none; }
    .boot__load { transform: none; }
    .boot__cursor { animation: none; }
  }
</style>

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

  function run(root) {
    const count = root.querySelector('.boot__count');
    const length = parseFloat(getComputedStyle(root).getPropertyValue('--boot')) * 1000 || 2400;
    let frame = 0;

    root.querySelectorAll('.boot__item').forEach((item, order) => item.style.setProperty('--order', order));

    const showCount = (share) => {
      count.textContent = String(Math.round(share * 100)).padStart(3, '0');
    };
    const play = () => {
      cancelAnimationFrame(frame);
      root.classList.remove('is-running', 'is-done');
      if (still.matches) {
        root.classList.add('is-done');
        showCount(1);
        return;
      }
      void root.offsetWidth;
      root.classList.add('is-running');
      const start = performance.now();
      const step = (now) => {
        const share = Math.min(1, (now - start) / length);
        showCount(share);
        if (share < 1) frame = requestAnimationFrame(step);
        else root.classList.add('is-done');
      };
      frame = requestAnimationFrame(step);
    };

    root.querySelector('.boot__replay').addEventListener('click', play);
    let played = false;
    new IntersectionObserver(([entry]) => {
      root.classList.toggle('is-live', entry.isIntersecting);
      if (entry.isIntersecting && !played) {
        played = true;
        play();
      }
    }).observe(root);
  }

  document.querySelectorAll('.boot').forEach(run);
})();
</script>

Similar components

Wordmark intro

Wordmark intro

Wordmark intro

Wordmark intro

Badge intro

Badge intro

Counter loader

Counter loader

Greeting loader

Greeting loader

Intro loader

Intro loader

Loading screen

Loading screen

Reading passage

Reading passage