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

效果

相关推荐
用户0595401744632 分钟前
把 AI 记忆验证从手工 Log 换成 Pytest+Mem0,上下文丢失 bug 减少 90%
前端·css
小林ixn1 小时前
BEM 命名规范与 CSS 重置:打造优雅的按钮页面实战
前端·css
27669582921 小时前
拼多多m端/小程序 encrypt_info
java·小程序·apache·encrypt_info·encrypt_info解密·拼多多小程序·拼多多m端
用户059540174461 小时前
把对话记忆从内存搬到 Redis,长期记忆准确率从 63% 提升到 98%
前端·css
克里斯蒂亚诺更新2 小时前
微信小程序体验版可以获取当前位置但是正式版不可以-办法解决
微信小程序·小程序
巴巴博一2 小时前
uni-app / 微信小程序中 open-type=“share“ 按钮样式异常,和普通 view 无法齐平的解决方案
微信小程序·uni-app·notepad++
资深前端之路2 小时前
微信小程序节点最大限制为5000个
微信小程序·小程序
ZC跨境爬虫2 小时前
跟着 MDN 学CSS day_43:CSS布局挑战——从浮动到弹性盒与栅格的综合实践
前端·css·ui·html·tensorflow
cosinmz4 小时前
PDF 发票合并经验分享:月初高效整理发票的实用方法
经验分享·小程序·pdf·pdf转换·pdf发票合并·发票合并打印
wuxia211812 小时前
微信小程序单击元素切换元素的显示和隐藏
javascript·微信小程序·setdata