请务必收下这10+个加载特效

前端迷

共 15799字,需浏览 32分钟

 ·

2021-12-19 02:35

☀️ 前言

相信大家经常会使用到加载动画,但是大部分组件库的加载样式都太简洁了👻。

这次给前端工友们收集了10+个高逼格加载动画效果!!复制就能直接用!!😎

⛷️ 来吧展示

1、一个"滚动"加载

跳动旋转的的方块再加上渐变的影子简单的构成了一个物体滚动的画面


<div class="boxLoading">div>
/* loading.css */
.boxLoading {  
  width50px;
  height50px;
  margin: auto;
  position: absolute;
  left0;
  right0;
  top0;
  bottom0;
}
.boxLoading:before {
  content'';
  width50px;
  height5px;
  background#fff;
  opacity0.7;
  position: absolute;
  top59px;
  left0;
  border-radius50%;
  animation: shadow .5s linear infinite;
}
.boxLoading:after {
  content'';
  width50px;
  height50px;
  background#e04960;
  animation: animate .5s linear infinite;
  position: absolute;
  top0;
  left0;
  border-radius3px;
}
@keyframes animate {
  17% {
    border-bottom-right-radius3px;
  }
  25% {
    transformtranslateY(9pxrotate(22.5deg);
  }
  50% {
    transformtranslateY(18pxscale(1, .9rotate(45deg);
    border-bottom-right-radius40px;
  }
  75% {
    transformtranslateY(9pxrotate(67.5deg);
  }
  100% {
    transformtranslateY(0rotate(90deg);
  }
}
@keyframes shadow {
  0%, 100% {
    transformscale(11);
  }
  50% {
    transformscale(1.21);
  }
}

Author:Dicson

2、一个"方块消失术"加载

当每个消失的方块集成一起再设置不同的消失时间会发生什么事情呢?


<div class="sk-cube-grid">
    <div class="sk-cube sk-cube-1">div>
    <div class="sk-cube sk-cube-2">div>
    <div class="sk-cube sk-cube-3">div>
    <div class="sk-cube sk-cube-4">div>
    <div class="sk-cube sk-cube-5">div>
    <div class="sk-cube sk-cube-6">div>
    <div class="sk-cube sk-cube-7">div>
    <div class="sk-cube sk-cube-8">div>
    <div class="sk-cube sk-cube-9">div>
  div>
/* loading.css */
.sk-cube-grid {
  width4em;
  height4em;
  margin: auto; 
}
.sk-cube {
  width33%;
  height33%;
  background-color#e04960;
  float: left;
  animation: sk-cube-grid-scale-delay 1.3s infinite ease-in-out;
}
.sk-cube-1 {
  animation-delay0.2s;
}
.sk-cube-2 {
  animation-delay0.3s;
}
.sk-cube-3 {
  animation-delay0.4s;
}
.sk-cube-4 {
  animation-delay0.1s;
}
.sk-cube-5 {
  animation-delay0.2s;
}
.sk-cube-6 {
  animation-delay0.3s;
}
.sk-cube-7 {
  animation-delay0s;
}
.sk-cube-8 {
  animation-delay0.1s;
}
.sk-cube-9 {
  animation-delay0.2s;
}
@keyframes sk-cube-grid-scale-delay {
  0%, 70%, 100% {
    transformscale3D(1,1,1);
  }
  35%           {
    transformscale3D(0,0,1);
  }
}

Author:Nicola Pressi

3、一个"无敌风火镰"加载

四个镰刀来回劈斩会形成一个什么现象呢?

loading4.gif

<div class="spinner">
  <div class="outer">
    <div class="inner tl">div>
    <div class="inner tr">div>
    <div class="inner br">div>
    <div class="inner bl">div>
  div>
div>
/* loading.css */
.spinner {
  position: absolute;
  width128px;
  height128px;
  topcalc(50% - 64px);
  leftcalc(50% - 64px);
  transformperspective(206pxrotateX(45deg);
}

.outer {
  box-sizing: border-box;
  animation: spin 3s linear infinite;
  height100%;
}

.inner {
  position: absolute;
  border-radius50%;
  width64px;
  height64px;
  animation: spin 1.8s ease-in-out infinite;
}
.inner.tl {
  top0;
  left0;
  border-top2px solid #531430;
  border-left4px solid #531430;
}
.inner.tr {
  top0;
  right0;
  border-top2px solid #e04960;
  border-right4px solid #e04960;
}
.inner.br {
  bottom0;
  right0;
  border-bottom2px solid #531430;
  border-right4px solid #531430;
}
.inner.bl {
  bottom0;
  left0;
  border-bottom2px solid #e04960;
  border-left4px solid #e04960;
}
@keyframes spin {
  0% {
    transformrotate(0deg);
  }
  100% {
    transformrotate(360deg);
  }
}

Author:Martin van Driel

4、一个"填充"加载

简单的正方形旋转再加上内部的高度控制即可实现填充效果喔~

loading5.gif

<span class="loading">
  <span class="loading-inner">span>
span>
/* loading.css */
.loading {
  display: inline-block;
  width30px;
  height30px;
  position: relative;
  border4px solid #e04960;
  animation: loader 4s infinite ease;
}
.loading-inner {
  vertical-align: top;
  display: inline-block;
  width100%;
  background-color#e04960;
  animation: loader-inner 4s infinite ease-in;
}
@keyframes loader {
  0% {
    transformrotate(0deg);
  }
  25% {
    transformrotate(180deg);
  }
  50% {
    transformrotate(180deg);
  }
  75% {
    transformrotate(360deg);
  }
  100% {
    transformrotate(360deg);
  }
}
@keyframes loader-inner {
  0% {
    height0%;
  }  
  25% {
    height0%;
  }
  50% {
    height100%;
  }
  75% {
    height100%;
  } 
  100% {
    height0%;
  }
}

Author:Josh

5、一个"音浪"加载

1个元素缩放很简陋,那15个会发生什么?

loading6.gif

<div class="loader">
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
  <span>span>
div>
/* loading.css */
.loader {
  position: absolute;
  top0px;
  bottom0px;
  left0px;
  right0px;
  margin: auto;
  width175px;
  height100px;
}
.loader span {
  display: block;
  background#e04960;
  width7px;
  height100%;
  border-radius14px;
  margin-right5px;
  float: left;
}
.loader span:last-child {
  margin-right0px;
}
.loader span:nth-child(1) {
  animation: load 2.5s 1.4s infinite linear;
}
.loader span:nth-child(2) {
  animation: load 2.5s 1.2s infinite linear;
}
.loader span:nth-child(3) {
  animation: load 2.5s 1s infinite linear;
}
.loader span:nth-child(4) {
  animation: load 2.5s 0.8s infinite linear;
}
.loader span:nth-child(5) {
  animation: load 2.5s 0.6s infinite linear;
}
.loader span:nth-child(6) {
  animation: load 2.5s 0.4s infinite linear;
}
.loader span:nth-child(7) {
  animation: load 2.5s 0.2s infinite linear;
}
.loader span:nth-child(8) {
  animation: load 2.5s 0s infinite linear;
}
.loader span:nth-child(9) {
  animation: load 2.5s 0.2s infinite linear;
}
.loader span:nth-child(10) {
  animation: load 2.5s 0.4s infinite linear;
}
.loader span:nth-child(11) {
  animation: load 2.5s 0.6s infinite linear;
}
.loader span:nth-child(12) {
  animation: load 2.5s 0.8s infinite linear;
}
.loader span:nth-child(13) {
  animation: load 2.5s 1s infinite linear;
}
.loader span:nth-child(14) {
  animation: load 2.5s 1.2s infinite linear;
}
.loader span:nth-child(15) {
  animation: load 2.5s 1.4s infinite linear;
}
@keyframes load {
  0% {
    background#531430;
    transformscaleY(0.08);
  }
  50% {
    background#e04960;
        
   transformscaleY(1);
  }
  100% {
    background#531430;    
    transformscaleY(0.08);
  }
}

Author:Dicson

6、一个"声浪"加载

元素透明度与高度的配合也能做别具一格的效果

loading7.gif

<div class="bars">
  <div class="bar">div>
  <div class="bar">div>
  <div class="bar">div>
  <div class="bar">div>
  <div class="bar">div>
  <div class="bar">div>
  <div class="bar">div>
  <div class="bar">div>
  <div class="bar">div>
  <div class="bar">div>
div>
/* loading.css */
.bars {
  height30px;
  left50%;
  margin: -30px 0 0 -20px;
  position: absolute;
  top60%;
  width40px;
}
.bar {
 background#e04960;
  bottom1px;
  height3px;
  position: absolute;
  width3px;      
  animation: sound 0ms -800ms linear infinite alternate;
}
@keyframes sound {
  0% {
     opacity: .35;
      height3px
  }
  100% {
      opacity1;       
      height28px;        
  }
}
.bar:nth-child(1)  { left1pxanimation-duration474ms; }
.bar:nth-child(2)  { left5pxanimation-duration433ms; }
.bar:nth-child(3)  { left9pxanimation-duration407ms; }
.bar:nth-child(4)  { left13pxanimation-duration458ms; }
.bar:nth-child(5)  { left17pxanimation-duration400ms; }
.bar:nth-child(6)  { left21pxanimation-duration427ms; }
.bar:nth-child(7)  { left25pxanimation-duration441ms; }
.bar:nth-child(8)  { left29pxanimation-duration419ms; }
.bar:nth-child(9)  { left33pxanimation-duration487ms; }
.bar:nth-child(10) { left37pxanimation-duration442ms; }

Author:El Alemaño

7、一个"无敌风火圆"加载

4个圆居然能做出相对排斥的效果?


<div class="loading">
  <div class="inner one">div>
  <div class="inner two">div>
  <div class="inner three">div>
  <div class="inner four">div>
div>
/* loading.css */
.loading {
  position: absolute;
  topcalc(50% - 24px);
  leftcalc(50% - 24px);
  width48px;
  height48px;
  border-radius50%;
  transformperspective128px ) rotateX30deg );
}
.inner {
  position: absolute;
  box-sizing: border-box;
  width16px;
  height16px;
  background-color#e04960;
  border-radius50%;
}
.inner.one {
  left0%;
  top0%;
  animation: move-right 1s ease-out infinite;
}
.inner.two {
  right0%;
  top0%;
  animation: move-down 1s ease-in-out infinite;
}
.inner.three {
  right0%;
  bottom0%;
  animation: move-left 1s ease-in-out infinite;
}
.inner.four {
  left0%;
  bottom0%;
  animation: move-up 1s ease-out infinite;
}
@keyframes move-right {
  0% {
    transformtranslateX(0);
  }
  100% {
    transformtranslateX(32px);
  }
}
@keyframes move-down {
  0% {
    transformtranslateY();
  }
  100% {
    transformtranslateY(32px);
  }
}
@keyframes move-left {
  0% {
    transformtranslateX(0);
  }
  100% {
    transformtranslateX(-32px);
  }
}
@keyframes move-up {
  0% {
    transformtranslateY(0);
  }
  100% {
    transformtranslateY(-32px);
  }
}

Author:Martin van Driel

8、一个"弹珠"加载

一个个的小弹珠来回移动居然也能描绘出如此美妙的画面

loading9.gif

<div class="container">
  <div class="ball">div>
  <div class="ball">div>
  <div class="ball">div>
  <div class="ball">div>
  <div class="ball">div>
  <div class="ball">div>
  <div class="ball">div>
div>
/* loading.css */
.container {
    width200px;
    height100px;
    margin0 auto;
}
.ball {
    width10px;
    height10px;
    margin10px auto;
    border-radius50px;
}
.ball:nth-child(1) {
    background#e04960;
    -webkit-animation: right 1s infinite ease-in-out;
    -moz-animation: right 1s infinite ease-in-out;
    animation: right 1s infinite ease-in-out;
}
.ball:nth-child(2) {
    background#e04960;
    -webkit-animation: left 1.1s infinite ease-in-out;
    -moz-animation: left 1.1s infinite ease-in-out;
    animation: left 1.1s infinite ease-in-out;
}
.ball:nth-child(3) {
    background#e04960;
    -webkit-animation: right 1.05s infinite ease-in-out;
    -moz-animation: right 1.05s infinite ease-in-out;
    animation: right 1.05s infinite ease-in-out;
}
.ball:nth-child(4) {
    background#e04960;
    -webkit-animation: left 1.15s infinite ease-in-out;
    -moz-animation: left 1.15s infinite ease-in-out;
    animation: left 1.15s infinite ease-in-out;
}
.ball:nth-child(5) {
    background#e04960;
    -webkit-animation: right 1.1s infinite ease-in-out;
    -moz-animation: right 1.1s infinite ease-in-out;
    animation: right 1.1s infinite ease-in-out;
}
.ball:nth-child(6) {
    background#e04960;
    -webkit-animation: left 1.05s infinite ease-in-out;
    -moz-animation: left 1.05s infinite ease-in-out;
    animation: left 1.05s infinite ease-in-out;
}
.ball:nth-child(7) {
    background#e04960;
    -webkit-animation: right 1s infinite ease-in-out;
    -moz-animation: right 1s infinite ease-in-out;
    animation: right 1s infinite ease-in-out;
}
@-webkit-keyframes right {
    0% {
            -webkit-transformtranslate(-15px);
    }
    50% {
            -webkit-transformtranslate(15px);
    }
    100% {
            -webkit-transformtranslate(-15px);
    }
}
@-webkit-keyframes left {
    0% {
            -webkit-transformtranslate(15px);
    }
    50% {
            -webkit-transformtranslate(-15px);
    }
    100% {
            -webkit-transformtranslate(15px);
    }
}
@-moz-keyframes right {
    0% {
            -moz-transformtranslate(-15px);
    }
    50% {
            -moz-transformtranslate(15px);
    }
    100% {
            -moz-transformtranslate(-15px);
    }
}
@-moz-keyframes left {
    0% {
            -moz-transformtranslate(15px);
    }
    50% {
            -moz-transformtranslate(-15px);
    }
    100% {
            -moz-transformtranslate(15px);
    }
}
@keyframes right {
    0% {
            transformtranslate(-15px);
    }
    50% {
            transformtranslate(15px);
    }
    100% {
            transformtranslate(-15px);
    }
}
@keyframes left {
    0% {
            transformtranslate(15px);
    }
    50% {
            transformtranslate(-15px);
    }
    100% {
            transformtranslate(15px);
    }
}

Author:Richie

9、一个"胶粘"加载

每个圆进行粘合拆分形成了一个胶粘效果

loading10.gif

<div class="loading">
div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <defs>
    <filter id="goo">
      <feGaussianBlur in="SourceGraphic" stdDeviation="6.3" result="blur" />
      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 14 -4" result="goo" />
      <feBlend in="SourceGraphic" in2="goo" />
    filter>
  defs>
svg>
/* loading.css */
.loading {
  width166px;
  height166px;
  position: absolute;
  left50%;
  top50%;
  transformtranslate(-50%, -50%);
  -webkit-filterurl("#goo");
  filterurl("#goo");
}
.loading span {
  width100%;
  text-align: center;
  color#e04960;
  font-weight: bold;
  text-transform: uppercase;
  font-size15px;
  letter-spacing1px;
  position: absolute;
  left1px;
  top46%;
}
.loading:before.loading:after {
  content'';
  border-radius50%;
  background-color#e04960;
  width26px;
  height26px;
  position: absolute;
  left72px;
  top8px;
  animation: rotate 6s linear;
  animation-iteration-count: infinite;
  transform-origin12px 76px;
}
.loading:before {
  box-shadow45px 19px 0px 0px #e0496062px 63px 0px 0px #e0496045px 107px 0px 0px #e049600px 126px 0px 0px #e04960, -46px 107px 0px 0px #e04960, -63px 63px 0px 0px #e04960, -46px 19px 0px 0px #e04960;
}
.loading:after {
  animation-direction: reverse;
}
@keyframes rotate {
 0% { transformrotate(0deg); }
 100% { transformrotate(-360deg); }
}

Author:Dicson

10、一个"方块对对碰"加载

巧妙的运用位移也能做出碰撞挤出的效果


<div class="loading">
  <div class="loading-square">div>
  <div class="loading-square">div>
  <div class="loading-square">div>
  <div class="loading-square">div>
div>
/* loading.css */
.loader {
  display: block;
  position: relative;
  height20px;
  width86px;
}
.loading-square {
  position: absolute;
  height20px;
  width20px;
  top0;
}
.loading-square:nth-child(1) {
  left0;
  animation: square1 1.5s linear forwards infinite;
}
.loading-square:nth-child(2) {
  left22px;
  animation: square2 1.5s linear forwards infinite;
}
.loading-square:nth-child(3) {
  left44px;
  animation: square3 1.5s linear forwards infinite;
}
.loading-square:nth-child(4) {
  left66px;
  animation: square4 1.5s linear forwards infinite;
}
@keyframes square1 {
  0% {
    background-color#97c900;
    transformtranslate(00);
  }
  9.09091% {
    transformtranslate(0, calc(-100% - 2px));
    background-color#97c900;
  }
  18.18182% {
    transformtranslate(calc(100% + 2px), calc(-100% - 2px));
    background-color#15668a;
  }
  27.27273% {
    transformtranslate(calc(100% + 2px), 0);
  }
  100% {
    background-color#15668a;
    transformtranslate(calc(100% + 2px), 0);
  }
}
@keyframes square2 {
  0% {
    background-color#15668a;
    transformtranslate(00);
  }
  18.18182% {
    transformtranslate(00);
  }
  27.27273% {
    transformtranslate(0, calc(100% + 2px));
    background-color#15668a;
  }
  36.36364% {
    transformtranslate(calc(100% + 2px), calc(100% + 2px));
    background-color#D53A33;
  }
  45.45455% {
    transformtranslate(calc(100% + 2px), 0);
  }
  100% {
    background-color#D53A33;
    transformtranslate(calc(100% + 2px), 0);
  }
}
@keyframes square3 {
  0% {
    background-color#D53A33;
    transformtranslate(00);
  }
  36.36364% {
    transformtranslate(00);
  }
  45.45455% {
    transformtranslate(0, calc(-100% - 2px));
    background-color#D53A33;
  }
  54.54545% {
    transformtranslate(calc(100% + 2px), calc(-100% - 2px));
    background-color#E79C10;
  }
  63.63636% {
    transformtranslate(calc(100% + 2px), 0);
  }
  100% {
    background-color#E79C10;
    transformtranslate(calc(100% + 2px), 0);
  }
}
@keyframes square4 {
  0% {
    transformtranslate(00);
    background-color#E79C10;
  }
  54.54545% {
    transformtranslate(00);
  }
  63.63636% {
    transformtranslate(0, calc(100% + 2px));
    background-color#E79C10;
  }
  72.72727% {
    background-color#D53A33;
  }
  81.81818% {
    background-color#15668a;
  }
  90.90909% {
    transformtranslate(calc(-300% - 6px), calc(100% + 2px));
    background-color#97c900;
  }
  100% {
    transformtranslate(calc(-300% - 6px), 0);
    background-color#97c900;
  }
}

Author:Paul Grant

11、一个"Switch"加载

有Switch的同学应该很熟悉了,这就是eshop里面的加载

loading12.gif

<div class="load">
  <div class="loading">
    <div class="loader__bar">div>
    <div class="loader__bar loader__bar--delay-1">div>
    <div class="loader__bar loader__bar--delay-2">div>
    <div class="loader__bar loader__bar--delay-3">div>
    <div class="loader__bar loader__bar--delay-4">div>
    <div class="loader__bar loader__bar--delay-5">div>
    <div>
  div>
div>
/* loading.css */
.load{
  width400px;
  height170px;
}
@keyframes loader {
  0%{
    background#FF8919;
    width:0%;
  }20%{
    width:100%;
  }39%{
    background#FF8919;
  }40%{
    background#FFA54F;
    width0%
  }60%{
    width100%;
  }80%{
    width:0%;
  }100%{
    background#FFA54F;
    width0%;
  }
}
@keyframes loaderAlt {
  0%{
    background#FF7C00;
    width:100%;
  }19%{
    background#FF7C00;
  }20%{
    background#FF9834;
    width0%;
  }40%{
    width100%;
  }59%{
    background#FF9834;
  }60%{
    background#FF7C00;
    width0;
  }80%{
    width100%;
  }100%{
    background#FF7C00;
    width100%
  }
}
.loading{
  display: flex;
  flex-direction: column;
  height100%;
  position: relative;
  width100%;
}
.loader__bar{
  display: flex;
  flex1;
  position: relative;
  width100%;
}
.loader__bar:before{
  animation: loader ease 8s infinite;
  animation-delay100ms;
  background#FF7C00;
  background-size200% 200%;
  content"";
  height:100%;
  width0%;
}
.loader__bar:after{
  animation: loaderAlt ease 8s infinite;
  animation-delay100ms;
  background#FF7C00;
  background-size200% 200%;
  content"";
  height100%;
  width100%;
}
.loader__bar--delay-1:before,
.loader__bar--delay-1:after{
  animation-delay200ms;
}
.loader__bar--delay-2:before,
.loader__bar--delay-2:after{
  animation-delay300ms;
}
.loader__bar--delay-3:before,
.loader__bar--delay-3:after{
  animation-delay400ms;
}
.loader__bar--delay-4:before,
.loader__bar--delay-4:after{
  animation-delay500ms;
}
.loader__bar--delay-5:before,
.loader__bar--delay-5:after{
  animation-delay600ms;
}

Author:Steve Meredith


浏览 28
点赞
评论
收藏
分享

手机扫一扫分享

举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

举报