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

效果

相关推荐
whinc24 分钟前
🚀 两年小程序开发,我把踩过的坑做成了开源 Skills
前端·微信小程序·ai编程
Lupino3 小时前
烧掉 10 刀 API 费,我才明白小程序虚拟列表根本不用“库”!
react.js·微信小程序
bluceli6 小时前
CSS容器查询:响应式设计的新范式
前端·css
Bigger8 小时前
CSS 这些年都经历了什么?一次看懂 CSS 的演化史
前端·css·前端工程化
小溪彼岸1 天前
是时候给想做小程序的小伙伴泼盆冷水了
微信小程序
大漠_w3cpluscom1 天前
使用 clip-path: shape() 创建 Squircle 形状
前端·css·weui
远山枫谷2 天前
一文理清页面/组件通信与 Store 全局状态管理
前端·微信小程序
木易士心3 天前
一文读懂:微信小程序云数据库直连原理与使用指南
微信小程序·serverless
会员源码网3 天前
告别参数混乱:如何优雅解决方法参数过多导致的可维护性难题
css
明月_清风3 天前
小程序云函数:从入门到全栈的“降维打击”指南
前端·微信小程序·小程序·云开发