For your presentations or your logo, whether on hover or permanently, add a modern glitch/bug effect! Let’s discover together how to set it up.
Step 1
Let's start with the HTML code.
<i class="fab fa-instagram fa-4x"></i>And in the head tag:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" />We will use Font Awesome to display an icon without the hassle of searching for an image.
Step 2
Let's style the icon and the hover effect.
.fab {
color: white;
}
.fab:hover {
animation: icon-glitch 1s infinite;
}On hover, we call an “icon-glitch” animation. Just call it to apply this effect to all elements.
Step 3
Let's create the icon-glitch animation to complete the project.
@keyframes icon-glitch {
0% {
text-shadow: 5px 4px rgb(244, 67, 54), -5px -6px rgb(33, 150, 243);
}
25% {
text-shadow: -5px -6px rgb(244, 67, 54), 5px 4px rgb(33, 150, 243);
}
50% {
text-shadow: 5px 4px rgb(244, 67, 54), -8px 4px rgb(33, 150, 243);
}
75% {
text-shadow: -8px -4px rgb(244, 67, 54), -5px -4px rgb(33, 150, 243);
}
100% {
text-shadow: -5px 0 rgb(244, 67, 54), 5px -4px rgb(33, 150, 243);
}
}






