前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >微信小程序--加载动画:旋转方块

微信小程序--加载动画:旋转方块

作者头像
海轰Pro
发布2021-04-09 17:17:47
1.2K0
发布2021-04-09 17:17:47
举报
文章被收录于专栏:海轰轰的学习笔记

效果展示

在这里插入图片描述
在这里插入图片描述

Demo代码

wxml

代码语言:javascript
复制
 <view class="loading-screen">
        <view class="loading">
            <view class="flour" ></view>
            <view class="flour" ></view>
            <view class="flour" ></view>
            <view class="flour" ></view>
        </view>
    </view> 

wxss

代码语言:javascript
复制
page{
  margin: 0;
  padding: 0;
}

.loading-screen{
  width: 100%;
  height: 100vh;
  background-color: #2e2e2e;
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading{
  width: 80px;
  display: flex;
  flex-wrap: wrap;
.

效果展示(改进)

在这里插入图片描述
在这里插入图片描述

Demo代码

wxml

代码语言:javascript
复制
  <view class="loading-screen">
        <view class="loading">
            <view class="flour_1" ></view>
            <view class="flour_2" ></view>
            <view class="flour_3" ></view>
            <view class="flour_4" ></view>
        </view>
    </view>

wxss

代码语言:javascript
复制
page{
  margin: 0;
  padding: 0;
}

.loading-screen{
  width: 100%;
  height: 100vh;
  background-color: #2e2e2e;
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading{
  width: 80px;
  display: flex;
  flex-wrap: wrap;
  animation: rotate 4s linear infinite;
}

@keyframes rotate{
  to{
      transform: rotate(360deg);
  }
}



/* 四色版本 */
.loading .flour_1{
  width: 32px;
  height: 32px;
  background-color: #eb4d4b;
  margin: 4px;
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-01-29 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 效果展示
  • Demo代码
  • 效果展示(改进)
  • Demo代码
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档