WaterPolo.vue
2.04 KB
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
<template>
<div class="polo">
<div class="polo-box">
<div :class="['number','box-center',{'white':num > 50 }]">
{{num}}<span>%</span>
</div>
<template v-if="num > 0">
<div
class="three"
:style="{top:`${100 - num - 10}%`}"
></div>
<div
class="two"
:style="{top:`${100 - num - 5}%`}"
></div>
<div
class="one"
:style="{top:`${100 - num}%`}"
></div>
</template>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'WaterPolo',
props: {
num: {
type: Number,
default: 0
}
},
data() {
return {
// num:60
}
},
mounted() {},
methods: {}
}
</script>
<style scoped lang='scss'>
.polo {
width: 100%;
height: 100%;
border: 1px solid var(--themeColor);
overflow: hidden;
border-radius: 100%;
.polo-box {
position: relative;
width: 100%;
height: 100%;
transform: rotate(0deg);
overflow: hidden;
border-radius: 100%;
}
.number {
font-size: 13px;
font-weight: 500;
color: var(--themeColor);
z-index: 2;
span {
font-size: 7px;
}
}
.white {
color: #fff;
text-shadow: 1px 1px var(--themeColor);
}
.one,
.two,
.three {
position: absolute;
// width: 200%;
// height: 200%;
width: 150%;
height: 150%;
z-index: 0;
}
.one {
border-radius: 40% 50% 40% 60%;
background-color: var(--themeColor);
left: -25%;
// left: -50%;
animation: ball-move linear infinite 5s;
}
.two {
border-radius: 45% 35% 50% 60%;
background-color: rgb(197, 215, 239);
left: -25%;
// left: -50%;
animation: ball-move linear infinite 7.5s;
}
.three {
border-radius: 40% 60% 50% 40%;
background-color: rgb(235, 241, 249);
left: -10%;
// left: -20%;
animation: ball-move linear infinite 10s;
}
@keyframes ball-move {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}
</style>