-
Notifications
You must be signed in to change notification settings - Fork 0
/
roadAnimation.css
58 lines (58 loc) · 1.22 KB
/
roadAnimation.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
body{
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: radial-gradient(#9bdfff,#627781);
}
.infinite{
position: relative;
width: 800px;
height: 180px;
background: #525252;
transform-origin:bottom;
transform-style: preserve-3d;
transform: perspective(500px) rotateX(30deg);
}
.infinite::before{
content: '';
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
width: 100%;
height: 10px;
background:linear-gradient(90deg,#fff 0%,#fff 70%,#525252 70%,#525252 100%) ;
background-size: 120px;
animation: animate 0.5s linear infinite;
}
@keyframes animate{
0%{
background-position: 0px;
}
100%{
background-position: -120px;
}
}
.infinite::after{
content: '';
position: absolute;
width: 100%;
height: 30px;
background:#333;
bottom: -30px;
transform-origin: top;
transform: perspective(500px) rotateX(-25deg);
}
.shadow{
position:absolute;
bottom: -93px;
left: 50%;
width: 95%;
transform: translateX(-50%);
height: 60px;
background: linear-gradient(#000,transparent);
opacity: 0.5;
}