loading动画特效小结


Posted in Javascript onJanuary 22, 2017

话不多说,请看代码

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>lodading动画效果上</title>
 <link rel="stylesheet" href="style.css"/>
 <style>
 .box{
 width: 100%;
 padding:3%;
 box-sizing: border-box;
 overflow: hidden;
 }
 .box .loader{
 width: 30%;
 float: left;
 height: 200px;
 margin-right: 3%;
 border:1px #ccc solid;
 box-sizing: border-box;
 display: flex; 
 align-content: center; 
 justify-content: center; 
 position: relative;
 }
 .box .loading {
 position: absolute;
 top: 50px;
 }
 @-webkit-keyframes loading-1{
 0%{
 transform: rotate(0deg);
 }
 50%{
 transform: rotate(180deg);
 }
 100%{
 transform: rotate(360deg);
 }
 }
 .demo-1 .loading{
 width: 35px;
 height: 35px;
 position: relative;
 }
 .demo-1 .loading i{
 display: block;
 width: 100%;
 height: 100%;
 border-radius:50%;
 background: linear-gradient(transparent 0%, transparent 70%, #333 30% ,#333 100%);
 -webkit-animation: loading-1 .6s linear 0s infinite;
 }
 @-webkit-keyframes loading-2{
 0%{
 transform: scaleY(1);
 }
 50%{
 transform: scaleY(0.4);
 }
 100%{
 transform: scaleY(1);
 }
 }
 .demo-2 .loading i{
 display: inline-block;
 width: 4px;
 height: 35px;
 border-radius: 2px;
 margin:0 2px;
 background-color: #333;
 }
 .demo-2 .loading i:nth-child(1){
 -webkit-animation:loading-2 1s ease-in .1s infinite;
 }
 .demo-2 .loading i:nth-child(2){
 -webkit-animation:loading-2 1s ease-in .2s infinite;
 }
 .demo-2 .loading i:nth-child(3){
 -webkit-animation:loading-2 1s ease-in .3s infinite;
 }
 .demo-2 .loading i:nth-child(4){
 -webkit-animation:loading-2 1s ease-in .4s infinite;
 }
 .demo-2 .loading i:nth-child(5){
 -webkit-animation:loading-2 1s ease-in .5s infinite;
 }
 .demo-3 .loading{
 position: relative;
 }
 .demo-3 .loading i{
 display: block;
 width: 15px;
 height: 15px;
 border-radius: 50%;
 background-color: #333;
 position: absolute;
 }
 .demo-3 .loading i:nth-child(1){
 top: 25px;
 left: 0;
 -webkit-animation:loading-3 1s ease 0s infinite;
 }
 .demo-3 .loading i:nth-child(2){
 top: 17px;
 left: 17px;
 -webkit-animation:loading-3 1s ease -0.12s infinite;
 }
 .demo-3 .loading i:nth-child(3){
 top: 0px;
 left: 25px;
 -webkit-animation:loading-3 1s ease -0.24s infinite;
 }
 .demo-3 .loading i:nth-child(4){
 top: -17px;
 left: 17px;
 -webkit-animation:loading-3 1s ease -0.36s infinite;
 }
 .demo-3 .loading i:nth-child(5){
 top: -25px;
 left: 0;
 -webkit-animation:loading-3 1s ease -0.48s infinite;
 }
 .demo-3 .loading i:nth-child(6){
 top: -17px;
 left: -17px;
 -webkit-animation:loading-3 1s ease -0.6s infinite;
 }
 .demo-3 .loading i:nth-child(7){
 top: 0px;
 left: -25px;
 -webkit-animation:loading-3 1s ease -0.72s infinite;
 }
 .demo-3 .loading i:nth-child(8){
 top: 17px;
 left: -17px;
 -webkit-animation:loading-3 1s ease -0.84s infinite;
 }
 @-webkit-keyframes loading-3{
 50%{
 transform: scale(0.4);
 opacity: .3
 }
 100%{
 transform: scale(1);
 opacity: 1
 }
 }
 @-webkit-keyframes loading-4{
 0%{
 transform: scale(0);
 opacity: 0;
 }
 1%{
 opacity: 1;
 }
 100%{
 transform: scale(1);
 opacity: 0;
 }
 }
 .demo-4 .loading i:nth-child(1){
 -webkit-animation:loading-4 1s linear 0s infinite;
 }
 .demo-4 .loading i:nth-child(2){
 -webkit-animation:loading-4 1s linear 0.2s infinite;
 }
 .demo-4 .loading i:nth-child(3){
 -webkit-animation:loading-4 1s linear 0.4s infinite;
 }
 .demo-4 .loading{
 width: 60px;
 height: 60px;
 position: relative;
 }
 .demo-4 .loading i{
 display: block;
 width: 60px;
 height: 60px;
 border-radius: 50%;
 background-color: #333;
 position: absolute;
 left: 0;
 top: 0;
 opacity: 0;
 }
 .demo-5 .loading{
 width: 40px;
 height: 40px;
 position: relative;
 }
 .demo-5 .loading i{
 display: block;
 border:2px solid #333;
 border-color: transparent #333;
 border-radius: 50%;
 position: absolute;
 }
 .demo-5 .loading i:first-child{
 width: 35px;
 height: 35px;
 top:0px;
 left: 0px;
 -webkit-animation:loading-5 1s ease-in-out 0s infinite;
 }
 .demo-5 .loading i:last-child{
 width: 15px;
 height: 15px;
 top:10px;
 left: 10px;
 -webkit-animation:loading-5 1s ease-in-out 0.5s infinite reverse;
 }
 @-webkit-keyframes loading-5{
 0%{
 transform: rotate(0deg) scale(1);
 }
 50%{
 transform: rotate(180deg) scale(0.6);
 }
 100%{
 transform: rotate(360deg) scale(1);
 }
 }
 .demo-6 .loading{
 width: 80px;
 height: 20px;
 position: relative;
 }
 .demo-6 .loading i{
 display: block;
 width: 20px;
 height: 20px;
 border-radius: 50%;
 background-color: #333;
 margin-right: 10px;
 position: absolute;
 }
 @-webkit-keyframes loading-6{
 0%{
 left: 100px;
 top: 0;
 }
 80%{
 left: 0;
 top: 0;
 }
 85%{
 left: 0;
 top: -20px;
 width: 20px;
 height: 20px;
 }
 90%{
 width: 40px;
 height: 20px;
 }
 95%{
 left: 100px;
 top: -20px;
 width: 20px;
 height: 20px;
 }
 100%{
 left: 100px;
 top: 0;
 }
 }
 .demo-6 .loading i:nth-child(1){
 -webkit-animation:loading-6 2s linear 0s infinite;
 }
 .demo-6 .loading i:nth-child(2){
 -webkit-animation:loading-6 2s linear -0.4s infinite;
 }
 .demo-6 .loading i:nth-child(3){
 -webkit-animation:loading-6 2s linear -0.8s infinite;
 }
 .demo-6 .loading i:nth-child(4){
 -webkit-animation:loading-6 2s linear -1.2s infinite;
 }
 .demo-6 .loading i:nth-child(5){
 -webkit-animation:loading-6 2s linear -1.6s infinite;
 }
 .demo-7 .loading i {
 background-color: #777;
 border-radius: 2px;
 margin: 2px;
 -webkit-animation-fill-mode: both;
 animation-fill-mode: both;
 position: absolute;
 width: 5px;
 height: 15px;
 }
 .demo-7 .loading-1 {
 top: 20px;
 left: 0;
 -webkit-animation: loading 1.2s 0.12s infinite ease-in-out;
 -moz-animation: loading 1.2s 0.12s infinite ease-in-out;
 -ms-animation: loading 1.2s 0.12s infinite ease-in-out;
 -o-animation: loading 1.2s 0.12s infinite ease-in-out;
 animation: loading 1.2s 0.12s infinite ease-in-out;
 }
 .demo-7 .loading-2 {
 top: 13.63636px;
 left: 13.63636px;
 -webkit-transform: rotate(-45deg);
 -moz-transform: rotate(-45deg);
 -ms-transform: rotate(-45deg);
 -o-transform: rotate(-45deg);
 transform: rotate(-45deg);
 -webkit-animation: loading 1.2s 0.24s infinite ease-in-out;
 -moz-animation: loading 1.2s 0.24s infinite ease-in-out;
 -ms-animation: loading 1.2s 0.24s infinite ease-in-out;
 -o-animation: loading 1.2s 0.24s infinite ease-in-out;
 animation: loading 1.2s 0.24s infinite ease-in-out;
 }
 .demo-7 .loading-3 {
 top: 0;
 left: 20px;
 -webkit-transform: rotate(90deg);
 -moz-transform: rotate(90deg);
 -ms-transform: rotate(90deg);
 -o-transform: rotate(90deg);
 transform: rotate(90deg);
 -webkit-animation: loading 1.2s 0.36s infinite ease-in-out;
 -moz-animation: loading 1.2s 0.36s infinite ease-in-out;
 -ms-animation: loading 1.2s 0.36s infinite ease-in-out;
 -o-animation: loading 1.2s 0.36s infinite ease-in-out;
 animation: loading 1.2s 0.36s infinite ease-in-out;
 }
 .demo-7 .loading-4 {
 top: -13.63636px;
 left: 13.63636px;
 -webkit-transform: rotate(45deg);
 -moz-transform: rotate(45deg);
 -ms-transform: rotate(45deg);
 -o-transform: rotate(45deg);
 transform: rotate(45deg);
 -webkit-animation: loading 1.2s 0.48s infinite ease-in-out;
 -moz-animation: loading 1.2s 0.48s infinite ease-in-out;
 -ms-animation: loading 1.2s 0.48s infinite ease-in-out;
 -o-animation: loading 1.2s 0.48s infinite ease-in-out;
 animation: loading 1.2s 0.48s infinite ease-in-out;
 }
 .demo-7 .loading-5 {
 top: -20px;
 left: 0;
 -webkit-animation: loading 1.2s 0.6s infinite ease-in-out;
 -moz-animation: loading 1.2s 0.6s infinite ease-in-out;
 -ms-animation: loading 1.2s 0.6s infinite ease-in-out;
 -o-animation: loading 1.2s 0.6s infinite ease-in-out;
 animation: loading 1.2s 0.6s infinite ease-in-out;
 }
 .demo-7 .loading-6 {
 top: -13.63636px;
 left: -13.63636px;
 -webkit-transform: rotate(-45deg);
 -moz-transform: rotate(-45deg);
 -ms-transform: rotate(-45deg);
 -o-transform: rotate(-45deg);
 transform: rotate(-45deg);
 -webkit-animation: loading 1.2s 0.72s infinite ease-in-out;
 -moz-animation: loading 1.2s 0.72s infinite ease-in-out;
 -ms-animation: loading 1.2s 0.72s infinite ease-in-out;
 -o-animation: loading 1.2s 0.72s infinite ease-in-out;
 animation: loading 1.2s 0.72s infinite ease-in-out;
 }
 .demo-7 .loading-7 {
 top: 0;
 left: -20px;
 -webkit-transform: rotate(90deg);
 -moz-transform: rotate(90deg);
 -ms-transform: rotate(90deg);
 -o-transform: rotate(90deg);
 transform: rotate(90deg);
 -webkit-animation: loading 1.2s 0.84s infinite ease-in-out;
 -moz-animation: loading 1.2s 0.84s infinite ease-in-out;
 -ms-animation: loading 1.2s 0.84s infinite ease-in-out;
 -o-animation: loading 1.2s 0.84s infinite ease-in-out;
 animation: loading 1.2s 0.84s infinite ease-in-out;
 }
 .demo-7 .loading-8 {
 top: 13.63636px;
 left: -13.63636px;
 -webkit-transform: rotate(45deg);
 -moz-transform: rotate(45deg);
 -ms-transform: rotate(45deg);
 -o-transform: rotate(45deg);
 transform: rotate(45deg);
 -webkit-animation: loading 1.2s 0.96s infinite ease-in-out;
 -moz-animation: loading 1.2s 0.96s infinite ease-in-out;
 -ms-animation: loading 1.2s 0.96s infinite ease-in-out;
 -o-animation: loading 1.2s 0.96s infinite ease-in-out;
 animation: loading 1.2s 0.96s infinite ease-in-out;
 }
 @-webkit-keyframes loading {
 50% {
  opacity: 0.3;
 }
 100% {
  opacity: 1;
 }
 }
 @-moz-keyframes loading {
 50% {
 opacity: 0.3;
 }
 100% {
 opacity: 1;
 }
 }
 @-ms-keyframes loading {
 50% {
 opacity: 0.3;
 }
 100% {
 opacity: 1;
 }
 }
 @-o-keyframes loading {
 50% {
 opacity: 0.3;
 }
 100% {
 opacity: 1;
 }
 }
 @keyframes loading {
 50% {
  opacity: 0.3;
 }
 100% {
  opacity: 1;
 }
 } 
 </style>
</head>
<body>
 <div class="box">
 <div class="loader demo-1">
 <div class="loading">
 <i></i>
 </div>
 </div>
 <div class="loader demo-2">
 <div class="loading">
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 </div>
 </div>
 <div class="loader demo-3">
 <div class="loading">
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 </div>
 </div>
 <div class="loader demo-4">
 <div class="loading">
 <i></i>
 <i></i>
 <i></i>
 </div>
 </div>
 <div class="loader demo-5">
 <div class="loading">
 <i></i>
 <i></i>
 </div>
 </div>
 <div class="loader demo-6">
 <div class="loading">
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 <i></i>
 </div>
 </div>
 <div class="loader demo-7">
 <div class="loading">
 <i class="loading-1"></i>
 <i class="loading-2"></i>
 <i class="loading-3"></i>
 <i class="loading-4"></i>
 <i class="loading-5"></i>
 <i class="loading-6"></i>
 <i class="loading-7"></i>
 <i class="loading-8"></i>
 </div>
 </div> 
 </div>
</body>
</html>

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持三水点靠木!

Javascript 相关文章推荐
6个DIV 135或246间隔一秒轮番显示效果
Jul 24 Javascript
当jQuery遭遇CoffeeScript的时候 使用分享
Sep 17 Javascript
javascript在子页面中函数无法调试问题解决方法
Jan 17 Javascript
js实现跨域的方法实例详解
Jun 24 Javascript
JS实现不使用图片仿Windows右键菜单效果代码
Oct 22 Javascript
Avalon中文长字符截取、关键字符隐藏、自定义过滤器
May 18 Javascript
js,jq,css多方面实现简易下拉菜单功能
May 13 Javascript
微信小程序picker组件简单用法示例【附demo源码下载】
Dec 05 Javascript
webpack 单独打包指定JS文件的方法
Feb 22 Javascript
浅谈JavaScript面向对象--继承
Mar 20 Javascript
vue组件中watch props根据v-if动态判断并挂载DOM的问题
May 12 Javascript
js实现简易计算器功能
Oct 18 Javascript
全面总结Javascript对数组对象的各种操作
Jan 22 #Javascript
通过jsonp获取json数据实现AJAX跨域请求
Jan 22 #Javascript
JS实现点击表头表格自动排序(含数字、字符串、日期)
Jan 22 #Javascript
node.js基于mongodb的搜索分页示例
Jan 22 #Javascript
利用JS实现文字的聚合动画效果
Jan 22 #Javascript
angularJS 指令封装回到顶部示例详解
Jan 22 #Javascript
jQuery实现的分页功能示例
Jan 22 #Javascript
You might like
基于PHP读取TXT文件向数据库导入海量数据的方法
2013/04/23 PHP
如何在php中正确的使用json
2013/08/06 PHP
Laravel 队列使用的实现
2019/01/08 PHP
PHP判断访客是否手机端(移动端浏览器)访问的方法总结【4种方法】
2019/03/27 PHP
jQuery插件-jRating评分插件源码分析及使用方法
2012/12/28 Javascript
jquery实现图片渐变切换兼容ie6/Chrome/Firefox
2013/08/02 Javascript
css样式标签和js语法属性区别
2013/11/06 Javascript
Javascript浮点数乘积运算出现多位小数的解决方法
2014/02/17 Javascript
一个jquery实现的不错的多行文字图片滚动效果
2014/09/28 Javascript
详解Javascript模板引擎mustache.js
2016/01/20 Javascript
jQuery+css实现炫目的动态块漂移效果
2016/01/28 Javascript
解决ajax不能访问本地文件问题(利用js跨域原理)
2017/01/24 Javascript
jQuery插件HighCharts实现气泡图效果示例【附demo源码】
2017/03/13 Javascript
JsChart组件使用详解
2018/03/04 Javascript
解决Vue.js 2.0 有时双向绑定img src属性失败的问题
2018/03/14 Javascript
解决Layui数据表格中checkbox位置不居中的方法
2018/08/15 Javascript
微信小程序中this.data与this.setData的区别详解
2018/09/17 Javascript
Vue唯一可以更改vuex实例中state数据状态的属性对象Mutation的讲解
2019/01/18 Javascript
Python语言实现获取主机名根据端口杀死进程
2016/03/31 Python
python二分查找算法的递归实现方法
2016/05/12 Python
200行自定义python异步非阻塞Web框架
2017/03/15 Python
Python中property函数用法实例分析
2018/06/04 Python
pygame实现烟雨蒙蒙下彩虹雨
2019/11/11 Python
Python 创建TCP服务器的方法
2020/07/28 Python
Python Serial串口基本操作(收发数据)
2020/11/06 Python
使用CSS3制作一个简单的Chrome模拟器
2015/07/15 HTML / CSS
网易微博Web App用HTML5开发的过程介绍
2012/06/13 HTML / CSS
公司联欢会策划方案
2014/05/19 职场文书
煤矿安全知识竞赛活动总结
2014/07/07 职场文书
整顿机关作风心得体会
2014/09/10 职场文书
第二批党的群众路线教育实践活动个人整改方案
2014/10/31 职场文书
5.12护士节活动总结
2015/02/10 职场文书
爱护公物主题班会
2015/08/17 职场文书
go:垃圾回收GC触发条件详解
2021/04/24 Golang
VS2019连接MySQL数据库的过程及常见问题总结
2021/11/27 MySQL
python语言中pandas字符串分割str.split()函数
2022/08/05 Python