-
Notifications
You must be signed in to change notification settings - Fork 10
/
Spinner.vue
64 lines (63 loc) · 1.32 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
<template>
<i :class='["wt-spinner", "icon-spinner" + type]' :style="{fontSize: size + 'rem',backgroundImage: bgcolor}"></i>
</template>
<script>
import { computed } from 'vue';
export default {
props: {
size: {
type: String,
default: () => {
return '1.5';
}
},
type: {
type: String,
default: () => {
return '';
}
},
from: {
type: String,
default: () => {
return '#333';
}
},
to: {
type: String,
default: () => {
return '#999';
}
}
},
setup(props) {
const bgcolor = computed(() => {
return '-webkit-gradient(linear, 0 0, 0 bottom, from(' + props.from + '), to(' + props.to + '))';
})
return {
bgcolor
}
}
};
</script>
<style lang='less' rel='stylesheet/less' scoped>
.wt-spinner {
animation: spin 1.5s infinite steps(8);
display: inline-block;
color: #1BB5F1;
font-size: 1rem;
background-image: -webkit-gradient(linear, 0 0, 0 bottom, from(#333), to(#999));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg)
}
}
</style>