/
Loading.vue
113 lines (107 loc) · 2.25 KB
/
Loading.vue
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
<template>
<div class="bytedanceLoading">
<div class="bytedanceLoading__wrapper">
<!-- <div class="bytedanceLoading__background"></div> -->
<div class="bytedanceLoading__inner">
<div class="bytedanceLoading__inner-item"></div>
<div class="bytedanceLoading__inner-item"></div>
<div class="bytedanceLoading__inner-item"></div>
<div class="bytedanceLoading__inner-item"></div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "loading",
data() {
return {
fullscreen: false,
lock: false
};
},
methods: {
close() {
this.$el.remove();
this.$destroy();
}
}
};
</script>
<style lang="less">
.directiveLoading {
&-parent {
position: relative;
&-visible {
// max-height: 100vh !important;
// overflow: hidden;
// min-height: 500px !important;
}
}
}
</style>
<style lang="less">
@height: 10px;
@duration: 400ms;
@itemWidth: 9px;
@doubleHorizontalSpace: 2px;
@longerHeight: 29px;
@shorterHeight: 14px;
@keyframes verticalDance {
0% {
transform: translate3d(0, @height, 0);
}
50% {
transform: translate3d(0, -@height, 0);
}
100% {
transform: translate3d(0, @height, 0);
}
}
.bytedanceLoading {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(255, 255, 255, 1);
z-index: 100;
&-fullscreen {
position: fixed !important;
}
&__inner {
display: flex;
height: 20px;
&-item {
width: @itemWidth;
margin: 0 @doubleHorizontalSpace;
animation-name: verticalDance;
animation-duration: @duration;
animation-iteration-count: infinite;
&:first-child {
background-color: #2d5fb2;
height: @longerHeight;
animation-delay: -300ms;
}
&:nth-child(2) {
background-color: #3682c7;
height: @shorterHeight;
animation-delay: -400ms;
}
&:nth-child(3) {
animation-delay: -600ms;
background-color: #00bfc5;
height: @shorterHeight;
}
&:last-child {
animation-delay: -900ms;
background-color: #5acec6;
height: @longerHeight;
}
}
}
}
</style>