forked from area17/twill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpinner.vue
82 lines (75 loc) · 1.69 KB
/
Spinner.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
<template>
<transition name="fade_spinner" @before-enter="beforeEnter" @after-enter="afterEnter" @before-leave="beforeLeave">
<div class="a17spinner">
<div class="a17spinner__anim" :class="{ 'a17spinner__anim--visible' : isVisible }">
<span class="loader"><span></span></span>
<!-- <slot></slot> -->
</div>
</div>
</transition>
</template>
<script>
export default {
name: 'A17Spinner',
props: {
visible: {
type: Boolean,
default: false
}
},
data: function () {
return {
isVisible: this.visible
}
},
methods: {
beforeEnter: function (el) {
this.isVisible = this.visible
},
afterEnter: function (el) {
this.isVisible = true
},
beforeLeave: function (el) {
this.isVisible = false
}
}
}
</script>
<style lang="scss"> // beware : not scoped
.a17spinner {
display: flex;
width: 100%;
// height: 50px;
padding: 10vh 0;
background-color: rgba($color__background, 0.75);
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: $zindex__loadingTable;
}
.a17spinner__anim {
margin: 100px auto;
width: 20px;
height: 20px;
position: relative;
text-align: center;
color:$color__text--light;
opacity:0;
transition: opacity .25s linear;
transition-delay:0.5s;
&.a17spinner__anim--visible {
opacity:1;
}
}
.app--form .a17spinner {
background-color: rgba($color__border--light, 0.75);
}
.s--in-editor .overlay .a17spinner {
background-color: $color__background;
.a17spinner__anim {
transition-delay:0s;
}
}
</style>