loading 加载动画
# loading_1
<template>
<div class="load-container1">
<div class="boxLoading"></div>
</div>
</template>
<script>
export default {
}
</script>
<style>
.load-container1 {
position: relative;
width: 100px;
height: 100px;
margin: 0 auto;
}
.load-container1 .boxLoading {
width: 50px;
height: 50px;
margin: auto;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.load-container1 .boxLoading:before {
content: "";
width: 50px;
height: 5px;
background: #000;
opacity: 0.1;
position: absolute;
top: 59px;
left: 0;
border-radius: 50%;
animation: shadow 0.5s linear infinite;
}
.load-container1 .boxLoading:after {
content: "";
width: 50px;
height: 50px;
background: #00adb5;
animation: animate 0.5s linear infinite;
position: absolute;
top: 0;
left: 0;
border-radius: 3px;
}
@keyframes animate {
17% {
border-bottom-right-radius: 3px;
}
25% {
transform: translateY(9px) rotate(22.5deg);
}
50% {
transform: translateY(18px) scale(1, 0.9) rotate(45deg);
border-bottom-right-radius: 40px;
}
75% {
transform: translateY(9px) rotate(67.5deg);
}
100% {
transform: translateY(0) rotate(90deg);
}
}
@keyframes shadow {
0%,
100% {
transform: scale(1, 1);
}
50% {
transform: scale(1.2, 1);
}
}
</style>
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
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
# loading_2
<template>
<div class="load"></div>
</template>
<script>
export default {
}
</script>
<style>
.load {
width: 50px;
height: 50px;
margin: 0 auto;
position: relative;
border-radius: 50%;
overflow: hidden;
background-color: rgba(0, 169, 178,.2);
}
.load::before {
content: "";
width: 70px;
height: 70px;
background-color: #00adb5;
position: absolute;
left: 50%;
bottom: 50%;
z-index: 1;
transform-origin: left bottom;
animation: rotate 1.5s infinite linear;
}
.load::after {
content: "";
width: 40px;
height: 40px;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
background-color: #fff;
z-index: 2;
border-radius: 50%;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
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
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
# loading_3
<template>
<div class="load-container2">
<div class="container1">
<div class="boxLoading boxLoading1"></div>
<div class="boxLoading boxLoading2"></div>
<div class="boxLoading boxLoading3"></div>
<div class="boxLoading boxLoading4"></div>
<div class="boxLoading boxLoading5"></div>
</div>
</div>
</template>
<script>
export default {
}
</script>
<style>
.load-container2 {
height: 150px;
display: flex;
align-items: center;
justify-content: center;
}
.load-container2 .container1{
width: 50px;
height: 60px;
text-align: center;
font-size: 10px;
}
.load-container2 .container1 .boxLoading {
background-color: #00adb5;
height: 100%;
width: 6px;
display: inline-block;
-webkit-animation: stretchdelay 1.2s infinite ease-in-out;
animation: stretchdelay 1.2s infinite ease-in-out;
}
.load-container2 .container1 .boxLoading2 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.load-container2 .container1 .boxLoading3 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.load-container2 .container1 .boxLoading4 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.load-container2 .container1 .boxLoading5 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
@-webkit-keyframes stretchdelay {
0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
20% { -webkit-transform: scaleY(1.0) }
}
@keyframes stretchdelay {
0%, 40%, 100% {
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
} 20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}
</style>
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
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
# loading_4
<template>
<div class="load-container3">
<div class="load load1"></div>
<div class="load load2"></div>
<div class="load"></div>
</div>
</template>
<script>
export default {
}
</script>
<style>
.load-container3 {
margin: 50px auto;
width: 150px;
text-align: center;
}
.load-container3 .load {
width: 20px;
height: 20px;
background-color: #00adb5;
border-radius: 100%;
display: inline-block;
-webkit-animation: bouncedelay 1.4s infinite ease-in-out;
animation: bouncedelay 1.4s infinite ease-in-out;
/* Prevent first frame from flickering when animation starts */
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.load-container3 .load1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.load-container3 .load2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
@-webkit-keyframes bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0.0) }
40% { -webkit-transform: scale(1.0) }
}
@keyframes bouncedelay {
0%, 80%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
} 40% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
</style>
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
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
::