css代码:
body {
background:#1b1d1f;
display:flex;
justify-content:center;
align-items:center;
height:100vh;
padding:0;
margin:0
}
.loader-wrapper {
width:148px;
height:100px;
position:absolute
}
.loader {
width:148px;
height:100px;
top:0;
left:0;
position:absolute
}
.loader:after {
content:"";
top:auto;
position:absolute;
display:block;
animation:shadow 1.2s infinite linear;
-moz-animation:shadow 1.2s infinite linear;
bottom:0em;
left:0;
height:.25em;
width:1em;
border-radius:50%;
background-color:rgba(100,100,100,.5);
opacity:0.3
}
.roller,.roller:last-child {
width:70px;
height:70px;
position:absolute;
top:0;
left:0;
-webkit-animation:rollercoaster 1.2s infinite linear;
-webkit-transform:rotate(135deg);
-moz-animation:rollercoaster 1.2s infinite linear;
-moz-transform:rotate(135deg);
animation:rollercoaster 1.2s infinite linear;
transform:rotate(135deg)
}
.roller:last-child {
left:auto;
right:0;
-webkit-transform:rotate(-45deg);
-webkit-animation:rollercoaster2 1.2s infinite linear;
-moz-transform:rotate(-45deg);
-moz-animation:rollercoaster2 1.2s infinite linear;
transform:rotate(-45deg);
animation:rollercoaster2 1.2s infinite linear
}
.roller:before,.roller:last-child:before {
content:"";
display:block;
width:15px;
height:15px;
background:#f1404b;
border-radius:50%
}
.io-black-mode .loader:after {
background-color:rgba(130,130,130,.5)
}
@-webkit-keyframes rollercoaster {
0% {
-webkit-transform:rotate(135deg)
}
8% {
-webkit-transform:rotate(240deg)
}
20% {
-webkit-transform:rotate(300deg)
}
40% {
-webkit-transform:rotate(380deg)
}
45% {
-webkit-transform:rotate(440deg)
}
50% {
-webkit-transform:rotate(495deg);
opacity:1
}
50.1% {
-webkit-transform:rotate(495deg);
opacity:0
}
100% {
-webkit-transform:rotate(495deg);
opacity:0
}
}@-webkit-keyframes rollercoaster2 {
0% {
opacity:0
}
49.9% {
opacity:0
}
50% {
opacity:1;
-webkit-transform:rotate(-45deg)
}
58% {
-webkit-transform:rotate(-160deg)
}
70% {
-webkit-transform:rotate(-240deg)
}
80% {
-webkit-transform:rotate(-300deg)
}
90% {
-webkit-transform:rotate(-340deg)
}
100% {
-webkit-transform:rotate(-405deg)
}
}@-webkit-keyframes shadow {
0% {
opacity:.3;
-webkit-transform:translateX(65px) scale(0.5,0.5)
}
8% {
-webkit-transform:translateX(30px) scale(2,2)
}
13% {
-webkit-transform:translateX(0px) scale(1.3,1.3)
}
30% {
-webkit-transform:translateX(-15px) scale(0.5,0.5);
opacity:0.1
}
50% {
-webkit-transform:translateX(60px) scale(1.2,1.2);
opacity:0.3
}
60% {
-webkit-transform:translateX(130px) scale(2,2);
opacity:0.05
}
65% {
-webkit-transform:translateX(145px) scale(1.2,1.2)
}
80% {
-webkit-transform:translateX(120px) scale(0.5,0.5);
opacity:0.1
}
90% {
-webkit-transform:translateX(80px) scale(0.8,0.8)
}
100% {
-webkit-transform:translateX(60px);
opacity:0.3
}
}@-moz-keyframes rollercoaster {
0% {
-moz-transform:rotate(135deg)
}
8% {
-moz-transform:rotate(240deg)
}
20% {
-moz-transform:rotate(300deg)
}
40% {
-moz-transform:rotate(380deg)
}
45% {
-moz-transform:rotate(440deg)
}
50% {
-moz-transform:rotate(495deg);
opacity:1
}
50.1% {
-moz-transform:rotate(495deg);
opacity:0
}
100% {
-moz-transform:rotate(495deg);
opacity:0
}
}@-moz-keyframes rollercoaster2 {
0% {
opacity:0
}
49.9% {
opacity:0
}
50% {
opacity:1;
-moz-transform:rotate(-45deg)
}
58% {
-moz-transform:rotate(-160deg)
}
70% {
-moz-transform:rotate(-240deg)
}
80% {
-moz-transform:rotate(-300deg)
}
90% {
-moz-transform:rotate(-340deg)
}
100% {
-moz-transform:rotate(-405deg)
}
}@-moz-keyframes shadow {
0% {
opacity:.3;
-moz-transform:translateX(65px) scale(0.5,0.5)
}
8% {
-moz-transform:translateX(30px) scale(2,2)
}
13% {
-moz-transform:translateX(0px) scale(1.3,1.3)
}
30% {
-moz-transform:translateX(-15px) scale(0.5,0.5);
opacity:0.1
}
50% {
-moz-transform:translateX(60px) scale(1.2,1.2);
opacity:0.3
}
60% {
-moz-transform:translateX(130px) scale(2,2);
opacity:0.05
}
65% {
-moz-transform:translateX(145px) scale(1.2,1.2)
}
80% {
-moz-transform:translateX(120px) scale(0.5,0.5);
opacity:0.1
}
90% {
-moz-transform:translateX(80px) scale(0.8,0.8)
}
100% {
-moz-transform:translateX(60px);
opacity:0.3
}
}@keyframes rollercoaster {
0% {
transform:rotate(135deg)
}
8% {
transform:rotate(240deg)
}
20% {
transform:rotate(300deg)
}
40% {
transform:rotate(380deg)
}
45% {
transform:rotate(440deg)
}
50% {
transform:rotate(495deg);
opacity:1
}
50.1% {
transform:rotate(495deg);
opacity:0
}
100% {
transform:rotate(495deg);
opacity:0
}
}@keyframes rollercoaster2 {
0% {
opacity:0
}
49.9% {
opacity:0
}
50% {
opacity:1;
transform:rotate(-45deg)
}
58% {
transform:rotate(-160deg)
}
70% {
transform:rotate(-240deg)
}
80% {
transform:rotate(-300deg)
}
90% {
transform:rotate(-340deg)
}
100% {
transform:rotate(-405deg)
}
}@keyframes shadow {
0% {
opacity:.3;
transform:translateX(65px) scale(0.5,0.5)
}
8% {
transform:translateX(30px) scale(2,2)
}
13% {
transform:translateX(0px) scale(1.3,1.3)
}
30% {
transform:translateX(-15px) scale(0.5,0.5);
opacity:0.1
}
50% {
transform:translateX(60px) scale(1.2,1.2);
opacity:0.3
}
60% {
transform:translateX(130px) scale(2,2);
opacity:0.05
}
65% {
transform:translateX(145px) scale(1.2,1.2)
}
80% {
transform:translateX(120px) scale(0.5,0.5);
opacity:0.1
}
90% {
transform:translateX(80px) scale(0.8,0.8)
}
100% {
transform:translateX(60px);
opacity:0.3
}
}#loader2:after {
-webkit-animation-delay:0.15s;
animation-delay:0.15s
}
#loader2 .roller {
-webkit-animation-delay:0.15s;
animation-delay:0.15s
}
#loader3:after {
-webkit-animation-delay:0.3s;
animation-delay:0.3s
}
#loader3 .roller {
-webkit-animation-delay:0.3s;
animation-delay:0.3s
}
html代码:
<div id="loading">
<div class="loader-wrapper">
<div class="loader">
<div class="roller"></div>
<div class="roller"></div>
</div>
<div id="loader2" class="loader">
<div class="roller"></div>
<div class="roller"></div>
</div>
<div id="loader3" class="loader">
<div class="roller"></div>
<div class="roller"></div>
</div>
</div>
</div>
点击查看效果
以上是编程学习网小编为您介绍的“网站加载中loading..样式二代码介绍”的全面内容,想了解更多关于 前端知识 内容,请继续关注编程基础学习网。
沃梦达教程
本文标题为:网站加载中loading..样式二代码介绍
基础教程推荐
猜你喜欢
- layui 数据表格+分页+搜索+checkbox+缓存选中项数据 2022-12-13
- 用css3实现当鼠标移进去时当前亮其他变灰效果 2024-01-23
- JavaScript鼠标特效大全 2023-12-02
- JAVA使用Gson解析json数据实例解析 2024-02-07
- Javascript基础学习之十个重要问题 2023-08-12
- 通过Ajax方式绑定select选项数据的实例 2023-02-23
- div层调整z-index属性无效原因分析及解决方法 2024-03-11
- Jquery Ajax请求文件下载操作失败的原因分析及解决办法 2022-10-17
- 使用CSS 给表单必选项添加星号的实现方法 2024-03-12
- css实现气泡的小尖角效果 2024-03-31