微信小程序纯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);
  }
}

效果

相关推荐
Mh8 小时前
基于踩过的坑,浅聊一下vh、svh、lvh、dvh
前端·css·设计模式
社会渣渣17 小时前
开发者工具正常、真机白屏:一次渲染差异排查
微信小程序
daguanren20 小时前
一个页面外壳,多页复用:weapp-vite / Wevu 布局的编译与动态切换
微信小程序
源码手记20 小时前
基于微信小程序的上门代厨厨师预约系统-毕设源码
微信小程序·小程序·课程设计
微订校园外卖系统20 小时前
自建自营小程序落地前,先把订单状态机与试单链路跑通
小程序·外卖系统·本地生活·微订
千寻技术帮21 小时前
基于微信小程序的点餐管理系统_50044(源码+脚本+文档)
mysql·微信小程序·小程序·毕业设计·springboot·点餐管理系统
AI源码1 天前
中医药文化介绍小程序
小程序·notepad++
千寻技术帮2 天前
基于微信小程序的零食销售系统(源码+文档+脚本)50047
数据库·mysql·微信小程序·小程序·毕业设计·springboot·课程设计
源码手记2 天前
基于微信小程序的驾考刷题学习系统-毕设源码
学习·微信小程序·课程设计
lyz2468592 天前
uniapp-x在小程序使用uchart图表加载问题
小程序·uni-app