css loading 圆圈,CSS 各种loading 实现

CSS3实现了几种常见的Loading效果,虽然很简单,但还是分享一下,对自己做个总结吧……

1:loading 简单实现(圆形闪烁)

afcbf1e11d15

.load{

width: 40px;

height: 40px;

border-radius: 50px;

background: red;

animation: fadeOut 1.0s infinite ease-in-out;

-webkit-animation: fadeOut 1.0s infinite ease-in-out;

}

@keyframes fadeOut {

from{transform: scale(0.0)}

to{transform: scale(1.0);opacity: 0}

}

@-webkit-keyframes  fadeOut{

from{transform: scale(0.0)}

to{transform: scale(1.0);opacity: 0}

}

2:线条波动效果

afcbf1e11d15

代码实现:(主要依赖 : animation-delay)

.box .lineload >div{

width: 3px;

height: 50px;

background: green;

animation: strechdeley 1.2s infinite ease-in-out;

-webkit-animation: strechdeley 1.2s infinite ease-in-out;;

margin-left: 3px;

}

.box .lineload .line1{

animation-delay: -1.1s;

}

.box .lineload .line2{

animation-delay: -1s;

}

.box .lineload .line3{

animation-delay: -0.9s;

}

.box .lineload .line4{

animation-delay: -0.8s;

}

.box .lineload .line5{

animation-delay: -0.7s;

}

@keyframes strechdeley{

0%,40%,100%{

transform: scale(0.4);

}

20%{

transform: scale(1.0);

}

}

@-webkit-keyframes  strechdeley{

0%,40%,100%{

-webkit-transform: scale(0.4);

}

20%{

-webkit-transform: scale(1.0);

}

html

3:圆环loading 旋转动画

afcbf1e11d15

@keyframes am-ringload {

from { transform: rotate(0deg)}

to{ transform: rotate(360deg)}

}

@-webkit-keyframes  am-ringload {

from { -webkit-transform: rotate(0deg)}

to{ -webkit-transform: rotate(360deg)}

}

.box .ringload {

width: 60px;

height: 60px;

background: black;

border: 5px solid #666666;

border-left-color:#ffffff ;

margin-left: 50px;

border-radius: 50%;

animation: am-ringload 1s infinite ease;

-webkit-animation: am-ringload 1s infinite ease;

}

4:使用1,2原理可实现省略号效果的loading ,自身尝试吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值