微信小程序水波纹动画效果

水波波动效果实现,复制查看效果
在这里插入图片描述

wxml

<view class="circle">
    <view class="positionNumber">
        <view>60%</view>
        <view>匹配指数</view>
    </view>
    <view class="wave"></view>
</view>

wxss

.positionNumber{
      position: absolute;
      top: 30rpx;
      left: 0;
      right: 0;
      margin: auto;
      z-index: 9;
      text-align: center;
  }
  .positionNumber>view:nth-child(1){
    font-size: 30rpx;
    font-weight: bold;
    color: #555FF2;
  }
  .positionNumber>view:nth-child(2){
      font-size: 17rpx;
      color: #999;
}
.circle {
    width: 153rpx;
    height: 153rpx;
    background-color:  #7591AD;
    border-radius: 50%;
    position: relative;
    z-index: 9;
  }
  .wave {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(225deg, #8D93F7, #D4D6FC);
    border-radius: 50%;
    box-shadow: inset 0 0 50px #8D93F7;
    overflow: hidden;
    z-index: 0;
  }
  .wave::before, .wave::after {
    position: absolute;
    content: "";
    width: 200%;
    height: 200%;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .wave::before {
    border-radius: 30%;
    background: linear-gradient(225deg, #8D93F7, #D4D6FC);
    animation: animate 5s linear infinite;
  }
  .wave::after {
    border-radius: 40%;
    background: #fff;
    animation: animate 5s linear infinite;
  }
  
  @keyframes animate{
    0%{
        top:-50rpx;
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100%{
        top:-50rpx;
        transform: translate(-50%, -50%) rotate(360deg);
    }
  }
  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值