Sits perfectly still, then breaks up for a split second: the word jolts and skews while colored slices fly off, and it snaps back clean. The long rest is what makes the burst land.
Also known as: intermittent glitch text, random glitch effect css, glitch every few seconds.
<div class="txt-glitch-burst" data-text="ERROR">ERROR</div>
.txt-glitch-burst {
--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;
color: var(--c);
letter-spacing: 0.06em;
animation: txt-glitch-burst-jolt 3s steps(1, end) infinite;}
.txt-glitch-burst::before,
.txt-glitch-burst::after {
content: attr(data-text);
position: absolute;
inset: 0;
opacity: 0;
animation: 3s steps(1, end) infinite;
}
.txt-glitch-burst::before {
color: #ff2d78;
animation-name: txt-glitch-burst-a;
}
.txt-glitch-burst::after {
color: #00c2ff;
animation-name: txt-glitch-burst-b;
}
@keyframes txt-glitch-burst-jolt {
0%, 62%, 72%, 78%, 100% { transform: none; }
64% { transform: translateX(-0.04em) skewX(-14deg); }
66% { transform: translateX(0.05em) skewX(10deg) scaleY(1.08); }
68% { transform: translate(-0.02em, 0.02em); }
70% { transform: skewX(20deg); }
76% { transform: translateX(0.03em) skewX(-6deg); }
}
@keyframes txt-glitch-burst-a {
0%, 62%, 72%, 78%, 100% { opacity: 0; clip-path: inset(0); transform: none; }
64% { opacity: 1; clip-path: inset(10% 0 60% 0); transform: translateX(-0.12em); }
66% { opacity: 1; clip-path: inset(55% 0 20% 0); transform: translateX(0.1em); }
68% { opacity: 1; clip-path: inset(30% 0 45% 0); transform: translateX(-0.2em); }
70% { opacity: 1; clip-path: inset(75% 0 5% 0); transform: translateX(0.08em); }
76% { opacity: 1; clip-path: inset(40% 0 40% 0); transform: translateX(-0.1em); }
}
@keyframes txt-glitch-burst-b {
0%, 62%, 72%, 78%, 100% { opacity: 0; clip-path: inset(0); transform: none; }
64% { opacity: 1; clip-path: inset(65% 0 10% 0); transform: translateX(0.14em); }
66% { opacity: 1; clip-path: inset(5% 0 70% 0); transform: translateX(-0.08em); }
68% { opacity: 1; clip-path: inset(45% 0 35% 0); transform: translateX(0.16em); }
70% { opacity: 1; clip-path: inset(20% 0 55% 0); transform: translateX(-0.12em); }
76% { opacity: 1; clip-path: inset(70% 0 12% 0); transform: translateX(0.07em); }
}
@media (prefers-reduced-motion: reduce) {
.txt-glitch-burst, .txt-glitch-burst *, .txt-glitch-burst::before, .txt-glitch-burst::after, .txt-glitch-burst *::before, .txt-glitch-burst *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--txt-color on the element or a parent.
Currently previewing #3b82f6.--txt-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 40px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.