-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathLoading.vue
65 lines (65 loc) · 1.26 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
<template>
<div class="loading-screen" v-show="loading" v-bind:class="classes" v-bind:style="{backgroundColor:bc}">
<component v-if="customLoader" v-bind:is="customLoader"></component>
<div v-else>
<div class="loading-circle"></div>
<p class="loading-text">{{text}}</p>
</div>
</div>
</template>
<script>
export default {
data() {
return {
text: 'Loading',
dark: false,
classes: null,
loading: false,
background: null,
customLoader: null
}
},
computed:{
bc(){
return this.background || (this.dark ? 'rgba(0,0,0,0.8)' : 'rgba(255,255,255,0.8)')
}
},
}
</script>
<style scoped>
.loading-screen {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
position: fixed;
top: 0;
left: 0;
z-index: 300;
flex-direction: column;
user-select: none;
}
.loading-circle {
width: 50px;
height: 50px;
border-radius: 100%;
border: 2px solid transparent;
border-left-color: #ababab;
animation: circleanimation .45s linear infinite
}
.loading-text {
margin-top: 15px;
color: #808080;
font-size: 12px;
text-align: center;
}
@keyframes circleanimation {
from {
transform: rotateZ(0deg);
}
to {
transform: rotateZ(360deg);
}
}
</style>