新增第138个小实例:月步式的loading加载动画
This commit is contained in:
parent
3c43a47745
commit
c5675b5e05
|
@ -144,4 +144,5 @@
|
|||
134. HTML5+CSS3小实例:简单又别致的环形加载动画
|
||||
135. HTML5+CSS3+Vue小实例:左侧分类菜单右侧轮播图的组合布局
|
||||
136. HTML5+CSS3小实例:萌翻少女心的发光果冻泡泡
|
||||
137. HTML5+CSS3+Vue小实例:仿制腾讯视频的轮播图
|
||||
137. HTML5+CSS3+Vue小实例:仿制腾讯视频的轮播图
|
||||
138. HTML5+CSS3小实例:月步式的loading加载动画
|
|
@ -0,0 +1,54 @@
|
|||
*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body{
|
||||
/* 100%窗口高度 */
|
||||
height: 100vh;
|
||||
/* 弹性布局 居中显示 */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
/* 渐变背景 */
|
||||
background: linear-gradient(to top,#1e3c72,#2a5298);
|
||||
}
|
||||
.loader{
|
||||
width: 125px;
|
||||
/* 相对定位 */
|
||||
position: relative;
|
||||
/* 设置视距 */
|
||||
perspective: 200px;
|
||||
}
|
||||
.loader::before,
|
||||
.loader::after{
|
||||
content: "";
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
/* 默认透明背景色 */
|
||||
background-color: transparent;
|
||||
/* 绝对定位 */
|
||||
position: absolute;
|
||||
/* 执行动画:动画名 时长 慢速开始慢速结束中间加快 无限次播放 来回轮流 */
|
||||
animation: jumping 0.5s ease infinite alternate;
|
||||
}
|
||||
.loader::before{
|
||||
left: 0;
|
||||
}
|
||||
.loader::after{
|
||||
right: 0;
|
||||
/* 这一个设置动画延迟 */
|
||||
animation-delay: 0.15s;
|
||||
}
|
||||
|
||||
/* 定义动画 */
|
||||
@keyframes jumping {
|
||||
0%{
|
||||
transform: scale(1) translateY(0) rotateX(0);
|
||||
box-shadow: 0 0 0 transparent;
|
||||
}
|
||||
100%{
|
||||
background-color: #fff;
|
||||
transform: scale(1.2) translateY(-55px) rotateX(45deg);
|
||||
box-shadow: 0 55px 100px #fff;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<!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>月步式的loading加载动画</title>
|
||||
<link rel="stylesheet" href="138.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="loader"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue