微信小程序纯css实现波浪效果

  • wxml
html 复制代码
<view class="container">
  <view class="head">
    
  </view>
</view>
  • wxss
html 复制代码
.container {
  width: 100vw;
  height: 100vh;
}

.head {
  position: relative;
  height: 400rpx;
  background-color: rgb(118, 218, 255);
  overflow: hidden;
}

.head::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1000rpx;
  height: 1000rpx;
  background-color: #fff;
  animation-name: rotate;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  bottom: 40rpx;
  opacity: .5;
  border-radius: 47%;
  animation-duration: 10s;
}

.head::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 1000rpx;
  height: 1000rpx;
  background-color: #fff;
  animation-name: rotate;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  bottom: 100rpx;
  border-radius: 45%;
  animation-duration: 10s;
}

@keyframes rotate {
  0% {
    transform: translate(-50%, 0) rotateZ(0deg);
  }

  50% {
    transform: translate(-50%, -2%) rotateZ(180deg);
  }

  100% {
    transform: translate(-50%, 0%) rotateZ(360deg);
  }
}

效果

相关推荐
路上^_^13 分钟前
CSS核心笔记001
前端·css·笔记
十年之少14 分钟前
网络请求——微信小程序学习笔记
笔记·学习·微信小程序
小宁爱Python27 分钟前
CSS的复合选择器
前端·css
KENYCHEN奉孝44 分钟前
用微信小程序制作一个性行为同意协议系统
微信小程序
fakaifa1 小时前
【2025最新版】火鸟门户v8.5系统源码+PC、H5、小程序 +数据化大屏插件
小程序·php·源码下载·火鸟门户·同城门户系统
暖阳_xm1 小时前
使用css实现动态loading
前端·css
拾荒旧痕1 小时前
通过gird布局实现div的响应式分布排列
前端·javascript·css
大美B端工场-B端系统美颜师2 小时前
B端小程序如何突破常规,成为企业获客新利器?
小程序
264玫瑰资源库2 小时前
2025年七星棋牌跨平台完整源码解析(200+地方子游戏+APP+H5+小程序支持,附服务器镜像导入思路)
服务器·游戏·小程序
七月十二3 小时前
[Uni][微信小程序]wx小程序遇到的奇葩事情
微信小程序·uni-app