【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码)

这篇具有很好参考价值的文章主要介绍了【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。



写在前面

今天其实还是有点期待6月份城市赛道的成绩公布,但是可能因为出现城市太多等问题,官方也还在快马加鞭的统计中,我也趁机再发一篇前端的文章了,其实在很多系统里面我们都看到过各种各样的加载中样式,但是总有些显得平平无奇,今天我就统计了28种load加载动画特效给大家,希望能满足大家的需求。

涉及知识点

CSS3实现多种load加载效果,纯CSS3实现多种加载中效果,纯CSS3实现28种加载动态效果,页面实现loading效果,好看的loading动态特效,animation与transform的灵活应用。
版权声明:此文原创于CSDN博主-《拄杖盲学轻声码》,主页有很多分享的代码,期待您的访问。

效果展示

其实这个就是为了让更多的人能够选择性是否继续阅读这篇文章,为大家精准定位自己想要的demo,文尾有完整代码包下载链接。
【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码),CSS,前端开发,web页面开发-源码demo,css,前端


1、Loading节点的创建

在制作这个页面的时候首先就是构思,正常demo都是拿一个dom节点来示例,我选择整4个为代表,这样的话看着舒服点。
首先创建四个div,针对div设置居中展示,其中dom节点如下:

<div class="loader">
  <div class="loader-inner">
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>
<div class="loader">
  <div class="loader-inner">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>
<div class="loader">
  <div class="loader-inner">
    <div></div>
  </div>
</div>
<div class="loader">
  <div class="loader-inner">
    <div></div>
    <div></div>
  </div>
</div>

每一个loader都是表示装的一个加载中的效果,设置一个背景色效果如下:
【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码),CSS,前端开发,web页面开发-源码demo,css,前端

然后再在白色的方块内设置样式,因为效果不同,所以我采用不同的class名来设置不同的样式属性。
版权声明:此文原创于CSDN博主-《拄杖盲学轻声码》,主页有很多分享的代码,期待您的访问。

2、部分效果的实现源码

1)三点加载动画

主要使用了animation属性的设置,也是CSS3中具有代表性的动画特征,它可以实现动画的时间、反向、次数,甚至支持反向动画等。

语法:animation: name duration timing-function delay iteration-count direction fill-mode play-state;

其中属性说明如下:

说明
animation-name 指定要绑定到选择器的关键帧的名称
animation-duration 动画指定需要多少秒或毫秒完成
animation-timing-function 设置动画将如何完成一个周期
animation-delay 设置动画在启动前的延迟间隔。
animation-iteration-count 定义动画的播放次数。
animation-direction 指定是否应该轮流反向播放动画。
animation-fill-mode 规定当动画不播放时(当动画完成时,或当动画有一个延迟未开始播放时),要应用到元素的样式。
animation-play-state 指定动画是否正在运行或已暂停。
initial 设置属性为其默认值。
inherit 从父元素继承属性。

在我这个实例当中我主要设置的代码如下:

Html代码

<div class="loader">
  <div class="loader-inner ball-pulse">
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>

CSS样式代码

.ball-pulse>div:nth-child(1) {
        -webkit-animation: scale 0.75s 0.12s infinite cubic-bezier(.2, .68, .18, 1.08);
        animation: scale 0.75s 0.12s infinite cubic-bezier(.2, .68, .18, 1.08);
}

.ball-pulse>div:nth-child(2) {
        -webkit-animation: scale 0.75s 0.24s infinite cubic-bezier(.2, .68, .18, 1.08);
        animation: scale 0.75s 0.24s infinite cubic-bezier(.2, .68, .18, 1.08);
}

.ball-pulse>div:nth-child(3) {
        -webkit-animation: scale 0.75s 0.36s infinite cubic-bezier(.2, .68, .18, 1.08);
        animation: scale 0.75s 0.36s infinite cubic-bezier(.2, .68, .18, 1.08);
}

.ball-pulse>div {
        background-color: #fff;
        width: 15px;
        height: 15px;
        border-radius: 100%;
        margin: 2px;
        -webkit-animation-fill-mode: both;
        animation-fill-mode: both;
        display: inline-block;
}

添加样式后的效果如下:
【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码),CSS,前端开发,web页面开发-源码demo,css,前端

2)圆点矩阵加载特效

其实这个和上面的有点像,如果说第一个是一维的,那它就算二维的,是用了9个圆点形成的一个正方形矩阵,然后通过不同时间段各个圆点大小的变化形成的一种动态加载效果。
Html设置了9个子元素div,样式方面主要使用了css的animation-duration来设置不同节点的动画完成时间、animation-delay设置延迟间隔及transform设置缩放。如下所示代码:

Html代码

<div class="loader">
  <div class="loader-inner ball-grid-pulse">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>

CSS样式代码

@keyframes ball-grid-pulse {
        0% {
                -webkit-transform: scale(1);
                transform: scale(1);
        }

        50% {
                -webkit-transform: scale(0.5);
                transform: scale(0.5);
                opacity: 0.7;
        }

        100% {
                -webkit-transform: scale(1);
                transform: scale(1);
                opacity: 1;
        }
}

.ball-grid-pulse {
        width: 57px;
}

.ball-grid-pulse>div:nth-child(1) {
        -webkit-animation-delay: -0.06s;
        animation-delay: -0.06s;
        -webkit-animation-duration: 0.72s;
        animation-duration: 0.72s;
}

.ball-grid-pulse>div:nth-child(2) {
        -webkit-animation-delay: 0.25s;
        animation-delay: 0.25s;
        -webkit-animation-duration: 1.02s;
        animation-duration: 1.02s;
}

.ball-grid-pulse>div:nth-child(3) {
        -webkit-animation-delay: -0.17s;
        animation-delay: -0.17s;
        -webkit-animation-duration: 1.28s;
        animation-duration: 1.28s;
}

.ball-grid-pulse>div:nth-child(4) {
        -webkit-animation-delay: 0.48s;
        animation-delay: 0.48s;
        -webkit-animation-duration: 1.42s;
        animation-duration: 1.42s;
}

.ball-grid-pulse>div:nth-child(5) {
        -webkit-animation-delay: 0.31s;
        animation-delay: 0.31s;
        -webkit-animation-duration: 1.45s;
        animation-duration: 1.45s;
}

.ball-grid-pulse>div:nth-child(6) {
        -webkit-animation-delay: 0.03s;
        animation-delay: 0.03s;
        -webkit-animation-duration: 1.18s;
        animation-duration: 1.18s;
}

.ball-grid-pulse>div:nth-child(7) {
        -webkit-animation-delay: 0.46s;
        animation-delay: 0.46s;
        -webkit-animation-duration: 0.87s;
        animation-duration: 0.87s;
}

.ball-grid-pulse>div:nth-child(8) {
        -webkit-animation-delay: 0.78s;
        animation-delay: 0.78s;
        -webkit-animation-duration: 1.45s;
        animation-duration: 1.45s;
}

.ball-grid-pulse>div:nth-child(9) {
        -webkit-animation-delay: 0.45s;
        animation-delay: 0.45s;
        -webkit-animation-duration: 1.06s;
        animation-duration: 1.06s;
}

.ball-grid-pulse>div {
        background-color: #fff;
        width: 15px;
        height: 15px;
        border-radius: 100%;
        margin: 2px;
        -webkit-animation-fill-mode: both;
        animation-fill-mode: both;
        display: inline-block;
        float: left;
        -webkit-animation-name: ball-grid-pulse;
        animation-name: ball-grid-pulse;
        -webkit-animation-iteration-count: infinite;
        animation-iteration-count: infinite;
        -webkit-animation-delay: 0;
        animation-delay: 0;
}

页面呈现效果如下所示:
【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码),CSS,前端开发,web页面开发-源码demo,css,前端

3)圆形轨迹加载动画

这个相比上两个没有那么的复杂,主要用一个div就可以完成效果,主要是利用了animation-fill-mode和animation的样式设置,针对动画设置了transform的角度旋转动画rotate设置。

Html代码

 <div class="loader">
        <div class="loader-inner ball-clip-rotate">
          <div></div>
        </div>
      </div>

Css样式代码

.ball-clip-rotate>div {
        background-color: #fff;
        width: 15px;
        height: 15px;
        border-radius: 100%;
        margin: 2px;
        -webkit-animation-fill-mode: both;
        animation-fill-mode: both;
        border: 2px solid #fff;
        border-bottom-color: transparent;
        height: 25px;
        width: 25px;
        background: transparent !important;
        display: inline-block;
        -webkit-animation: rotate 0.75s 0s linear infinite;
        animation: rotate 0.75s 0s linear infinite;
}

@keyframes rotate {
        0% {
                -webkit-transform: rotate(0deg) scale(1);
                transform: rotate(0deg) scale(1);
        }

        50% {
                -webkit-transform: rotate(180deg) scale(0.6);
                transform: rotate(180deg) scale(0.6);
        }

        100% {
                -webkit-transform: rotate(360deg) scale(1);
                transform: rotate(360deg) scale(1);
        }
}

页面实现效果如下:
【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码),CSS,前端开发,web页面开发-源码demo,css,前端

4)栅栏式加载动画

其实这个是我们公司现阶段用的一个效果,有点像手风琴的感觉,其中设置了5根小柱子,然后通过设置这些柱子的高低动画,从而形成一种高低起伏的加载动画。
主要和前面一样,核心在于animation的样式设置。

Html代码

<div class="loader">
  <div class="loader-inner line-scale">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>

Css样式代码

.line-scale>div:nth-child(1) {
        -webkit-animation: line-scale 1s 0.1s infinite cubic-bezier(.2, .68, .18, 1.08);
        animation: line-scale 1s 0.1s infinite cubic-bezier(.2, .68, .18, 1.08);
}

.line-scale>div:nth-child(2) {
        -webkit-animation: line-scale 1s 0.2s infinite cubic-bezier(.2, .68, .18, 1.08);
        animation: line-scale 1s 0.2s infinite cubic-bezier(.2, .68, .18, 1.08);
}

.line-scale>div:nth-child(3) {
        -webkit-animation: line-scale 1s 0.3s infinite cubic-bezier(.2, .68, .18, 1.08);
        animation: line-scale 1s 0.3s infinite cubic-bezier(.2, .68, .18, 1.08);
}

.line-scale>div:nth-child(4) {
        -webkit-animation: line-scale 1s 0.4s infinite cubic-bezier(.2, .68, .18, 1.08);
        animation: line-scale 1s 0.4s infinite cubic-bezier(.2, .68, .18, 1.08);
}

.line-scale>div:nth-child(5) {
        -webkit-animation: line-scale 1s 0.5s infinite cubic-bezier(.2, .68, .18, 1.08);
        animation: line-scale 1s 0.5s infinite cubic-bezier(.2, .68, .18, 1.08);
}

.line-scale>div {
        background-color: #fff;
        width: 4px;
        height: 35px;
        border-radius: 2px;
        margin: 2px;
        -webkit-animation-fill-mode: both;
        animation-fill-mode: both;
        display: inline-block;
}

页面效果如下所示:
【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码),CSS,前端开发,web页面开发-源码demo,css,前端

3、完整28种特效获取方式

  • 网盘下载(第四章节有链接路径,可自行下载)

  • 留言获取(可以在博主的评论区留言,切记要留下邮箱哟,博主看到后第一时间发出)

4、源码下载区

1)百度网盘

链接:https://pan.baidu.com/s/1OSRhPOxonxWDlGxAN_0U1g
提取码:hdd6

2)123云盘

链接:https://www.123pan.com/s/ZxkUVv-V3I4.html
提取码:hdd6

3)邮箱留言

评论区留下您的邮箱账号,博主看到第一时间发给您,祝您生活愉快!


总结

以上就是今天要讲的内容,本文主要介绍了CSS3的特效应用,主要实现了CSS3实现多种加载中效果,CSS3实现28种加载动态效果,页面实现loading效果,好看的loading动态特效,也期待大家一起进步哈,2023年一起加油!!!

版权声明:此文原创于CSDN博主-《拄杖盲学轻声码》,主页有很多分享的代码,期待您的访问。文章来源地址https://www.toymoban.com/news/detail-552538.html

到了这里,关于【CSS加载动画特效】28种纯CSS实现的加载loading动态特效(附源码)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 纯css3实现小鸡从鸡蛋破壳而出动画特效

    实现一个使用纯css3实现小鸡破壳的效果 示例效果如下所示 实现这个小鸡破壳,使用css3,结合动画关键帧就可以实现,结合元素绝对定位,使用 div + css 进行绘制 当鼠标移上去时,实现蛋黄与蛋壳的分离,使用css3中的 transform ,变换,垂直反方向上,平移就可以实现 村民私自搭桥收费被

    2024年02月16日
    浏览(27)
  • 快六一啦,学习CSS3实现一个冰淇淋动画特效

    快六一啦,小时候顶多吃个小冰棍,或者是那种小冰袋,现在的小朋友真是好,动不动就能吃到冰淇淋,今天用CSS3实现一个冰淇淋的动画特效吧   目录 实现思路 桶身的实现 冰淇淋身体的实现 五彩颗粒的实现 HTML源码 CSS3源码 最后 实现思路 本文采用多DOM的方式进行布局,冰

    2024年02月06日
    浏览(27)
  • 看不上日全食了,学习CSS3,实现一个日全食的动画特效

    看新闻说,今年全球唯一一次日全食将于北京时间4月9日凌晨在北美洲地区上演。看来那边我是去不成了,日全食也看不见了,不过我可以用CSS3实现一个日全食的动画特效。一起来看一下吧。   目录 1. 实现思路 2. 天空的生成已经渐变 3 太阳的生成以及渐变 4 月亮的生成以及

    2024年04月09日
    浏览(30)
  • CSS3实现动画加载效果

    2024年02月07日
    浏览(36)
  • 轻松掌握 CSS,实现 loading 加载中的多种形式

    现如今网页越来越趋近于动画,相信大家平时浏览网页或多或少都能看到一些动画效果,今天我们来做一个有意思的动画效果,纯 css 实现 loading 加载中(多种展现形式),下面一起看看吧。 实现效果 代码如下 实现效果 代码如下 实现效果 代码如下 实现效果 代码如下 实现

    2024年04月24日
    浏览(25)
  • 19.CSS雨云动画特效

    2024年02月10日
    浏览(23)
  • css之文字连续光影特效、动画、scss

    2024年02月10日
    浏览(25)
  • elementui 自定义loading动画加载层

    elementui 自定义loading动画加载层。 main.js中添加 使用: element官网: Loading 还可以以服务的方式调用。引入 Loading 服务: import { Loading } from ‘element-ui’ 在需要调用时: Loading.service(options); 其中 options 参数为 Loading 的配置项,具体见下表。LoadingService 会返回一个 Loading 实例,可通

    2024年02月09日
    浏览(28)
  • vue element-ui Loading加载事件的使用以及自定义Loading加载动画

     elemen-ui官方使用 loading加载事件属性解释 element-loading-text 在绑定了 v-loading 指令的元素上添加 element-loading-text 属性,其值会被渲染为加载文案,并显示在加载图标的下方 element-loading-spinner 和 element-loading-background 属性分别用来设定图标类名和背景色值。 作为小白,这次主要

    2024年02月11日
    浏览(32)
  • CSS3模拟小仓鼠一直奔跑的动画特效

    最近在丽泽桥的花鸟虫鱼市场看见 小仓鼠一直在奔跑 ,觉得它好累啊,但是却又乐此不疲的在跑着,就像我们这些打工族一样。之前见过有人把手机放在小仓鼠的滚轮上记步数,也是挺聪明的。今天就通过 CSS3 来实现一只一直奔跑着的小仓鼠。   目录 1. 实现思路 2.  圆圈的

    2023年04月09日
    浏览(66)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包