kitbash Sign in Connect agent
Components

Error screen

Red CRT flood with scanlines, a broken cross glyph, barcode labels and a periodic sideways tear with a cyan strip; the button forces a burst.

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 */
:root {
  --void: #2c2c2c;
  --night: #474643;
  --night-2: #514f4c;
  --bar: #6d6b64;
  --text: #fff3e6;
  --text-dim: rgba(255, 243, 230, 0.55);
  --text-ghost: rgba(255, 243, 230, 0.22);
  --rule: rgba(255, 243, 230, 0.14);
  --chrome: #fff6ec;
  --alarm: #ba4f31;
  --signal: #cc502c;
  --alarm-deep: #682c1b;
  --rgb-r: #cf5f3f;
  --frost: #dd7a6d;
  --rgb-g: #cda679;
  --rgb-b: #aa6b6e;
}
</style>

<section class="error" aria-label="Error, page not found">
  <div class="error__scene">
    <span class="error__terrain" aria-hidden="true"></span>
    <svg class="error__glyph" 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="error__code"><span class="error__digits">ERR 0412</span><span class="error__bars" aria-hidden="true"></span></p>
    <p class="error__status">Status<br><b>Sunk</b></p>
    <p class="error__note">Lat 61.0412<br>Visibility none<br>Oxygen ask later</p>
    <h2 class="error__shout">Too deep</h2>
  </div>
  <p class="error__strip"><i class="error__slash">//</i> The page you want is at the bottom of the sea <i class="error__slash">//</i></p>
  <button class="error__button" type="button">Shake it +</button>
</section>

<style>
  .error {
    position: relative;
    height: clamp(480px, 50vw, 720px);
    overflow: hidden;
    background: var(--alarm);
    color: var(--void);
    font-size: var(--text-xs);
    line-height: var(--leading-hud);
  }
  .error p { margin: 0; }
  .error__scene,
  .error__slice {
    position: absolute;
    inset: 0;
    background: var(--alarm);
  }
  /* CRT: scanlines and a dark rim drawn over everything. */
  .error::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, 0.18) 2px 3px),
      radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.75) 100%);
    z-index: 3;
  }
  .error__terrain {
    position: absolute;
    inset: 40% -5% -5%;
    background: radial-gradient(circle, var(--alarm-deep) 0.9px, transparent 1.3px) 0 0 / var(--dot-step) var(--dot-step);
    -webkit-mask: radial-gradient(ellipse 40% 50% at 20% 60%, #000 60%, transparent 62%), radial-gradient(ellipse 50% 40% at 75% 70%, #000 60%, transparent 62%), linear-gradient(transparent 55%, #000 56%);
    mask: radial-gradient(ellipse 40% 50% at 20% 60%, #000 60%, transparent 62%), radial-gradient(ellipse 50% 40% at 75% 70%, #000 60%, transparent 62%), linear-gradient(transparent 55%, #000 56%);
  }
  .error__glyph {
    position: absolute;
    left: 50%;
    top: 46%;
    width: clamp(160px, 28vw, 360px);
    translate: -50% -50%;
    rotate: -8deg;
    color: var(--void);
    filter: drop-shadow(14px 0 3px var(--alarm-deep));
  }
  .error__code {
    position: absolute;
    top: 14%;
    left: 52%;
    display: grid;
    gap: var(--space-xs);
  }
  .error__digits { font-family: var(--font-mono); letter-spacing: 0; }
  .error__bars {
    display: block;
    width: 120px;
    height: 18px;
    background: repeating-linear-gradient(90deg, var(--void) 0 2px, transparent 2px 3px, var(--void) 3px 4px, transparent 4px 7px, var(--void) 7px 10px, transparent 10px 11px);
  }
  .error__status {
    position: absolute;
    top: 30%;
    right: 12%;
  }
  .error__note {
    position: absolute;
    top: 64%;
    left: 30%;
  }
  .error__shout {
    position: absolute;
    left: var(--edge);
    bottom: var(--space-l);
    margin: 0;
    font-size: var(--display-m);
    font-weight: 400;
    line-height: var(--leading-shout);
    letter-spacing: var(--track-shout);
  }

  .error__strip {
    position: absolute;
    left: 0;
    right: 0;
    top: 58%;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: var(--space-m);
    padding: 3px var(--edge);
    background: var(--frost);
    color: var(--void);
    white-space: nowrap;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
    opacity: 0;
  }
  .error__slash { font-style: normal; opacity: 0.55; }

  .error__slice {
    z-index: 1;
    clip-path: inset(var(--top) 0 var(--bottom) 0);
    translate: 0 0;
    visibility: hidden;
  }

  .error.is-live .error__slice {
    animation: error-tear 4.2s var(--step) infinite;
    animation-delay: var(--delay);
  }
  .error.is-live .error__strip {
    animation: error-flicker 4.2s steps(1, end) infinite;
  }
  .error.is-burst .error__slice {
    animation: error-tear 0.5s var(--step) 3;
  }
  .error.is-burst .error__strip {
    animation: error-flicker 0.5s steps(1, end) 3;
  }
  @keyframes error-tear {
    0%, 70% { visibility: hidden; translate: 0 0; }
    72% { visibility: visible; translate: var(--shift) 0; }
    80% { visibility: visible; translate: calc(var(--shift) * -0.4) 0; }
    88% { visibility: visible; translate: calc(var(--shift) * 1.6) 0; }
    92%, 100% { visibility: hidden; translate: 0 0; }
  }
  @keyframes error-flicker {
    0%, 71% { opacity: 0; }
    72% { opacity: 1; }
    76% { opacity: 0; }
    80%, 90% { opacity: 1; }
    92%, 100% { opacity: 0; }
  }

  .error__button {
    position: absolute;
    right: var(--edge);
    bottom: var(--space-l);
    z-index: 4;
    min-height: var(--tap);
    padding: 0 var(--space-m);
    border: 0;
    background: var(--void);
    color: var(--text);
    font: inherit;
    font-size: var(--text-m);
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    transition: background var(--quick) ease, color var(--quick) ease;
  }
  .error__button:hover,
  .error__button:focus-visible {
    background: var(--text);
    color: var(--void);
    outline: none;
  }

  @media (max-width: 40rem) {
    .error__code { left: var(--edge); top: var(--space-l); }
    .error__status { top: var(--space-l); right: var(--edge); }
    .error__note { left: var(--edge); top: 66%; }
    .error__strip { justify-content: flex-start; }
    .error__shout { bottom: calc(var(--space-l) + var(--tap) + var(--space-m)); }
  }
  @media (prefers-reduced-motion: reduce) {
    .error__slice { display: none; }
    .error__strip { opacity: 1; animation: none !important; }
  }
</style>

<script>
(() => {
  const slices = [
    { top: '22%', bottom: '64%', shift: '-38px', delay: '0s' },
    { top: '47%', bottom: '41%', shift: '64px', delay: '0.12s' },
    { top: '70%', bottom: '22%', shift: '-20px', delay: '0.05s' }
  ];

  function run(root) {
    const scene = root.querySelector('.error__scene');
    for (const band of slices) {
      const slice = scene.cloneNode(true);
      slice.className = 'error__slice';
      slice.setAttribute('aria-hidden', 'true');
      slice.style.setProperty('--top', band.top);
      slice.style.setProperty('--bottom', band.bottom);
      slice.style.setProperty('--shift', band.shift);
      slice.style.setProperty('--delay', band.delay);
      scene.after(slice);
    }

    root.querySelector('.error__button').addEventListener('click', () => {
      root.classList.remove('is-burst');
      void root.offsetWidth;
      root.classList.add('is-burst');
    });
    root.addEventListener('animationend', (event) => {
      if (event.animationName === 'error-flicker') root.classList.remove('is-burst');
    });
    new IntersectionObserver(([entry]) => root.classList.toggle('is-live', entry.isIntersecting)).observe(root);
  }

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

Similar components

Fitted headline sheet

Fitted headline sheet

Scanline lettering

Scanline lettering

Red clock field

Red clock field

Sticker headline hero

Sticker headline hero

Screensaver deck

Screensaver deck

Spread headline

Spread headline

Film reel

Film reel

Ruled hero

Ruled hero