👾 Glitch Text
Meet GlitchText—a dynamic, animated text effect that brings chaotic, digital distortion to your UI. Perfect for cyberpunk themes, futuristic designs, gaming websites, and high-tech branding, this Framer Motion-powered React component adds a real-time glitch effect that makes your text look broken, hacked, or straight out of a sci-fi universe. ⚡👾
Preview
Stackbits is Awesome
Follow below steps 👇🏻
Styling
Add these styles in your .css file
1.glitch {2position: relative;3display: inline-block;4animation: glitch 0.7s infinite;5}67@keyframes glitch {80% {9text-shadow: 3px 3px 0 #ff0d00, -3px -3px 0 #00ffff;10}1125% {12text-shadow: -3px -3px 0 #ff00ff, 3px 3px 0 #00ffff;13}1450% {15text-shadow: 3px -3px 0 #0400ff, -3px 3px 0 #00ffff;16}1775% {18text-shadow: -3px 3px 0 #00ff00, 3px -3px 0 #00ffff;19}20100% {21text-shadow: 3px 3px 0 #ff0d00, -3px -3px 0 #00ffff;22}23}
Component
Create a file custom-scrollbar.tsx in your components folder and paste this code
1import React from 'react';2import { motion } from 'framer-motion';34const GlitchText = ({ children, className }: { children: React.ReactNode; className?: string }) => {5return (6<motion.span7animate={{8scale: [1, 1, 1.3, 1, 1, 1, 1],9x: [0, 0, 0, 2, 0, 2, 2],10y: [2, -2, -2, 0, 0, 2, 0],11filter: [12'blur(0px)',13'blur(2px)',14'blur(4px)',15'blur(0px)',16'blur(0px)',17'blur(0px)',18'blur(0px)'19],20transition: {21repeat: Infinity,22duration: 0.3,23repeatDelay: 124}25}}26className={`glitch ${className}`}27>28{children}29</motion.span>30);31};3233export default GlitchText;
Usage
1<p className="text-4xl">2Stackbits is <GlitchText className="font-semibold">Awesome</GlitchText>3</p>
⭐️ Got a question or feedback?
Feel free to reach out!