Windows预加载等待动画

84 篇文章 0 订阅

Windows预加载等待动画

教程地址原文地址(YouTube)

B站教程原文转载(bilibili)

两个视频的内容相同,第二个为转载

效果图

在这里插入图片描述

代码区

html

<div class="container">
		<div class="wrapper">
			<div class="loader">
				<div class="dot">
				</div>
			</div>
			<div class="loader">
				<div class="dot">
				</div>
			</div>
			<div class="loader">
				<div class="dot">
				</div>
			</div>
			<div class="loader">
				<div class="dot">
				</div>
			</div>
			<div class="loader">
				<div class="dot">
				</div>
			</div>
			<div class="loader">
				<div class="dot">
				</div>
			</div>
		</div>
		<div class="text">
			Please wait</div>
	</div>

CSS

@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;  /* 盒子大小规则 */
}
body{
  display: flex;  /* 弹性盒布局 */
  align-items: center;  /* 交叉轴对齐 */
  justify-content: center;  /* 主轴对齐 */
  min-height: 100vh;
  text-align: center;
  background: #0079d7;
}
.container{
  position: relative;  /* 相对定位 */
  width: 100%;
  display: flex;
  justify-content: center;
}
.wrapper{
  position: absolute;
  top: -35px;
  transform: scale(2.0);  /* 放大倍率 */
}
.loader{
  height: 25px;
  width: 1px;
  position: absolute;
  animation: rotate 3.5s linear infinite;  /* 动画,时间,线性,重复 */
}
.loader .dot{
  top: 30px;
  height: 7px;
  width: 7px;
  background: #fff;
  border-radius: 50%;
  position: relative;
}
.text{
  position: absolute;
  bottom: -85px;
  font-size: 25px;
  font-weight: 400;
  font-family: 'Poppins',sans-serif;
  color: #fff;
}
@keyframes rotate {
  30%{
    transform: rotate(220deg);  /* 旋转角度 */
  }
  40%{
  transform: rotate(450deg);
    opacity: 1;
  }
  75%{
    transform: rotate(720deg);
    opacity: 1;
  }
  76%{
    opacity: 0;
  }
  100%{
    opacity: 0;
    transform: rotate(0deg);
  }
}
.loader:nth-child(1){
  animation-delay: 0.15s;  /* 动画延时 */
}
.loader:nth-child(2){
  animation-delay: 0.3s;
}
.loader:nth-child(3){
  animation-delay: 0.45s;
}
.loader:nth-child(4){
  animation-delay: 0.6s;
}
.loader:nth-child(5){
  animation-delay: 0.75s;
}
.loader:nth-child(6){
  animation-delay: 0.9s;
}

JS

// 无

教程地址原文地址(YouTube)

B站教程原文转载(bilibili)

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值