• css3特效_CSS3弹跳Loading加载动画特效的实现


    今天给大家分享一款非常常用的css 加载动画,这款css3 Loading动画主要由几个小球通过规律的上下跳动,渐隐渐显而成,效果十分生动、流畅。兼容IE8以上,尤其适合在移动端中使用,基本代替了图片实现加载的效果。

    反弹加载动画效果如下:

     

    代码的实现:

    <div class="bouncing-loader">
      <div></div>
      <div></div>
      <div></div>
    </div>
    <style>
    	@keyframes bouncing-loader {
    	  from {
    	    opacity: 1;
    	    transform: translateY(0);
    	  }
    	  to {
    	    opacity: 0.1;
    	    transform: translateY(-1rem);
    	  }
    	}
    	.bouncing-loader {
    	  display: flex;
    	  justify-content: center;
    	}
    	.bouncing-loader > div {
    	   1rem;
    	  height: 1rem;
    	  margin: 3rem 0.2rem;
    	  background: #8385aa;
    	  border-radius: 50%;
    	  animation: bouncing-loader 0.6s infinite alternate;
    	}
    	.bouncing-loader > div:nth-child(2) {
    	  animation-delay: 0.2s;
    	}
    	.bouncing-loader > div:nth-child(3) {
    	  animation-delay: 0.4s;
    	}
    </style>
    

      

    字由https://www.wode007.com/sites/73248.html 中国字体设计网https://www.wode007.com/sites/73245.html

    说明:

    注:1rem 通常是16px 。 
    @keyframes定义了一个具有两种状态的动画,其中元素更改opacity并使用transform: translateY()在2D平面上进行transform: translateY() 。
    .bouncing-loader是弹跳圆圈的父容器,使用display: flex和justify-content: center将它们放置在中心位置。  
    .bouncing-loader > div ,将父级的三个子div作为样式。 div的宽度和高度为1rem ,使用border-radius: 50%将它们从正方形变成圆形。 
    margin: 3rem 0.2rem 指定每个圆的上边距/下边距为3rem 和左/右边距0.2rem 以便它们不直接接触对方,给它们一些呼吸空间。 
    animation是各种动画属性的缩写属性:使用animation-name , animation-duration , animation-iteration-count , animation-direction 。 nth-child(n)目标是其父元素的第n个子元素。 
    animation-delay分别用于第二个和第三个div ,以便每个元素不会同时启动动画。 
  • 相关阅读:
    IntelliJ IDEA-快捷键
    12-String类、static关键字、Arrays类、Math类
    11-API之Scanner类、Random类、ArrayList类
    C语言二叉树中序遍历——递归思想
    解决SQL Server数据库不同版本不能兼容使用的问题
    绿色版,免安装版和安装版的区别
    ScreenToGif 动图发送到手机上打开模糊
    eclipse中更改jsp默认编码
    sql重新不允许保存修改问题
    SQL因为重复行导致的问题
  • 原文地址:https://www.cnblogs.com/ypppt/p/13332867.html
Copyright © 2020-2023  润新知