Skip to content

Instantly share code, notes, and snippets.

@aresnick
Created June 25, 2019 23:57
Show Gist options
  • Save aresnick/03c3c3ad54f736ec6a16e7e7f3221299 to your computer and use it in GitHub Desktop.
Save aresnick/03c3c3ad54f736ec6a16e7e7f3221299 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
#glitch-text {
position: absolute;
clip: rect(21px, 9999px, 64px, 0);
}
@-webkit-keyframes noise-anim {
0% {
clip: rect(21px, 9999px, 64px, 0);
}
100% {
clip: rect(4px, 9999px, 80px, 0);
}
}
@-webkit-keyframes noise-anim-2 {
0% {
clip: rect(41px, 9999px, 79px, 0);
}
100% {
clip: rect(18px, 9999px, 47px, 0);
}
}
#glitch-text {
position: absolute;
-webkit-animation: noise-anim 0.5s infinite alternate-reverse;
}
/* #glitch-text:after {
content: attr(data-text);
position: absolute;
left: 2px;
text-shadow: -1px 0 red;
top: 1rem;
-webkit-animation: noise-anim 0.5s infinite alternate-reverse;
}
#glitch-text:before {
content: attr(data-text);
position: absolute;
left: -2px;
text-shadow: 1px 0 blue;
top: 1rem;
-webkit-animation: noise-anim-2 0.5s infinite alternate-reverse;
}
*/ </style>
</head>
<body>
<div id='glitch-text' data-text='moo'>cow</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment