Glitch
Glitch & Distortion · Animated · pure CSS
The classic RGB-split glitch: cyan/magenta pseudo-element copies tear and shift on clip-path keyframes. Cyberpunk in a single class (needs a data-text attribute).
CSS
/* Glitch — generated with TEXT-FX
* HTML: the element needs a data-text attribute equal to its text.
* Font: 'Major Mono Display', monospace (load from Google Fonts).
*/
.text-effect {
font-family: 'Major Mono Display', monospace;
font-weight: 400;
letter-spacing: 2px;
text-transform: none;
}
.text-effect {
position: relative;
color: #f2f2f2;
}
.text-effect::before,
.text-effect::after {
content: attr(data-text);
position: absolute;
left: 0;
top: 0;
width: 100%;
}
.text-effect::before {
color: #00eaff;
transform: translate(-4px, 0);
mix-blend-mode: screen;
animation: text-effect-g1 2.4s infinite linear alternate-reverse;
}
.text-effect::after {
color: #ff003c;
transform: translate(4px, 0);
mix-blend-mode: screen;
animation: text-effect-g2 3.1s infinite linear alternate-reverse;
}
@keyframes text-effect-g1 {
0% { clip-path: inset(0 0 82% 0); }
25% { clip-path: inset(40% 0 30% 0); }
50% { clip-path: inset(70% 0 10% 0); }
75% { clip-path: inset(15% 0 55% 0); }
100% { clip-path: inset(85% 0 2% 0); }
}
@keyframes text-effect-g2 {
0% { clip-path: inset(60% 0 20% 0); }
25% { clip-path: inset(10% 0 70% 0); }
50% { clip-path: inset(35% 0 40% 0); }
75% { clip-path: inset(80% 0 5% 0); }
100% { clip-path: inset(20% 0 60% 0); }
}
HTML
This effect needs the markup below (per-letter spans, SVG defs, or a data-text attribute).
<style>
.text-effect {
font-family: 'Major Mono Display', monospace;
font-weight: 400;
letter-spacing: 2px;
text-transform: none;
}
.text-effect {
position: relative;
color: #f2f2f2;
}
.text-effect::before,
.text-effect::after {
content: attr(data-text);
position: absolute;
left: 0;
top: 0;
width: 100%;
}
.text-effect::before {
color: #00eaff;
transform: translate(-4px, 0);
mix-blend-mode: screen;
animation: text-effect-g1 2.4s infinite linear alternate-reverse;
}
.text-effect::after {
color: #ff003c;
transform: translate(4px, 0);
mix-blend-mode: screen;
animation: text-effect-g2 3.1s infinite linear alternate-reverse;
}
@keyframes text-effect-g1 {
0% { clip-path: inset(0 0 82% 0); }
25% { clip-path: inset(40% 0 30% 0); }
50% { clip-path: inset(70% 0 10% 0); }
75% { clip-path: inset(15% 0 55% 0); }
100% { clip-path: inset(85% 0 2% 0); }
}
@keyframes text-effect-g2 {
0% { clip-path: inset(60% 0 20% 0); }
25% { clip-path: inset(10% 0 70% 0); }
50% { clip-path: inset(35% 0 40% 0); }
75% { clip-path: inset(80% 0 5% 0); }
100% { clip-path: inset(20% 0 60% 0); }
}
</style>
<div data-text="Your text" class="text-effect">Your text</div>
- Category
- Glitch & Distortion
- Type
- Animated
- Browser support
- pseudo-element copies + clip-path animation
- Capabilities
- dataText