Repository navigation
Expand file tree
/
Copy pathanimation5.html
More file actions
86 lines (86 loc) · 2 KB
/
Copy pathanimation5.html
File metadata and controls
86 lines (86 loc) · 2 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
*{
margin: 0;
padding: 0;
}
body{
background-image: url('car_crash_background.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 60vh;
}
.car1{
position: absolute;
left: 10px;
top: 460px;
animation-name: car1;
animation-duration: 3s;
animation-fill-mode: forwards;
}
@keyframes car1{
from{
left: 10px;
top: 460px;
}
to{
left: 525px;
top: 460px;
}
}
.car2{
position: absolute;
right: 10px;
top: 460px;
animation-name: car2;
animation-duration: 3s;
animation-fill-mode: forwards;
}
@keyframes car2{
from{
right: 10px;
top: 460px;
}
to{
right: 520px;
top: 460px;
}
}
.crash{
transform: scale(0);
position: absolute;
left: 590px;
top: 440px;
animation-name: crash;
animation-duration: 2s;
animation-delay: 3s;
animation-fill-mode: forwards;
}
@keyframes crash {
from{
transform: scale(0);
}
to{
transform: scale(1);
}
}
</style>
<body>
<div class="car1">
<img height="200px" width="200px" src="https://www.pngall.com/wp-content/uploads/19/Small-Car-Zooming-Past-Historic-Building-PNG-300x225.png" alt="">
</div>
<div class="car2">
<img src="https://www.pngall.com/wp-content/uploads/14/Trucking-PNG-Image-300x225.png" alt="">
</div>
<div class="crash">
<img src="https://static-00.iconduck.com/assets.00/collision-symbol-emoji-256x256-ald51f9v.png" alt="">
</div>
</body>
</html>