-
Notifications
You must be signed in to change notification settings - Fork 0
/
glitch.css
55 lines (51 loc) · 1.17 KB
/
glitch.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
.stack {
display: grid;
grid-template-columns: 1fr;
}
.stack span {
font-weight: bold;
grid-row-start: 1;
grid-column-start: 1;
font-size: 4rem;
--stack-height: calc(100% / var(--stacks) - 1px);
--inverse-index: calc(calc(var(--stacks) - 1) - var(--index));
--clip-top: calc(var(--stack-height) * var(--index));
--clip-bottom: calc(var(--stack-height) * var(--inverse-index));
clip-path: inset(var(--clip-top) 0 var(--clip-bottom) 0);
animation:
stack 340ms cubic-bezier(0.46, 0.29, 0, 1.24) 1 backwards
calc(var(--index) * 120ms),
glitch 2s ease infinite 2s alternate-reverse;
}
.stack span:nth-child(odd) {
--glitch-translate: 8px;
}
.stack span:nth-child(even) {
--glitch-translate: -8px;
}
@keyframes stack {
0% {
opacity: 0;
transform: translateX(-50%);
}
60% {
opacity: 0.5;
transform: translateX(50%);
}
80% {
transform: none;
opacity: 1;
}
100% {
text-shadow: none;
}
}
@keyframes glitch {
0% {
transform: translate(var(--glitch-translate));
}
4%,
100% {
transform: none;
}
}