/*Add "glitch" class and data-text to your html element
Ex:
<h1 class="glitch" data-text="Hover over this!">Hover over this!</h1> */

.glitch {
  position: relative;
  color: yellow;
  mix-blend-mode: lighten;
}
.glitch:before,
.glitch:after {
  pointer-events: none;
  content: attr(data-text);
  position: absolute;
  top: 0;
  width: 100%;
  background: black;
  clip: rect(0, 0, 0, 0);
}
.glitch:before {
  left: -4px;
  text-shadow: 6px 0 #ff00ff;
}
/*.glitch:hover:before {*/
/*  text-shadow: 4px 0 #ff00ff;*/
/*  animation: glitch-anim-1 0.4s infinite ease-in-out alternate-reverse;*/
/*}*/
.glitch:before {
  text-shadow: 4px 0 #ff00ff;
  animation: glitch-anim-1 0.4s infinite ease-in-out alternate-reverse;
}

.glitch:after {
  left: 4px;
  text-shadow: -3px 0 #00ffc8;
}
/*.glitch:hover:after {*/
/*  text-shadow: -5px 0 #00ffc8;*/
/*  animation: glitch-anim-2 0.3s infinite ease-in-out alternate-reverse;*/
/*}*/
.glitch:after {
  text-shadow: -5px 0 #00ffc8;
  animation: glitch-anim-2 0.3s infinite ease-in-out alternate-reverse;
}
@keyframes glitch-anim-1 {
  0% {clip: rect(30px, 9999px, 10px, 0);}
  25% {clip: rect(15px, 9999px, 100px, 0);}
  50% {clip: rect(50px, 9999px, 105px, 0);}
  75% {clip: rect(2px, 9999px, 80px, 0);}
  100% {clip: rect(90px, 9999px, 100px, 0);}
}
@keyframes glitch-anim-2 {
  0% {
    top: -1px;
    left: 50px;
    clip: rect(65px, 9999px, 119px, 0);
  }
  25% {
    top: -10px;
    left: 1px;
    clip: rect(79px, 9999px, 19px, 0);
  }
  50% {
    top: -7px;
    left: 20px;
    clip: rect(65px, 9999px, 11px, 0);
  }
  75% {
    top: 10px;
    right: 20px;
    left: -50px;
    clip: rect(95px, 9999px, 53px, 0);
  }
  100% {
    top: -5px;
    left: -7px;
    clip: rect(31px, 9999px, 149px, 0);
  }
}
.glitch.delay {
  animation-delay: -.15s;
}


/* BG IMAGE GLITCH */
/*____________________________________________________________
# Image
____________________________________________________________*/
.bg-glitch {
    pointer-events: none;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: 30px;
    background: #a102b3;
    mix-blend-mode: color-dodge;
 }
.bg-glitch::before,
.bg-glitch::after {
   content: "";
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   width: 100%;
   height: 100%;
   clip-path: polygon(0% 38%,100% 38%,100% 34%,0% 34% );
   overflow: hidden;
   background-size: cover;
   background-repeat: no-repeat;
   background-position: center;
 }
.bg-glitch::before {
   left: -12px;
   animation: glitch-effect 2s infinite linear alternate-reverse;
   background: #23df65;
 }
.bg-glitch::after {
   left: 12px;
   animation: glitch-effect 2s infinite linear alternate-reverse;
   background: #d3164f;
    animation-delay: .02s;
 }
@keyframes glitch-effect {
  0% {
    clip-path: polygon(0% 38%, 100% 38%, 100% 34%, 0% 34% );
  }

  11% {
    clip-path: polygon(0% 38%, 100% 38%, 100% 27%, 0% 27%);
  }
  17% {
    clip-path: polygon(0% 50%, 100% 50%, 100% 50%, 0% 50%);
  }
  23% {
    clip-path: polygon(0% 29%, 100% 29%, 100% 3%, 0% 3%);
  }
  29% {
    clip-path: polygon(0% 9%, 100% 9%, 100% 25%, 0% 25%);
  }
  35% {
    clip-path: polygon(0% 19%, 100% 19%, 100% 26%, 0% 26%);
  }
  41% {
    clip-path: polygon(0% 3%, 100% 3%, 100% 39%, 0% 39%);
  }
  47% {
    clip-path: polygon(0% 16%, 100% 16%, 100% 16%, 0% 16%);
  }
  53% {
    clip-path: polygon(0% 15%, 100% 15%, 100% 38%, 0% 38%);
  }
  59% {
    clip-path: polygon(0% 34%, 100% 34%,100% 32%, 0% 32%);
  }
  65% {
    clip-path: polygon(0% 17%, 100% 17%, 100% 42%, 0% 42%);
  }
  70% {
    clip-path: polygon(0% 29%, 100% 29%,100% 49%, 0% 49%);
  }
  76% {
    clip-path: polygon(0% 10%, 100% 10%,100% 31%, 0% 31%);
  }
  82% {
    clip-path: polygon(0% 12%, 100% 12%,100% 1%, 0% 1%);
  }
  88% {
    clip-path: polygon(0% 28%, 100% 28%, 100% 37%, 0% 37%);
  }
  94% {
    clip-path: polygon(0% 13%, 100% 13%, 100% 17%, 0% 17%);
  }
  100% {
    clip-path: polygon(0% 39%, 100% 39%, 100% 1%, 0% 1%);
  }

}