-
Notifications
You must be signed in to change notification settings - Fork 0
/
2d_animation.html
126 lines (111 loc) · 1.79 KB
/
2d_animation.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>2d</title>
<meta name="viewport" content="width=device-width ,initial-scale=1.0">
<style type="text/css">
*{
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center;
}
ul{
list-style-type: none;
}
li:nth-child(1){
position: relative;
top: 50vh;
background: gray;
width: 200px;
height: 50px;
transform: skew(45deg);
text-align: center;
overflow: hidden;
}
li:nth-child(2){
position: relative;
top: 50vh;
background: red;
width: 200px;
height: 50px;
left: 25px;
text-align: center;
overflow: hidden;
}
li:nth-child(3){
position: relative;
top: 50vh;
background: green;
width: 200px;
height: 50px;
transform: skew(-45deg);
text-align: center;
overflow: hidden;
}
#three{
position: relative;
top:95%;
animation: ani 5s linear ;
animation-delay: 0s;transition: all 5s;
}
#two{
position: relative;
top:95%;
animation: anii 4s linear ;
animation-delay: 2.8s;transition: all 5s;
}
#one{
position: relative;
top:95%;
animation: aniii 4s forwards ;
animation-delay: 4.8s;transition: all 5s;
}
@keyframes ani{
0%{
top: 90%;
}
50%{
top: 0%;
}
100%{
top: -90%;
}
}
@keyframes anii{
0%{
top: 90%;
}
50%{
top: 50%%;
}
100%{
top: -90%;
}
}
@keyframes aniii{
0%{
top: 90%;
}
50%{
top: 50%%;
}
100%{
top: 0%;
}
}
</style>
</head>
<body>
<ul>
<li><h4 id="one">hello <br> world</h4></li>
<li><h4 id="two">hello <br> world</h4></li>
<li><h4 id="three">hello <br> world</h4></li>
</ul>
</body>
</html>