-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbox-animation-2.html
93 lines (79 loc) · 1.78 KB
/
box-animation-2.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Box animation 1</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
width: 100vw;
height: 100vh;
background: #000000;
}
.box {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 300px;
height: 300px;
background: transparent;
}
.box span {
position: absolute;
width: 100px;
height: 100px;
background: #fff;
border-radius: 4%;
animation: an_1 2s ease-in-out infinite;
}
@keyframes an_1 {
0% {
left: 0%;
top: 0%;
}
25% {
left: 50%;
top: 0%;
}
50% {
left: 50%;
top: 50%;
}
75% {
left: 0%;
top: 50%;
}
100% {
left: 0%;
top: 0%;
}
}
.box span:nth-child(1) {
animation-delay: 0s;
background: #ff7801;
box-shadow: 0 0 20px #ff7801;
}
.box span:nth-child(2) {
animation-delay: -0.67s;
background: #2097ff;
box-shadow: 0 0 20px #2097ff;
}
.box span:nth-child(3) {
animation-delay: 0.6s;
background: #00aa00;
box-shadow: 0 0 20px #00aa00;
}
</style>
</head>
<body>
<div class="box">
<span></span>
<span></span>
<span></span>
</div>
</body>
</html>