绿满眶商城微信小程序-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
<template>
  <view class="animations">
    <view class="box">
      <view class="loader">
        <view class="loader__ball"></view>
        <view class="loader__ball"></view>
        <view class="loader__ball"></view>
      </view>
    </view>
  </view>
</template>
 
<script>
export default {
  name: "loading-triangle",
  data() {
    return {};
  },
};
</script>
 
<style lang="scss" scoped>
$dotColor: linear-gradient(135deg, #1fa2ff, #12d8fa, #29ffc6);
$dotSize: 30rpx;
$duration: 2s;
.animations {
  width: 160rpx;
  height: 160rpx;
  position: relative;
}
.box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.loader {
  animation: rotate $duration linear infinite normal;
  position: relative;
  transform-origin: 50% 50%;
 
  &__ball {
    height: $dotSize;
    width: $dotSize;
    left: -$dotSize * 0.5;
    position: absolute;
    top: -$dotSize * 0.5;
    transform-origin: 50% 50%;
 
    &:nth-of-type(2) {
      transform: rotate(120deg);
    }
 
    &:nth-of-type(3) {
      transform: rotate(240deg);
    }
 
    &::after {
      animation: move $duration * 0.5 ease-in-out infinite alternate;
      background: $dotColor;
      border-radius: 50%;
      content: "";
      display: inline-block;
      height: 100%;
      width: 100%;
      transform-origin: 50% 50%;
    }
  }
}
 
@keyframes rotate {
  from {
    transform: rotate(0);
  }
 
  to {
    transform: rotate(360deg);
  }
}
 
@keyframes move {
  0%,
  15% {
    transform: translateY(0);
  }
 
  100% {
    transform: translateY(-150%);
  }
}
</style>