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

效果

相关推荐
万岳科技系统开发1 天前
商城系统搭建自建平台与入驻第三方平台对比分析
数据库·小程序·架构
漂流瓶jz1 天前
运行时vs编译时:CSS in JS四种主流方案介绍和对比
前端·javascript·css
钮钴禄·爱因斯晨1 天前
他到底喜欢我吗?赛博塔罗Java+前端实现,一键解答!
java·开发语言·前端·javascript·css·html
笨笨狗吞噬者2 天前
uni-app 运行时揭秘:styleIsolation 的转化
前端·微信小程序·uni-app
DoWhatUWant2 天前
WebUI页面结构
css·html5
double_eggm2 天前
微信小程序3
微信小程序·小程序
杰建云1672 天前
小程序如何提升留存?
小程序·小程序制作
PinTrust SSL证书2 天前
Geotrust企业型OV通配符SSL
网络协议·网络安全·小程序·https·云计算·ssl
怀君2 天前
Uniapp——微信小程序Canvas层级过高问题解决
微信小程序·小程序·uni-app
杰建云1672 天前
小程序如何提升转化率?
小程序·小程序制作