-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbox-animation-1.html
80 lines (65 loc) · 985 Bytes
/
box-animation-1.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Box animation 1</title>
</head>
<style>
* {
margin: 0;
padding: 0;
}
body {
background: #4b4b4b;
}
.backbox {
left: 50%;
top: 50%;
position: absolute;
transform: translate(-50%, -50%);
background: rgba(0, 0, 0, 1);
width: 200px;
height: 200px;
}
.minbox {
position: absolute;
width: 100px;
height: 100px;
background: #ffaf40;
}
.minbox::before {
position: absolute;
width: 100px;
height: 100px;
content: '';
background: #25CCF7;
left: 100%;
}
.minbox::after {
position: absolute;
width: 100px;
height: 100px;
content: '';
background: #f74f4f;
left: 100%;
top: 100%;
animation: last_an 1s ease-in infinite;
}
@keyframes last_an {
to {
transform: translateX(-100%);
}
}
@keyframes first_an {
to {
transform: translateX(100%);
}
}
</style>
<body>
<div class="backbox">
<div class="minbox">
</div>
</div>
</body>
</html>