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

效果

相关推荐
说私域3 小时前
技术赋能直播运营:开源AI智能名片商城小程序助力个人IP构建与高效运营
人工智能·tcp/ip·小程序·流量运营·私域运营
说私域4 小时前
流量思维向长效思维转型:开源链动2+1模式AI智能名片小程序赋能私域电商品牌建设
人工智能·小程序·开源·产品运营·私域运营
cc.ChenLy21 小时前
【CSS进阶】毛玻璃效果与代码解析
前端·javascript·css
@大迁世界1 天前
仅用 CSS 实现元素圆形排列的方法
前端·css
CappuccinoRose1 天前
CSS 语法学习文档(十一)
前端·css·学习·表单控件
说私域1 天前
链动2+1模式AI智能名片S2B2C商城小程序在微商信任重建中的创新应用与价值实现
大数据·人工智能·小程序·私域运营
dangfulin1 天前
简单的视差滚动效果
前端·css·视差滚动
qq_24218863321 天前
微信小程序AI象棋游戏开发指南
人工智能·微信小程序·小程序
Amumu121381 天前
CSS:字体属性
前端·css
henry1010101 天前
DeepSeek生成的网页版念经小助手
javascript·css·html5·工具