-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunning_text.css
62 lines (53 loc) · 1.22 KB
/
running_text.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
56
57
58
59
60
61
62
/* Move Element */
.move-container {
position: relative;
height: 120px;
background-color: black;
z-index: 0;
}
.move-element {
background-color: red;
width: 75px;
height: 75px;
position: absolute;
opacity: 0;
pointer-events: none;
top: 0;
left: 0;
z-index: 1;
transform: translate(-50%, -50%);
transition: opacity 1s;
}
/* Text Scroll */
.text-scroll-wrapper {
position: absolute;
display: flex;
top: 50%;
gap: 15px;
pointer-events: none;
white-space: nowrap;
animation: scroll-anim 5s infinite linear;
}
.text-scroll {
width: max-content;
font-size: 50px;
pointer-events: none;
margin: auto;
}
:root {
--offset: 20vw;
--move-initial: calc(-25% + var(--offset));
--move-final: calc(-50% + var(--offset));
}
@keyframes scroll-anim {
from {
-moz-transform: translate(var(--move-initial), -50%);
-webkit-transform: translate(var(--move-initial), -50%);
transform: translate(var(--move-initial), -50%);
}
to {
-moz-transform: translate(var(--move-final), -50%);
-webkit-transform: translate(var(--move-final), -50%);
transform: translate(var(--move-final), -50%);
}
}