-
Notifications
You must be signed in to change notification settings - Fork 27
/
glitcheffect.css
55 lines (52 loc) · 1.02 KB
/
glitcheffect.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@import "compass/css3";
body{
background:black;
font-family: 'Varela', sans-serif;
}
.glitch{
color:white;
font-size:100px;
position:relative;
width:400px;
margin:0 auto;
}
@keyframes noise-anim{
$steps:20;
@for $i from 0 through $steps{
#{percentage($i*(1/$steps))}{
clip:rect(random(100)+px,9999px,random(100)+px,0);
}
}
}
.glitch:after{
content:attr(data-text);
position:absolute;
left:2px;
text-shadow:-1px 0 red;
top:0;
color:white;
background:black;
overflow:hidden;
clip:rect(0,900px,0,0);
animation:noise-anim 2s infinite linear alternate-reverse;
}
@keyframes noise-anim-2{
$steps:20;
@for $i from 0 through $steps{
#{percentage($i*(1/$steps))}{
clip:rect(random(100)+px,9999px,random(100)+px,0);
}
}
}
.glitch:before{
content:attr(data-text);
position:absolute;
left:-2px;
text-shadow:1px 0 blue;
top:0;
color:white;
background:black;
overflow:hidden;
clip:rect(0,900px,0,0);
animation:noise-anim-2 3s infinite linear alternate-reverse;
}