loading动画是前端页面加载时必不可少的元素,好看合适的加载动画会极大的提升用户体验与系统的交互效果。下面为大家提供几种简单的加载动画效果,如果帮助到你了请点赞评论。

1.无限循环的圆圈

  1. <div class="chase-wrapper">
  2. <div class="chase-item"></div>
  3. <div class="chase-item"></div>
  4. <div class="chase-item"></div>
  5. <div class="chase-item"></div>
  6. <div class="chase-item"></div>
  7. <div class="chase-item"></div>
  8. </div>
  1. .chase-wrapper {
  2. width: 60px;
  3. height: 60px;
  4. display: inline-block;
  5. animation: chase-loader 2.5s infinite linear both;
  6. margin: 50px;
  7. }
  8. .chase-item {
  9. width: 100%;
  10. height: 100%;
  11. position: absolute;
  12. top: 0;
  13. left: 0;
  14. animation: chase-dot 2s infinite ease-in-out both;
  15. }
  16. .chase-item:before {
  17. content: "";
  18. display: block;
  19. width: 25%;
  20. height: 25%;
  21. background-color: skyBlue;
  22. border-radius: 100%;
  23. animation: chase-dot-before 2s infinite ease-in-out both;
  24. }
  25. .chase-item:nth-child(1),
  26. .chase-item:nth-child(1):before {
  27. animation-delay: -1.1s;
  28. }
  29. .chase-item:nth-child(2),
  30. .chase-item:nth-child(2):before {
  31. animation-delay: -1s;
  32. }
  33. .chase-item:nth-child(3),
  34. .chase-item:nth-child(3):before {
  35. animation-delay: -0.9s;
  36. }
  37. .chase-item:nth-child(4),
  38. .chase-item:nth-child(4):before {
  39. animation-delay: -0.8s;
  40. }
  41. .chase-item:nth-child(5),
  42. .chase-item:nth-child(5):before {
  43. animation-delay: -0.7s;
  44. }
  45. .chase-item:nth-child(6),
  46. .chase-item:nth-child(6):before {
  47. animation-delay: -0.6s;
  48. }
  49. @keyframes chase-loader {
  50. 100% {
  51. transform: rotate(1turn);
  52. }
  53. }
  54. @keyframes chase-dot {
  55. 80%,
  56. 100% {
  57. transform: rotate(360deg);
  58. }
  59. }
  60. @keyframes chase-dot-before {
  61. 50% {
  62. transform: scale(0.4);
  63. }
  64. 100%,
  65. 0% {
  66. transform: scale(1);
  67. }
  68. }

2.若隐若现的方块

  1. <div class="cube-wrapper">
  2. <div class="cube cube1"></div>
  3. <div class="cube cube2"></div>
  4. <div class="cube cube3"></div>
  5. <div class="cube cube4"></div>
  6. <div class="cube cube5"></div>
  7. <div class="cube cube6"></div>
  8. <div class="cube cube7"></div>
  9. <div class="cube cube8"></div>
  10. <div class="cube cube9"></div>
  11. </div>
  1. .cube-wrapper {
  2. width: 60px;
  3. height: 60px;
  4. display: inline-block;
  5. margin: 50px;
  6. }
  7. .cube {
  8. width: 33%;
  9. height: 33%;
  10. float: left;
  11. background: skyBlue;
  12. animation: cube-loader 1.3s infinite ease-in-out;
  13. animation-delay: 0.2s;
  14. }
  15. .cube1 {
  16. animation-delay: 0.2s;
  17. }
  18. .cube2 {
  19. animation-delay: 0.3s;
  20. }
  21. .cube3 {
  22. animation-delay: 0.4s;
  23. }
  24. .cube4 {
  25. animation-delay: 0.1s;
  26. }
  27. .cube5 {
  28. animation-delay: 0.2s;
  29. }
  30. .cube6 {
  31. animation-delay: 0.3s;
  32. }
  33. .cube7 {
  34. animation-delay: 0s;
  35. }
  36. .cube8 {
  37. animation-delay: 0.1s;
  38. }
  39. @keyframes cube-loader {
  40. 0%,
  41. 70%,
  42. 100% {
  43. transform: scale3D(1, 1, 1);
  44. }
  45. 35% {
  46. transform: scale3D(0, 0, 1);
  47. }
  48. }

3.闪转腾挪的方块

  1. <div class="plane-wrapper"></div>
  1. .plane-wrapper {
  2. width: 60px;
  3. height: 60px;
  4. background-color: skyBlue;
  5. display: inline-block;
  6. animation: plane-loader 1.2s infinite ease-in-out;
  7. margin: 50px;
  8. }
  9. @keyframes plane-loader {
  10. 0% {
  11. transform: perspective(120px);
  12. }
  13. 50% {
  14. transform: perspective(120px) rotateY(180deg);
  15. }
  16. 100% {
  17. transform: perspective(120px) rotateY(180deg) rotateX(180deg);
  18. }
  19. }

4.左右交互的方圆

  1. <div class="preloader-wrapper"></div>
  1. .preloader-wrapper {
  2. position: relative;
  3. display: inline-block;
  4. width: 20px;
  5. height: 20px;
  6. margin: 50px;
  7. }
  8. .preloader-wrapper:before {
  9. width: 20px;
  10. height: 20px;
  11. border-radius: 20px;
  12. background: blue;
  13. content: "";
  14. position: absolute;
  15. background: #9b59b6;
  16. animation: preloader_before 2s infinite ease-in-out;
  17. }
  18. .preloader-wrapper:after {
  19. width: 20px;
  20. height: 20px;
  21. border-radius: 20px;
  22. background: blue;
  23. content: "";
  24. position: absolute;
  25. background: #2ecc71;
  26. left: 22px;
  27. animation: preloader_after 1.5s infinite ease-in-out;
  28. }
  29. @keyframes preloader_before {
  30. 0% {
  31. transform: translateX(0px) rotate(0deg);
  32. }
  33. 50% {
  34. transform: translateX(50px) scale(1.2) rotate(260deg);
  35. background: #2ecc71;
  36. border-radius: 0px;
  37. }
  38. 100% {
  39. transform: translateX(0px) rotate(0deg);
  40. }
  41. }
  42. @keyframes preloader_after {
  43. 0% {
  44. transform: translateX(0px);
  45. }
  46. 50% {
  47. transform: translateX(-50px) scale(1.2) rotate(-260deg);
  48. background: #9b59b6;
  49. border-radius: 0px;
  50. }
  51. 100% {
  52. transform: translateX(0px);
  53. }
  54. }

5.一闪一闪的圆圈

  1. <div class="pulse-wrapper">
  2. <div class="pulse-item one"></div>
  3. <div class="pulse-item two"></div>
  4. <div class="pulse-item three"></div>
  5. </div>
  1. .pulse-wrapper {
  2. margin: 50px;
  3. }
  4. .pulse-item {
  5. width: 20px;
  6. height: 20px;
  7. border-radius: 50%;
  8. background-color: skyBlue;
  9. animation: pulse-loader 0.4s ease 0s infinite alternate;
  10. position: relative;
  11. display: inline-block;
  12. }
  13. .two {
  14. margin: 0 15px;
  15. animation: pulse-loader 0.4s ease 0.2s infinite alternate;
  16. }
  17. .three {
  18. animation: pulse-loader 0.4s ease 0.4s infinite alternate;
  19. }
  20. @keyframes pulse-loader {
  21. 0% {
  22. opacity: 1;
  23. transform: scale(1);
  24. }
  25. 100% {
  26. opacity: 0.5;
  27. transform: scale(0.75);
  28. }
  29. }

6.高低起伏的音符

  1. <div class="rect-wrapper">
  2. <div class="rect-item rect1"></div>
  3. <div class="rect-item rect2"></div>
  4. <div class="rect-item rect3"></div>
  5. <div class="rect-item rect4"></div>
  6. <div class="rect-item rect5"></div>
  7. </div>
  1. .rect-wrapper {
  2. margin: 50px;
  3. }
  4. .rect-item {
  5. width: 6px;
  6. height: 60px;
  7. background-color: skyBlue;
  8. display: inline-block;
  9. margin: 0 4px;
  10. animation: rect-loader 1.2s infinite ease-in-out;
  11. }
  12. .rect2 {
  13. animation-delay: -1.1s;
  14. }
  15. .rect3 {
  16. animation-delay: -1s;
  17. }
  18. .rect4 {
  19. animation-delay: -0.9s;
  20. }
  21. .rect5 {
  22. animation-delay: -0.8s;
  23. }
  24. @keyframes rect-loader {
  25. 0%,
  26. 40%,
  27. 100% {
  28. transform: scaleY(0.4);
  29. }
  30. 20% {
  31. transform: scaleY(1);
  32. }
  33. }

后续我也会继续分享精美的loading动画,你也可以继续优化,选择适合你的方案。

前端常见loading动画的更多相关文章

  1. 【常见】CSS3进度条Loading动画

    现在,GIF 格式的进度条已经越来越少,CSS 进度条如雨后春笋般涌现.CSS3的崛起,更使得动态效果得以轻松实现,未来,必定是CSS3的天下,所以今天我就来分享一下几个常见的CSS3进度条Loadi ...

  2. 分享web前端七款HTML5 Loading动画特效集锦

    以前我们大部分的Loading动画都是利用gif图片实现的,这种图片实现Loading动画的方法虽然也很不错,但是作为HTML5开发者来说,如果能利用HTML5和CSS3实现这些超酷的Loading动 ...

  3. 【动画消消乐 】仿ios、android中常见的一个loading动画 074

    前言 Hello!小伙伴! 非常感谢您阅读海轰的文章,倘若文中有错误的地方,欢迎您指出-   自我介绍 ଘ(੭ˊᵕˋ)੭ 昵称:海轰 标签:程序猿|C++选手|学生 简介:因C语言结识编程,随后转入计 ...

  4. 纯css3 加载loading动画特效

    最近项目中要实现当页面还没有加载完给用户提示正在加载的loading,本来是想做个图片提示的,但是图片如果放大电脑的分辨率就会感觉到很虚,体验效果很不好.于是就采用css3+js实现这个loading ...

  5. CSS3效果:animate实现点点点loading动画效果(一)

    实现如图所示的点点点loading效果: 一:CSS3 animation实现代码 html代码: 提交订单中<span class="ani_dot">...< ...

  6. 几个单元素Loading动画解构

    这个账号建了也有1个多月,拖延症患者终于下定决心开始写博.做前端从前至后差不多1年时间,如果文中有什么纰漏欢迎指出,未来的路还很长~ 第一篇文章用来解构几个挺不错的单元素Loading动画.效果图如下 ...

  7. 开源分享三(炫酷的Android Loading动画)

    开源分享三(炫酷的Android Loading动画) 分享GitHub上的一些Loading,为了提升产品用户体验,一个好的Loading必然是不可缺少的,对于一些耗时需要用户等待的页面来说会转移用 ...

  8. electron-vue 项目添加启动loading动画问题

    前言 electron-vue脚手架搭建的项目,在开发阶段可能你注意不到项目启动慢的问题,但是在build 生成的exe可执行文件,启动后,要反应很久才能进入到app.vue 中加载的页面,体验性很差 ...

  9. 超酷!!HTML5 Canvas 水流样式 Loading 动画

    今天我们要分享另外一款基于HTML5 Canvas的液体流动样式Loading加载动画,这款Loading动画在加载时会呈现液体流动的动画效果,并且由于和背景颜色的对比,也略微呈现发光的动画效果. 效 ...

随机推荐

  1. Mysql 一主一从

    1. 主从原理 1.1 主从介绍 所谓 mysql 主从就是建立两个完全一样的数据库,其中一个为主要使用的数据库,另一个为次要的数据库,一般在企业中,存放比较重要的数据的数据库服务器需要配置主从,这样 ...

  2. CEOI 2019 Day2 T2 魔法树 Magic Tree (LOJ#3166、CF1993B、and JOI2021 3.20 T3) (启发式合并平衡树,线段树合并)

    前言 已经是第三次遇到原题. 第一次是在 J O I 2021 S p r i n g C a m p \rm JOI2021~Spring~Camp JOI2021 Spring Camp 里遇到的 ...

  3. 第三十六篇:vue3响应式(关于Proxy代理对象,Reflect反射对象)

    好家伙,这个有点难. 1.代理对象Proxy Proxy 对象用于创建一个对象的代理,从而实现基本操作的拦截和自定义(如属性查找.赋值.枚举.函数调用等). 拦截对象中任意属性的变化,包括:查get, ...

  4. python字典键或值去重

    from fuzzywuzzy import fuzz, process a = {'嫦娥四号探测器是用哪个型号的火箭发射的?': ['长征3B'], '嫦娥四号探测器是在我国[]发射成功的.': [ ...

  5. Linux有趣命令

    通外网 下载使用阿里云镜像源:wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.re ...

  6. CDH6.2.0 搭建大数据集群

    1. 资料准备 现在官网https://www.cloudera.com 需要注册账号,未来可能会收费等问题,十分麻烦,这里有一份我自己百度云的备份 链接: https://pan.baidu.com ...

  7. [DOM]获取元素:根据ID、标签名、HTML5新增的方法、特殊元素获取

    目录 [DOM]获取元素:根据ID.标签名.HTML5新增的方法.特殊元素获取 1.根据 ID 获取[.getElementById( )] 2.根据标签名获取[.getElementsByTagNa ...

  8. 微服务低代码Serverless平台(星链)的应用实践

    导读 星链是京东科技消金基础研发部研发的一款研发效能提升的工具平台,面向后端服务研发需求,尤其是集成性.场景化.定制化等难度不太高.但比较繁琐的需求,如服务前端的后端(BFF).服务流程编排.异步消息 ...

  9. 使用Gitlab CI/CD功能在本地部署 Spring Boot 项目

    前提条件: 1.Docker安装Gitlab,地址:https://www.cnblogs.com/sanduzxcvbnm/p/13814730.html 2.Docker安装Gitlab-runn ...

  10. Docker 数据共享与持久化