微信小程序自定义加载动画loading

2022-11-22  本文已影响0人  好好学习__天天向上
<view class="ring">
  <view class="line">
  </view>
</view>

.ring {
  position: relative;
  margin: 80rpx auto;
  width: 20px;
  height: 20px;
  border: 5px solid #3370ff;
  border-radius: 50%;
}

.line {
  display: block;
  position: absolute;
  z-index: 99;
  top: -25px;
  left: -25px;
  width: 60px;
  height: 60px;
}

.line::before {
  content: '';
  display: block;
  position: absolute;
  z-index: 99;
  top: 0px;
  left: 23.5px;
  width: 14px;
  height: 60px;
  border: 5px solid transparent;
  border-top: 5px solid #3370ff;
  border-radius: 10px;
  animation: animateCircle 0.6s linear infinite;
}

@keyframes animateCircle {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
效果图 转动的截图.png
上一篇 下一篇

猜你喜欢

热点阅读