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

效果

相关推荐
军军君0113 小时前
数字孪生监控大屏实战模板:智能业务大数据监管平台
css·vue.js·elementui·typescript·前端框架·echarts·less
IT观测15 小时前
# 2026年SaaS小程序制作平台对比:乔拓云、有赞、微盟
小程序
睿智的海鸥19 小时前
Markdown 语法大全详解
开发语言·前端·javascript·css·html
宁夏雨科网19 小时前
印刷包装公司开发小程序的优势与内容
小程序·展示小程序·印刷包装·印刷公司小程序
爱上好庆祝1 天前
学习js的第三天
前端·css·人工智能·学习·计算机外设·js
HyaCinth1 天前
一人一周,用 Codex 渐进式迁移重构了一个材料学组件库
前端·javascript·css
lichenyang4531 天前
从零到一:用 Taro + React 搭建数据采集小程序
react.js·小程序·taro
龙猫里的小梅啊1 天前
CSS(四)CSS文本属性
前端·css
黄华SJ520it2 天前
139小程序商城模式开发
小程序·软件需求·系统开发
Greg_Zhong2 天前
详细说下小程序中使用canvas的体验
小程序·canvas绘制·canvas绘制内容溢出·绘制内容模拟器不正常·绘制内容真机正常