AI CSS Animations

Amber Monitor Text

An amber phosphor screen types a command, each fresh letter flaring white-hot then cooling to amber, and the screen fades out slowly with afterglow before the next run. Curved glass and scanlines.

Also known as: amber monitor css, crt effect css, retro terminal text, terminal typing animation.

HTML

<div class="txt-amber-monitor-text" aria-label="A&gt; RUN LEDGER. Ready.">
  <div class="txt-amber-monitor-text-screen" aria-hidden="true">
    <p>A&gt; <span class="txt-amber-monitor-text-cmd"><span style="--i: 0">R</span><span style="--i: 1">U</span><span style="--i: 2">N</span><span style="--i: 3">&nbsp;</span><span style="--i: 4">L</span><span style="--i: 5">E</span><span style="--i: 6">D</span><span style="--i: 7">G</span><span style="--i: 8">E</span><span style="--i: 9">R</span></span></p>
    <p class="txt-amber-monitor-text-ready">READY.<span class="txt-amber-monitor-text-cursor"></span></p>
  </div>
</div>

CSS

.txt-amber-monitor-text {
  --c: var(--txt-color, #3b82f6);
  font-size: calc(var(--txt-size, 32px) * 0.62);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  --ph: color-mix(in srgb, var(--c) 10%, #ffb000);
  --t: 6.4s;
  display: inline-block;
  padding: 0.45em;
  border-radius: 1em;
  background: linear-gradient(#d9d3c4, #b9b2a2);
  box-shadow: inset 0 -0.15em 0 rgb(0 0 0 / 0.15), 0 0.5em 1.2em -0.6em rgb(0 0 0 / 0.5);}
.txt-amber-monitor-text-screen {
  position: relative;
  width: 12.5em;
  padding: 0.8em 1em;
  border-radius: 0.9em / 1.2em;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--ph);
  background: radial-gradient(120% 110% at 50% 45%, #1e1206, #070402 75%);
  box-shadow: inset 0 0 1.4em rgb(0 0 0 / 0.9);
  text-shadow: 0 0 0.3em color-mix(in srgb, var(--ph) 75%, transparent);
  animation: txt-amber-monitor-text-flicker 0.1s steps(2) infinite;
}
.txt-amber-monitor-text-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 45% at 30% 0%, rgb(255 230 180 / 0.07), transparent 70%),
    repeating-linear-gradient(rgb(0 0 0 / 0.3) 0 1px, transparent 1px 0.16em);
  pointer-events: none;
}
.txt-amber-monitor-text-screen p {
  margin: 0;
  white-space: nowrap;
  animation: txt-amber-monitor-text-decay var(--t) infinite;
}
/* typing: the command is clipped open one character at a time */
.txt-amber-monitor-text-cmd {
  display: inline-block;
  vertical-align: bottom;
  overflow: hidden;
  width: 0;
  animation: txt-amber-monitor-text-type var(--t) infinite;
}
/* each letter lands white-hot and cools to amber */
.txt-amber-monitor-text-cmd span {
  animation: txt-amber-monitor-text-hit var(--t) calc(0.5s + var(--i) * 0.11s) infinite;
}
.txt-amber-monitor-text-screen .txt-amber-monitor-text-ready {
  visibility: hidden;
  animation: txt-amber-monitor-text-ready var(--t) step-end infinite, txt-amber-monitor-text-decay var(--t) infinite;
}
.txt-amber-monitor-text-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  margin-left: 0.15em;
  vertical-align: -0.15em;
  background: currentColor;
  box-shadow: 0 0 0.35em currentColor;
  animation: txt-amber-monitor-text-blink 0.9s steps(1) infinite;
}
@keyframes txt-amber-monitor-text-type {
  0%, 7.81% { width: 0; animation-timing-function: steps(10, end); }
  25%, 100% { width: calc(10ch + 0.4em); }
}
@keyframes txt-amber-monitor-text-hit {
  0% { color: #fff7e0; text-shadow: 0 0 0.5em #ffd27a, 0 0 1em var(--ph); }
  6%, 100% { color: var(--ph); text-shadow: 0 0 0.3em color-mix(in srgb, var(--ph) 75%, transparent); }
}
@keyframes txt-amber-monitor-text-ready {
  0% { visibility: hidden; }
  32.81% { visibility: visible; }
}
@keyframes txt-amber-monitor-text-decay {
  0%, 82% { opacity: 1; filter: none; }
  96% { opacity: 0; filter: blur(0.08em); }
  100% { opacity: 0; }
}
@keyframes txt-amber-monitor-text-blink {
  50% { opacity: 0; }
}
@keyframes txt-amber-monitor-text-flicker {
  50% { opacity: 0.96; }
}
@media (prefers-reduced-motion: reduce) {
  .txt-amber-monitor-text, .txt-amber-monitor-text *, .txt-amber-monitor-text *::before, .txt-amber-monitor-text *::after { animation: none !important; }
  .txt-amber-monitor-text-cmd { width: auto; }
  .txt-amber-monitor-text-screen .txt-amber-monitor-text-ready { visibility: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .txt-amber-monitor-text, .txt-amber-monitor-text *, .txt-amber-monitor-text::before, .txt-amber-monitor-text::after, .txt-amber-monitor-text *::before, .txt-amber-monitor-text *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --txt-color on the element or a parent. Currently previewing #3b82f6.
  • Font size: set --txt-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 40px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar text animations