-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
137 lines (124 loc) · 3.75 KB
/
index.html
File metadata and controls
137 lines (124 loc) · 3.75 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CAR RACING</title>
<link rel="stylesheet" href="style.css">
<style>
*{
margin:0;
padding:0;
}
.hero{
height:100vh ;
width:100%;
background-image: url(sky.jpg);
background-size:cover ;
background-position: center;
position: relative;
overflow-x: hidden;
}
.highway{
height: 200px;
width: 500%;
display: block;
background-image: url(road.jpg);
position: absolute;
bottom:0;
left: 0;
right: 0;
z-index: 1;
background-repeat:repeat-x ;
animation:highway 5s linear infinite;
}
@keyframes highway{
100%{
transform: translate(-3400px);
}
}
.city{
height: 450px;
width:500%;
background-image: url(city.png);
position: absolute;
bottom:0;
left: 0;
right: 0;
display: block;
z-index: 1;
background-repeat: repeat-x;
animation: city 20s linear infinite;
}
@keyframes city{
100%{
transform: translate(-1400px);
}
}
.car{
width: 400px;
left: 50%;
bottom: 100px;
transform: translate(-50%);
position: absolute;
z-index: 2;
}
.car img
{
width:100% ;
animation: car 0.4s linear infinite;
}
@keyframes car {
100%{
transform: translateY(-1px);
}
50%{
transform: translateY(-1px);
}
0%{
transform: translateY(-1px);
}
}
.wheel{
left: 50%;
bottom: 178px;
transform:translate(-50%) ;
position: absolute;
z-index: 2;
}
.wheel img{
width: 72px;
height: 72px;
animation: wheel 1s linear infinite;
}
.back-wheel{
left: -165px;
position: absolute;
}
.front-wheel{
left: 80px;
position: absolute;
}
@keyframes wheel{
100%{
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="hero">
<div class="highway">
<div class="city"></div>
</div>
<div class="car">
<img src="car.png">
</div>
<div class="wheel">
<img src="wheel.png" class="back-wheel">
<img src="wheel.png" class="front-wheel">
</div>
</div>
</body>
</html>