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

效果

相关推荐
小赵同学WoW13 小时前
CSS作用域穿透选择器
前端·css
jingqingdai314 小时前
微信小程序 Canvas 2D 踩坑指南:如何优雅地导出高清长图?(附 AI 辅助实录)
人工智能·微信小程序·小程序
逆光如雪14 小时前
移动端border-left 和 width:1px,同样写1px为什么粗细不同?
前端·css
2503_9284115614 小时前
AI 行业正在重塑每个人的工作方式,而你需要一个更轻松的入口
人工智能·小程序
|晴 天|15 小时前
从零打造现代化个人博客:Vue 3 + TypeScript + Element Plus 完整实战
javascript·css·chrome·typescript·html5·webstorm
05Nuyoah17 小时前
CSS文本和字体属性,列表属性
javascript·css·css3
Rabbit码工18 小时前
HTML5 与 CSS3 新特性全解析:从结构优化到视觉升级
前端·css·css3·html5
王美丽1.8518 小时前
css3选择器
前端·css·css3
王铁柱66618 小时前
使用css3如何对动画进行延时操作?
前端·css·css3
qq_4335021821 小时前
微信小程序更新机制踩坑记录:updateInfo 为什么总是读到旧数据?
微信小程序·小程序·notepad++