先看效果:


Windows加载动画应该是这样吧,不是也没事,懂原理之后这个运动曲线可以任意自己设置的~

实现:

1.定义标签:

 <div class="yongqi"><div class="quan"><div class="dian"></div><div class="dian"></div><div class="dian"></div><div class="dian"></div><div class="dian"></div>       </div><p>Windows 正在加载</p></div>

2.整体样式,首先是5个盒子(.dian)先是定位后是重叠在一起的,然后定义一个animation动画,目的是盒子旋转::

.quan{position: relative;margin: 0 auto;margin-bottom: 20px;width: 60px;height: 60px;}.dian{position: absolute;width: 100%;height: 100%;animation: zhuan 3.5s linear infinite;}

3.用伪类元素做小圆点,那么它的父亲盒子(.dian)转的时候就会带动小圆点转:

.dian::after{content: '';position: absolute;bottom: 0px;left: 50%;transform: translateX(-50%);width: 6px;height: 6px;background-color: #fff;border-radius: 50%;}

4.让每个(.dian)盒子等待一点时间后再转,那么小圆点就不会重叠在一起转了:

 .quan:nth-child(1){animation-delay: 0s;}.quan div:nth-child(2){animation-delay: 0.1s;}.quan div:nth-child(3){animation-delay: 0.2s;}.quan div:nth-child(4){animation-delay: 0.3s;}.quan div:nth-child(5){animation-delay: 0.4s;}

animation-delay 属性:属性定义动画何时开始。

5.实现部分,定义运动曲线:

 @keyframes zhuan{0%{transform: rotate(0deg);opacity: 1;}70%{transform: rotate(540deg);} 79%{opacity: 1;}80%{transform: rotate(720deg);opacity: 0;}100%{transform: rotate(810deg);opacity: 0;}}

原理:从上面效果图可以看出,整个动画只转了2圈后小圆点便消失后动画重复,就是转720deg。用opacity: 0 属性后圆点就会消失。那么我为什么动画不在100%的时候设置rotate(720deg)呢, 因为如果我这样:
0%{
transform: rotate(0deg);
opacity: 1;
}
100%{
transform: rotate(720deg);
opacity: 0;
}
根据动画的效果,小圆点会在转动到720deg之前就开始慢慢消失了。不能做到突然消失。所以可以在之前加:
99%{
opacity: 1;
}
这样圆点可以突然消失,但是圆点一消失后动画又马上重新开始了,无停顿。
所以我让动画在进度为80%这样就小圆点转到720deg后便消失了,(其实也没消失是透明了),已经透明看不见的圆点继续转到810deg,这样有个时间缓冲后动画才又重新开始。
至于最后半圈旋转速度明显加快了是因为:
70%{
transform: rotate(540deg);
}
80%{
transform: rotate(720deg);
opacity: 0;
}
动画进度在70%时就转到540deg,在80%时就飚到了720deg,时间紧任务重那这段时间肯定就加快转了呀~
当然其实曲线也可以用贝塞尔曲线(cubic-bezier)完成;
贝塞尔曲线(cubic-bezier)

完整代码:

  <!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>北极光之夜</title><style>*{margin: 0;padding: 0;box-sizing: border-box;}body{height: 100vh;display: flex;justify-content: center;align-items: center;background-color: rgb(15, 125, 199);color: rgb(255, 255, 255);}.quan{position: relative;margin: 0 auto;margin-bottom: 20px;width: 60px;height: 60px;}.dian{position: absolute;width: 100%;height: 100%;animation: zhuan 3.5s linear infinite;}.dian::after{content: '';position: absolute;bottom: 0px;left: 50%;transform: translateX(-50%);width: 6px;height: 6px;background-color: #fff;border-radius: 50%;}.quan:nth-child(1){animation-delay: 0s;}.quan div:nth-child(2){animation-delay: 0.1s;}.quan div:nth-child(3){animation-delay: 0.2s;}.quan div:nth-child(4){animation-delay: 0.3s;}.quan div:nth-child(5){animation-delay: 0.4s;}@keyframes zhuan{0%{transform: rotate(0deg);opacity: 1;}70%{transform: rotate(540deg);} 79%{opacity: 1;}80%{transform: rotate(720deg);opacity: 0;}100%{transform: rotate(810deg);opacity: 0;}}</style>
</head>
<body><div class="yongqi"><div class="quan"><div class="dian"></div><div class="dian"></div><div class="dian"></div><div class="dian"></div><div class="dian"></div>       </div><p>Windows 正在加载</p><P style="margin-top: 10px; text-align: center;">--北极光之夜--</P></div>
</body>
</html>

总结:


那天暴风雪与春日的阳光交替而至,令人应接不暇。天空被蓝天和乌云一分为二。和我一样。--------------《小森林》

windows加载动画相关推荐

  1. HTML+CSS制作Windows启动加载动画

    HTML+CSS制作Windows启动加载动画 效果图如下: HTML部分源代码如下: <!DOCTYPE html> <html lang="en">&l ...

  2. windows10加载动画_如何关闭动画并使Windows 10看起来更快

    windows10加载动画 Windows 10 fades and window animations are pure eye candy, but waiting for them to loa ...

  3. WPF添加加载动画遮罩

    项目中用到不少后台数据请求需要前端等待,添加加载动画改善用户体验 一.动画界面制作 添加一个自定义控件 <ResourceDictionaryxmlns="http://schemas ...

  4. android 加载动画素材,【AE教程】教你用Lottie实现App加载动画

    @Olaf_Chou 更加简便和高质量的还原 App 动效 前言 在没有 Lottie 之前,一般都是通过给 PNG 序列图,或者是开发自己写,当然这些动画一般都是比较简单的,如果遇到复杂的动画,开发 ...

  5. php带旋转动画刷新页面,CSS_CSS实现弹簧效果的旋转加载动画,先看看效果,像是弹簧在伸缩 - phpStudy...

    CSS实现弹簧效果的旋转加载动画 先看看效果,像是弹簧在伸缩: 具体代码: 此处用到CSS3的transform属性. CSS3的变形(transform)属性让元素在一个坐标系统中变形.这个属性包含 ...

  6. css 加载动画如何生效,CSS 加载动画

    CSS加载动画 实现加载动画效果,需要的两个关键步骤: 1.做出环形外观 border:16px solid #f3f3f3; border-radius:50%; border-top:16px s ...

  7. 模仿滴滴单车解锁的时候,从0%到90%的欺骗加载动画效果

    /**欺骗加载动画效果-*/var text = '已解锁{value}%';var interval;var __fakeLoading = function (callback, time, pe ...

  8. 真是好东西!一组动感的页面加载动画效果

    如果您曾经访问过 Nicolas Zezuka 和 Active Theory 的出色的设计网站,你可能已经注意到在显示新内容之前动感的页面加载动画了.这种风格的动画效果最近非常流行,因此这篇文章想给 ...

  9. 2款不同样式的CSS3 Loading加载动画 附源码

    原文:2款不同样式的CSS3 Loading加载动画 附源码 我们经常看到的Loading加载很多都是转圈圈的那种,今天我们来换一种有创意的CSS3 Loading加载动画,一种是声波形状的动画,另一 ...

最新文章

  1. NYOJ 回文字符串
  2. VMware vSphere学习整理
  3. 【dfs】树上游戏(P2664)
  4. 时间格式转换2020-04-09T23:00:00.000+08:00
  5. 公司创始人、董事长、CEO和总裁谁更大,有什么区别?
  6. centos7安装php5.2yum源操作_Centos7.6使用yum安装PHP7.2
  7. JavaWeb——mybatis模糊查询与主键返回
  8. Linux中图形界面与字符界面的转换
  9. 安全应急响应工作中易犯的5大错误
  10. 分析setting源代码获取sd卡大小
  11. 【文摘】《创新者》-沃尔特·艾萨克森
  12. Jenkins Pipeline声明式流水线
  13. 分析亚马逊竞争对手Listing的技巧与操作步骤
  14. Autoconf解释
  15. [2017集训队作业自选题#149]小c的岛屿
  16. 海思NNIE开发(一):海思Hi3559AV100/Hi3519AV100 NNIE深度学习模块开发与调试记录
  17. Unity鼠标滚轴缩放大小
  18. 考了10年公务员,如今35岁,终于死心了
  19. 用python批量获取微信头像
  20. Windows重装系统及安装教程(详解)

热门文章

  1. HTML:综合案例,体育新闻基本架构。
  2. mongodb 集群shard_【mongoDB运维篇④】Shard 分片集群
  3. 前端 input type=“password“ 实现禁止浏览器记住账号、密码的功能
  4. 办公软件常识 (转)
  5. 解决谷歌翻译不能使用的方法
  6. python源码剖析笔记1——Python对象初见
  7. 在龙芯3B1500上编译安装ICESTORM (open source platform for lattice ICE40 serial FPGA)
  8. 全球与中国微创女性尿失禁仪市场深度研究分析报告
  9. tightvnc使用教程,简述tightvnc使用教程
  10. win2008 64位支持32位Asp.net程序