新增第95个小实例:纯CSS实现冒泡loading动画
This commit is contained in:
parent
61b3a79e80
commit
136610ab0a
|
@ -98,4 +98,5 @@
|
|||
91. HTML5+CSS3小实例:旋转的炫光心形loading动画
|
||||
92. HTML5+CSS3小实例:全屏搜索栏
|
||||
93. HTML5+CSS3小实例:四色小球的loading动画
|
||||
94. HTML5+CSS3小实例:悬停翻转的3D卡片
|
||||
94. HTML5+CSS3小实例:悬停翻转的3D卡片
|
||||
95. HTML5+CSS3小实例:纯CSS实现冒泡loading动画
|
|
@ -0,0 +1,77 @@
|
|||
*{
|
||||
/* 初始化 */
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body{
|
||||
/* 100%窗口高度 */
|
||||
height: 100vh;
|
||||
/* 弹性布局 水平+垂直居中 */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #333;
|
||||
}
|
||||
.loader{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.loader .box{
|
||||
/* 相对定位 */
|
||||
position: relative;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
/* 执行动画 */
|
||||
animation: rotateBox 10s linear infinite;
|
||||
}
|
||||
.loader .box .circle{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f5e866;
|
||||
border-radius: 50%;
|
||||
/* 执行动画:动画名 时长 线性的 无限次播放 */
|
||||
animation: animate 5s linear infinite;
|
||||
}
|
||||
.loader .box .circle:nth-child(2){
|
||||
background-color: #a08fd5;
|
||||
/* 设置第二个圆的动画延迟时间 */
|
||||
animation-delay: -2.5s;
|
||||
}
|
||||
.loader span{
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
margin-top: 30px;
|
||||
letter-spacing: 4px;
|
||||
}
|
||||
|
||||
/* 定义动画 */
|
||||
@keyframes animate {
|
||||
0%{
|
||||
transform: scale(1);
|
||||
transform-origin: left;
|
||||
}
|
||||
50%{
|
||||
transform: scale(0);
|
||||
transform-origin: left;
|
||||
}
|
||||
50.01%{
|
||||
transform: scale(0);
|
||||
transform-origin: right;
|
||||
}
|
||||
100%{
|
||||
transform: scale(1);
|
||||
transform-origin: right;
|
||||
}
|
||||
}
|
||||
/* 加个旋转动画 */
|
||||
@keyframes rotateBox {
|
||||
to{
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
|
||||
|
||||
<title>纯CSS实现冒泡loading动画</title>
|
||||
<link rel="stylesheet" href="../css/95.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="loader">
|
||||
<div class="box">
|
||||
<div class="circle"></div>
|
||||
<div class="circle"></div>
|
||||
</div>
|
||||
<span>Loading...</span>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue