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

效果

相关推荐
就叫飞六吧17 分钟前
css+js 前端无限画布实现
前端·javascript·css
百***81272 小时前
【HTML+CSS】使用HTML与后端技术连接数据库
css·数据库·html
xiaoxue..4 小时前
深入理解浏览器渲染流程:从HTML/CSS/JS到像素呈现
前端·javascript·css·html
汤姆Tom4 小时前
CSS 自定义属性深度应用:构建动态样式系统
前端·css·面试
小码哥0686 小时前
【源码集锦】租房小程序技术搭建
小程序·app·租房·租房平台
GMICLOUD7 小时前
Cursor x GMI Cloud 零基础教程:用 Inference Engine 生成你的第一个小程序
人工智能·经验分享·小程序·教程
毕设源码-郭学长7 小时前
【开题答辩全过程】以 火锅点菜小程序为例,包含答辩的问题和答案
小程序
鹏多多7 小时前
CSS渐变色边框的两种实现方案原理+对比与实战
前端·javascript·css
2501_916008897 小时前
Objective-C 测试(OC 测试)指南 从单元测试到性能调优的多工具协同方法
android·ios·小程序·https·uni-app·iphone·webview
2501_9159090619 小时前
iOS 上架需要什么东西?一次从准备清单到实操流程的完整技术拆解
android·macos·ios·小程序·uni-app·cocoa·iphone