html制作加载动画,用CSS制作Loading加载动画【第一期】

随着我们对CSS3的熟悉,使用CSS制作Loading加载动画的童鞋越来越多。看到CSS3越来越火爆,小编也按捺不住了!准备把一些华丽的加载动画与大家一起分享。这次,小编汇集了8个简洁清爽的基础Loading加载动画。在今后的日子里,小编将会发布更多不同类型的Loading加载动画供大家参考。如果你喜欢以下的内容,请您持续关注《用CSS制作Loading加载动画》系列。

经典加载条

AAffA0nNPuCLAAAAAElFTkSuQmCC

HTML

CSS

.bar {

width: 100%;

height: 20px;

border: 1px solid #2980b9;

border-radius: 3px;

background-image:

repeating-linear-gradient(

-45deg,

#2980b9,

#2980b9 11px,

#eee 10px,

#eee 20px /* determines size */

);

background-size: 28px 28px;

animation: move .5s linear infinite;

}

@keyframes move {

0% {

background-position: 0 0;

}

100% {

background-position: 28px 0;

}

}

Win8 风格

AAffA0nNPuCLAAAAAElFTkSuQmCC

HTML

CSS

.spinner {

width: 60px;

height: 60px;

margin: 60px;

animation: rotate 1.4s infinite ease-in-out, background 1.4s infinite ease-in-out alternate;

}

@keyframes rotate {

0% {

transform: perspective(120px) rotateX(0deg) rotateY(0deg);

}

50% {

transform: perspective(120px) rotateX(-180deg) rotateY(0deg);

}

100% {

transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);

}

}

@keyframes background {

0% {

background-color: #27ae60;

}

50% {

background-color: #9b59b6;

}

100% {

background-color: #c0392b;

}

}

彩虹空心圆

AAffA0nNPuCLAAAAAElFTkSuQmCC

HTML

CSS

html, body { height: 100%; }

body {

display: flex;

align-items: center;

justify-content: center;

}

$offset: 187;

$duration: 1.4s;

.spinner {

animation: rotator $duration linear infinite;

}

@keyframes rotator {

0% { transform: rotate(0deg); }

100% { transform: rotate(270deg); }

}

.path {

stroke-dasharray: $offset;

stroke-dashoffset: 0;

transform-origin: center;

animation:

dash $duration ease-in-out infinite,

colors ($duration*4) ease-in-out infinite;

}

@keyframes colors {

0% { stroke: #4285F4; }

25% { stroke: #DE3E35; }

50% { stroke: #F7C223; }

75% { stroke: #1B9A59; }

100% { stroke: #4285F4; }

}

@keyframes dash {

0% { stroke-dashoffset: $offset; }

50% {

stroke-dashoffset: $offset/4;

transform:rotate(135deg);

}

100% {

stroke-dashoffset: $offset;

transform:rotate(450deg);

}

}

空心圆渐变

AAffA0nNPuCLAAAAAElFTkSuQmCC

HTML

CSS

.signal {

border: 5px solid #333;

border-radius: 30px;

height: 30px;

left: 50%;

margin: -15px 0 0 -15px;

opacity: 0;

position: absolute;

top: 50%;

width: 30px;

animation: pulsate 1s ease-out;

animation-iteration-count: infinite;

}

@keyframes pulsate {

0% {

transform: scale(.1);

opacity: 0.0;

}

50% {

opacity: 1;

}

100% {

transform: scale(1.2);

opacity: 0;

}

}

复古风格加载条

AAffA0nNPuCLAAAAAElFTkSuQmCC

HTML

CSS

html, body {

margin: 0;

height: 100%;

position: relative;

}

#wrapper {

width: 200px;

height: 20px;

position: absolute;

top: 50%;

left: 50%;

}

#border {

border: 3px solid #222;

height: 100%;

width: 100%;

position: relative;

left: -50%;

top: -50%;

padding: 4px 3px;

}

#whitespace {

overflow: hidden;

height: 100%;

width: 100%;

margin: 0 auto;

overflow: hidden;

position: relative;

}

#line {

position: absolute;

height: 100%;

width: 100%;

background-color: black;

-webkit-animation: slide 5s steps(40) infinite;

-moz-animation: slide 5s steps(40) infinite;

animation: slide 5s steps(40) infinite;

}

@keyframes slide {

0% {

left: -100%; }

100% {

left: 100%; }

}

@-moz-keyframes slide {

0% {

left: -100%; }

100% {

left: 100%; }

}

@-webkit-keyframes slide {

0% {

left: -100%;}

100% {

left: 100%; }

}

彩色律动

AAffA0nNPuCLAAAAAElFTkSuQmCC

HTML

CSS

.loading {

position: absolute;

top: 50%;

left: 50%;}

.loading-bar {

display: inline-block;

width: 4px;

height: 18px;

border-radius: 4px;

animation: loading 1s ease-in-out infinite;}

.loading-bar:nth-child(1) {

background-color: #3498db;

animation-delay: 0;}

.loading-bar:nth-child(2) {

background-color: #c0392b;

animation-delay: 0.09s;}

.loading-bar:nth-child(3) {

background-color: #f1c40f;

animation-delay: .18s;}

.loading-bar:nth-child(4) {

background-color: #27ae60;

animation-delay: .27s;}

@keyframes loading {

0% {

transform: scale(1); }

20% {

transform: scale(1, 2.2); }

40% {

transform: scale(1);}

}

三维加载标

AAffA0nNPuCLAAAAAElFTkSuQmCC

HTML

CSS

@import "compass/css3";

.container{

transform-style:preserve-3d;

transform:rotateX(-45deg);

}

.loader {

width: 100px;

height:100px;

margin: 100px auto;

transform-style:preserve-3d;

animation-duration: 5s;

animation-timing-function: linear;

animation-iteration-count: infinite;

animation-name: rotate;

border-radius:100px;

background:rgba(0,0,0,.025);

}

.dot {

width: 20px;

height: 20px;

top:40px;

lefT:40px;

border-radius: 20px;

background: #333;

position: absolute;

animation-duration: 1s;

animation-iteration-count: infinite;

animation-timing-function: ease-in-out;

opacity:.1;

}

@for $i from 1 through 8 {

.dot#{$i} { transform:rotate($i*45deg) translate3d(0px,-40px,20px) rotateX(-35deg);}

.dot#{$i} { animation-name: flash; animation-delay:$i*.125s;};

}

@keyframes rotate {

from{ transform: rotateY(0deg) rotateX(90deg); }

to { transform: rotateY(-360deg) rotateX(90deg);}

}

@keyframes flash {

from { opacity:.8 }

to { opacity:.1}

}

绿磨盘

AAffA0nNPuCLAAAAAElFTkSuQmCC

HTML

CSS

.spinner {

box-sizing: border-box;

height: 60px;

width: 60px;

margin: 80px;

border: 0px solid #27ae60;

border-radius: 50%;

box-shadow: 0 -20px 0 24px #27ae60 inset;

animation: rotate 1s infinite linear;

}

@keyframes rotate {

0% {

transform: rotate(0deg);

}

100% {

transform: rotate(360deg);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值