GLITCH LAB v1.0 ezolab.dev / lab instrument SYS: READY ✦ Holiday cards

Effects/ Neon Sign [FX_02]/ Calibrated

Neon Sign

▶ Watch on TikTok ↗ ▶ Watch Shorts ↗ Copies a link to this page with your text and settings — whoever opens it sees the same effect. Send it to a friend, a colleague or save it for later.
CSS + JS Light · zero deps #animation#neon#text

Flickering neon text in CSS: glass tubes that burn, spark and now and then die, like a real broken sign. Copy the code or download MP4, GIF or PNG.

Live viewport Optical bench
LIVE FEED 60.0 FPS | FRAME: 16.7ms RES: — [ + calibrated ]
Type any word: the preview changes at once, and so do the HTML you copy, the .zip and CodePen. Leave it empty to get the default word back.

↓ Download your sign

MP4 video, GIF or PNG for Reels, TikTok, Shorts and CapCut
1080×19205 s
Shape
Loop length

Video: 30 fps, one seamless loop. GIF: smaller, 15 fps. PNG: the sign fully lit.

Or send a live link — it opens this sign with your text and colours

How it works // breakdown

Spec-FX_02

This is a flickering neon text effect in CSS that behaves like a real, slightly broken sign: it lights up at once, the tired tube sparks, then the sign burns steadily — and every few seconds one tired tube stutters or goes out for a moment. The glow is four text shadows, the flicker is steps(1) keyframes, and a 25-line script adds the randomness. Below: how a neon tube is built, why steps() matters, the settings and the gotchas.

Why this effect

I spent a long time getting plain text shadows to flicker like a real neon lamp — not a blinking light, but a tube that catches unevenly, burns, and once in a while gives up for a second. That little failure is what makes it feel alive. The neon in my warehouse app works the same way, and people notice it even if they can't say why. One tired letter on a calm sign beats a whole word blinking at you.

What you'll build

A word made of glowing glass tubes. The colour, the glow strength and the pause between flickers are CSS variables, so the same code gives a calm bar sign or a nervous motel sign.

How the neon flicker works

1. A tube is a hot core plus a halo

Real neon has a nearly white core and coloured light around it. So the letter itself is a pale yellow, and four text-shadow layers do the glow — tight and strong near the letter, wide and warmer far away:

h1 {
  color: #fff8c2;
  text-shadow:
    0 0 4px #ffe600,
    0 0 14px #ffe600,
    0 0 34px #ffd000,
    0 0 80px #ff9e00;
}
Four shadows: 4px and 14px make the tube, 34px and 80px light up the wall

2. A dead tube is still visible

When a neon letter goes out, the glass doesn't vanish — you see a dim, cold shape. That's what makes the flicker believable. The "off" state keeps the letter at about 14% of the tube colour and removes the shadows:

The third letter is off — you still see the glass

3. Neon snaps, it doesn't fade

A normal animation smoothly blends between keyframes, and a flicker made that way looks like a dimmer switch. A gas tube is either lit or not. steps(1) makes every keyframe jump instantly:

i { animation: tube 9s steps(1) var(--d) infinite backwards; }

@keyframes tube {
  0%, 5%, 9%, 15%, 81%, 90%, 100% { /* off */ }
  3%, 8%, 14%, 18%, 82% { /* on */ }
}

Each letter gets its own delay --d, so the word catches unevenly when it switches on, the way a real sign does.

4. One faulty letter

A sign where everything blinks together looks like a cheap GIF. In real life one tube is tired. In the video version, the third letter simply runs its cycle in 3.3 seconds instead of 9 — so it never stays in sync with its neighbours:

i:nth-child(3) { animation-duration: 3.3s; }
The video version: letters catch unevenly, the "O" is faulty

5. Random flickers with a real pause (a little JS)

A CSS loop repeats exactly, and after a minute your eye notices the pattern. Real signs fail at random. The customizable version keeps all the looks in CSS and adds a short script that:

  • splits the word from data-text into letters (so you can type any word);
  • picks one "faulty" letter that gets most of the failures;
  • right after the start, makes the faulty letter spark: on → off → a bright flash → off → on, in about a second — the sign is never dark at the start;
  • every --ns-pause seconds (randomly ±40%) adds a class for a quick stutter or a full die-and-catch, then removes it.

One more touch from real tubes: when a letter catches again, the gas flares up for a moment. A 0.2-second filter: brightness(1.1) swell, started the very moment the letter lights up again, gives exactly that:

@keyframes ns-flare {
  50% { filter: brightness(1.1); }
}
function next() {
  const pause = parseFloat(getComputedStyle(sign).getPropertyValue("--ns-pause")) || 4;
  setTimeout(flicker, pause * 1000 * (0.6 + Math.random() * 0.8));
}

The pause is read from CSS every time, so changing the variable changes the rhythm on the fly. For a regular rhythm without JS, see how to add a pause between CSS animation loops.

Make it yours

Variable Default What it changes
--ns-color #ffe600 Tube colour. The core is mixed from it and white automatically.
--ns-halo #ff9e00 The wide outer glow. A warmer shade than the tube looks most real.
--ns-glow 1 Glow strength: 0.5 is a shop window, 2 is a foggy night.
--ns-pause 4 Seconds between flickers on average. 10–20 for a calm site header.
--ns-size 120px Text size.

To change the word, change both the text and data-text. A | starts a new line: data-text="SEND|MONEY" gives a two-line sign.

Gotchas

  • Use a dark background. Neon glow is light added on top; on white it simply disappears.
  • Leave room for the glow. The 80px shadow spills outside the letters — don't put the sign in a container with overflow: hidden and no padding.
  • Many big shadows cost paint time. One sign is nothing; fifty glowing list items animating at once will make a phone sweat. Keep flickers rare and on small numbers of elements.
  • letter-spacing matters. Tubes are separate pieces of glass; around 0.1em gives them air.

Accessibility

The flicker is rare and short, but it's still motion, so with prefers-reduced-motion the sign simply burns. The script sets aria-label with the whole word and hides the single letters from screen readers, so the word is read once, not spelled.

Variations

  • A sign turning on. Letters catching one by one, each with its own delay — that is the video version (--d on every letter); run it once for a logo entrance.
  • Pulsating glow. No flicker at all — the sign slowly breathes. Animate only the wide shadows, smoothly:
h1 { animation: pulse 3s ease-in-out infinite alternate; }
@keyframes pulse { to { text-shadow: 0 0 4px #ffe600, 0 0 10px #ffe600, 0 0 20px #ffd000, 0 0 40px #ff9e00; } }
  • Subtle flicker. The whole word dips by a fifth for a few frames now and then, instead of dying — calm enough for a site header:
h1 { animation: subtle 6s steps(1) infinite; }
@keyframes subtle { 40%, 43%, 88% { opacity: 0.8; } 41%, 44%, 89% { opacity: 1; } }
Pulsating glow (top) and subtle flicker (bottom)
  • Other colours. Pink-red, cold blue, warm white: change --ns-color and --ns-halo together.
  • Add a chromatic glitch. A tube dying with a short RGB split is a nice combination — see Chromatic Wave.

FAQ

Can I make a neon flicker without JavaScript?

Yes — the video version is pure CSS: text shadows for the glow, steps(1) keyframes for the flicker and a different duration for the faulty letter. The script only adds randomness, a real pause and any word you type.

Why does my neon text look blurry instead of glowing?

The letter colour is too dark. A real tube has a near-white core; keep the text colour pale and let the shadows carry the colour.

Does text-shadow animation hurt performance?

On a single heading — no. Animating shadows on many large elements repaints a lot of pixels each frame, so keep it to a few letters at a time, as this effect does.

Which font looks most like neon?

Real neon is bent glass tubes of the same thickness, so look for fonts with even, rounded strokes and no sharp contrast: a bold rounded sans works, and on Google Fonts, Monoton (outlined tubes) and Neonderthaw (handwritten script) are made for it. Keep letter-spacing around 0.1em so the tubes don't touch.

Can I download the neon sign as a video or GIF?

Yes. Under the live preview, "Download your sign" makes an MP4 (30 fps, one seamless 5 or 10 s loop), a GIF or a PNG in 9:16, 1:1 or 16:9 — with your text, colours and glow, ready for Reels, TikTok, Shorts or CapCut. It is drawn in your browser; nothing is uploaded. "Copy live link" gives a link that opens the same sign.

Can I copy and paste the neon text?

Yes. Type your word in "Your text", pick the colour, glow and pause with the sliders, then copy the HTML, CSS and JS with the buttons at the top of the page or download them as a .zip.

Get the code — copy or download
Copy HTML: the markup with your text — paste it where the effect should be. Copy CSS: the styles with your slider settings — paste into your stylesheet. Any text element works: give it the class and a data-text equal to its text.
or
↓ Download .zip Both files in one archive — index.html and style.css — with your text and settings. Unzip and open index.html in a browser.
/* Broken Neon Sign — flickering neon text.
   Works on any text element (h1, a, span, button...):
   give it class="ns-sign" and data-text with the same text.
   A | in the text starts a new line: data-text="SEND|MONEY".
   The small script splits the word into letters ("tubes")
   and makes one of them flicker now and then.
   Settings: change the variables below. */
.ns-sign {
  --ns-color: #ffe600;  /* tube colour */
  --ns-halo: #ff9e00;   /* outer, warmer glow */
  --ns-glow: 1;         /* glow strength, 0.5 – 2 */
  --ns-pause: 4;        /* seconds between flickers (on average) */
  --ns-size: 120px;

  margin: 0;
  font: 700 var(--ns-size)/1.15 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-align: center;
  white-space: nowrap;
}

/* Every letter is a glass tube: a pale hot core + glow.
   Lit from the very first frame: no dark start. */
.ns-sign i {
  --ns-lit: color-mix(in srgb, var(--ns-color) 25%, #fff);
  --ns-shadow:
    0 0 calc(4px * var(--ns-glow)) var(--ns-color),
    0 0 calc(14px * var(--ns-glow)) var(--ns-color),
    0 0 calc(34px * var(--ns-glow)) var(--ns-color),
    0 0 calc(80px * var(--ns-glow)) var(--ns-halo);
  --ns-dead: color-mix(in srgb, var(--ns-color) 14%, transparent);
  font-style: normal;
  color: var(--ns-lit);
  text-shadow: var(--ns-shadow);
}

/* Added by the script for a moment: a spark right after the start,
   a short stutter or a full die-and-catch. ns-flare: when a letter catches
   again, the gas swells 10% brighter for 0.2 s */
.ns-sign i.ns-spark { animation: ns-spark 1.1s steps(1) 0.25s, ns-flare 0.2s ease-in-out 0.82s; }  /* lit again at 52% */
.ns-sign i.ns-blink { animation: ns-blink 0.5s steps(1), ns-flare 0.2s ease-in-out 0.3s; }   /* lit again at 60% */
.ns-sign i.ns-die { animation: ns-die 1.4s steps(1), ns-flare 0.2s ease-in-out 1.19s; }     /* lit again at 85% */

/* on → off → bright flash → off → on: the tired tube sparks as the sign starts */
@keyframes ns-spark {
  0%, 52%, 100% { color: var(--ns-lit); text-shadow: var(--ns-shadow); filter: none; }
  14%, 34% { color: var(--ns-dead); text-shadow: none; filter: none; }
  26% { color: var(--ns-lit); text-shadow: var(--ns-shadow); filter: brightness(1.4); }
}
@keyframes ns-blink {
  0%, 40% { color: var(--ns-dead); text-shadow: none; }
  20%, 60%, 100% { color: var(--ns-lit); text-shadow: var(--ns-shadow); }
}
/* Caught again: a short, smooth swell of brightness, then back to normal */
@keyframes ns-flare {
  50% { filter: brightness(1.1); }
}
@keyframes ns-die {
  0%, 12%, 30%, 75% { color: var(--ns-dead); text-shadow: none; }
  8%, 22%, 68%, 85%, 100% { color: var(--ns-lit); text-shadow: var(--ns-shadow); }
}

/* Less motion: the sign simply burns. */
@media (prefers-reduced-motion: reduce) {
  .ns-sign i { animation: none !important; }
}