AI CSS Animations

CRT Screen Text Effect

Glowing text on a small curved CRT screen with scanlines, a vignette, a faint flicker and a bright roll bar drifting down. The layers are pseudo-elements; only transform and opacity move.

Also known as: crt monitor text css, retro computer screen text, scanline text effect.

SYSTEM READY

HTML

<div class="txt-crt-screen-text">SYSTEM READY</div>

CSS

.txt-crt-screen-text {
  --c: var(--txt-color, #3b82f6);
  font-size: var(--txt-size, 32px);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding: 0.6em 0.95em;
  border-radius: 0.5em / 0.7em;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--c) 16%, #10131a), #06070a 78%);
  box-shadow: inset 0 0 0.7em rgb(0 0 0 / 0.85), 0 0 0 0.14em #22252c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--c) 55%, #fff);
  text-shadow: 0 0 0.06em var(--c), 0 0 0.3em var(--c);
  animation: txt-crt-screen-text-flicker 3s steps(1, end) infinite;}
.txt-crt-screen-text::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgb(0 0 0 / 0.4) 0 0.05em, transparent 0.05em 0.1em);
}
.txt-crt-screen-text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c) 22%, transparent), transparent);
  transform: translateY(-100%);
  animation: txt-crt-screen-text-roll 4s linear infinite;
}
@keyframes txt-crt-screen-text-roll {
  to { transform: translateY(250%); }
}
@keyframes txt-crt-screen-text-flicker {
  0%, 33%, 72%, 100% { opacity: 1; }
  31% { opacity: 0.88; }
  70% { opacity: 0.94; }
}

@media (prefers-reduced-motion: reduce) {
  .txt-crt-screen-text, .txt-crt-screen-text *, .txt-crt-screen-text::before, .txt-crt-screen-text::after, .txt-crt-screen-text *::before, .txt-crt-screen-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