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

效果

相关推荐
nhc0881 小时前
贵阳纳海川科技・棋牌室行业数字化解决方案
科技·微信小程序·小程序·软件开发·小程序开发
xingyynt1 小时前
【HTML+CSS】使用HTML与后端技术连接数据库
css·数据库·html
January12072 小时前
Vue3打卡计时器:完整实现与优化方案
前端·javascript·css
lizi662 小时前
uniapp uview-plus 自定义动态验证
前端·vue.js·微信小程序
2501_915909062 小时前
iOS 抓包不越狱,代理抓包 和 数据线直连抓包两种实现方式
android·ios·小程序·https·uni-app·iphone·webview
小彭努力中2 小时前
195.Vue3 + OpenLayers:监听瓦片地图加载情况(200、403及异常处理)
前端·css·openlayers·cesium·webgis
Mintopia3 小时前
一份合格的软件 VI 文字文档简单版
前端·css·人工智能
CHU7290353 小时前
让知识传递更顺畅:在线教学课堂APP的功能设计
前端·人工智能·小程序
AI前端老薛3 小时前
小程序中简单 Loading 效果关键帧动画
小程序
Greg_Zhong3 小时前
小程序从搭建到开发,涉及基础及必备知识总结
微信小程序