Hellom's Studio.

玩转css3

字数统计: 172阅读时长: 1 min
2019/09/18 Share

使用 css 实现 loading (菊花图)

1
2
3
<span class="aot">
<i></i><i></i><i></i><i></i>
</span>
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
.aot {
position: relative;
display: inline-block;
font-size: 20px;
width: 20px;
height: 20px;
transform: rotate(45deg);
animation: spinRotate 1.2s infinite linear;
}

.aot i {
width: 9px;
height: 9px;
border-radius: 100%;
background: #1890ff;
transform: scale(0.75);
display: block;
position: absolute;
opacity: 0.3;
animation: spinMove 1s infinite linear alternate;
transform-origin: 50% 50%;
&:nth-child(1) {
left: 0;
top: 0;
}

&:nth-child(2) {
right: 0;
top: 0;
animation-delay: 0.4s;
}
&:nth-child(3) {
right: 0;
bottom: 0;
animation-delay: 0.8s;
}
&:nth-child(4) {
left: 0;
bottom: 0;
animation-delay: 1.2s;
}
}

@keyframes spinMove {
to {
opacity: 1;
}
}

@keyframes spinRotate {
to {
transform: rotate(405deg);
}
}
CATALOG
  1. 1. 使用 css 实现 loading (菊花图)