forked from greyby/vue-spinner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScaleLoader.vue
124 lines (114 loc) · 2.48 KB
/
ScaleLoader.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
114
115
116
117
118
119
120
121
122
123
124
<template>
<div class="v-spinner" v-show="loading">
<div class="v-scale v-scale1" v-bind:style="[spinnerStyle,spinnerDelay1]">
</div><div class="v-scale v-scale2" v-bind:style="[spinnerStyle,spinnerDelay2]">
</div><div class="v-scale v-scale3" v-bind:style="[spinnerStyle,spinnerDelay3]">
</div><div class="v-scale v-scale4" v-bind:style="[spinnerStyle,spinnerDelay4]">
</div><div class="v-scale v-scale5" v-bind:style="[spinnerStyle,spinnerDelay5]">
</div>
</div>
</template>
<script>
export default {
name: 'ScaleLoader',
props: {
loading: {
type: Boolean,
default: true
},
color: {
type: String,
default: '#5dc596'
},
height: {
type: String,
default: '35px'
},
width: {
type: String,
default: '4px'
},
margin: {
type: String,
default: '2px'
},
radius: {
type: String,
default: '2px'
}
},
data () {
return {
spinnerStyle: {
backgroundColor: this.color,
height: this.height,
width: this.width,
margin: this.margin,
borderRadius: this.radius,
display: 'inline-block',
animationName: 'v-scaleStretchDelay',
animationDuration: '1s',
animationIterationCount: 'infinite',
animationTimingFunction: 'cubic-bezier(.2,.68,.18,1.08)',
animationFillMode: 'both'
// TODO
// animation: ['sk-waveStretchDelay', '1s', 'infinite', 'cubic-bezier(.2,.68,.18,1.08)'].join(' '),
// animationFillMode: "both"
},
spinnerDelay1: {
animationDelay: '0.1s'
},
spinnerDelay2: {
animationDelay: '0.2s'
},
spinnerDelay3: {
animationDelay: '0.3s'
},
spinnerDelay4: {
animationDelay: '0.4s'
},
spinnerDelay5: {
animationDelay: '0.5s'
}
}
}
}
</script>
<style>
.v-spinner
{
/* font-size: 10px;
width: 60px;
height: 40px;*/
/*margin: 25px auto;*/
text-align: center;
}
@-webkit-keyframes v-scaleStretchDelay
{
0%,
100%
{
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
50%
{
-webkit-transform: scaleY(0.4);
transform: scaleY(0.4);
}
}
@keyframes v-scaleStretchDelay
{
0%,
100%
{
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
50%
{
-webkit-transform: scaleY(0.4);
transform: scaleY(0.4);
}
}
</style>