绿满眶商城微信小程序-uniapp
peng
2025-06-27 3f7acbae32700d7c3c2f883968ea33d436df5219
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
125
126
127
<template>
  <view class="animations">
    <view class="three-body" :style="{ '--color': color }">
      <view class="three-body__dot"></view>
      <view class="three-body__dot"></view>
      <view class="three-body__dot"></view>
    </view>
  </view>
</template>
 
<script>
export default {
  name: "loading-wobble",
  props: {
    color: {
      type: String,
      default: "#0396FF",
    },
  },
  data() {
    return {};
  },
};
</script>
 
<style lang="scss" scoped>
$size: 100rpx;
$speed: 1s;
.three-body {
  position: relative;
  display: inline-block;
  height: $size;
  width: $size;
  animation: spin78236 calc($speed * 2.5) infinite linear;
}
 
.three-body__dot {
  position: absolute;
  height: 100%;
  width: 27%;
}
 
.three-body__dot:after {
  content: "";
  position: absolute;
  height: 0%;
  width: 100%;
  padding-bottom: 100%;
  background-color: var(--color);
  border-radius: 50%;
}
 
.three-body__dot:nth-child(1) {
  bottom: 5%;
  left: 0;
  transform: rotate(60deg);
  transform-origin: 50% 85%;
}
 
.three-body__dot:nth-child(1)::after {
  bottom: 0;
  left: 0;
  animation: wobble1 $speed infinite ease-in-out;
  animation-delay: calc($speed * -0.3);
}
 
.three-body__dot:nth-child(2) {
  bottom: 5%;
  right: 0;
  transform: rotate(-60deg);
  transform-origin: 50% 85%;
}
 
.three-body__dot:nth-child(2)::after {
  bottom: 0;
  left: 0;
  animation: wobble1 $speed infinite calc($speed * -0.15) ease-in-out;
}
 
.three-body__dot:nth-child(3) {
  bottom: -5%;
  left: 0;
  transform: translateX(116.666%);
}
 
.three-body__dot:nth-child(3)::after {
  top: 0;
  left: 0;
  animation: wobble2 $speed infinite ease-in-out;
}
 
@keyframes spin78236 {
  0% {
    transform: rotate(0deg);
  }
 
  100% {
    transform: rotate(360deg);
  }
}
 
@keyframes wobble1 {
  0%,
  100% {
    transform: translateY(0%) scale(1);
    opacity: 1;
  }
 
  50% {
    transform: translateY(-66%) scale(0.65);
    opacity: 0.8;
  }
}
 
@keyframes wobble2 {
  0%,
  100% {
    transform: translateY(0%) scale(1);
    opacity: 1;
  }
 
  50% {
    transform: translateY(66%) scale(0.65);
    opacity: 0.8;
  }
}
</style>