-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwhite-lines-running-on-the-highway.html
More file actions
114 lines (97 loc) · 2.14 KB
/
white-lines-running-on-the-highway.html
File metadata and controls
114 lines (97 loc) · 2.14 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>White lines running on the highway</title>
</head>
<body>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: radial-gradient(#9bdfff, #009be4);
}
body .line {
width: 800px;
height: 160px;
background: #525252;
position: relative;
transform: perspective(500px) rotateX(30deg);
transform-origin: bottom;
transform-style: preserve-3d;
}
body .line::before {
content: '';
position: absolute;
width: 100%;
height: 10px;
background: linear-gradient(to right, #fff 0%, #fff 70%, #525252 70%, #525252 100%);
background-size: 120px;
left: 0;
top: 50%;
transform: translateY(-5px);
animation: animate 0.5s linear infinite;
}
@-moz-keyframes animate {
0% {
background-position: 0px;
}
100% {
background-position: -120px;
}
}
@-webkit-keyframes animate {
0% {
background-position: 0px;
}
100% {
background-position: -120px;
}
}
@-o-keyframes animate {
0% {
background-position: 0px;
}
100% {
background-position: -120px;
}
}
@keyframes animate {
0% {
background-position: 0px;
}
100% {
background-position: -120px;
}
}
body .line::after {
content: '';
position: absolute;
width: 100%;
height: 30px;
background-color: #333;
bottom: -30px;
transform: perspective(500px) rotateX(-25deg);
transform-origin: top;
}
body .line .shadow {
position: absolute;
width: 95%;
height: 60px;
background: linear-gradient(#000, transparent);
bottom: -93px;
left: 400px;
transform: translateX(-50%);
opacity: 0.5;
}
</style>
<div class="line">
<div class="shadow"></div>
</div>
</body>
</html>