模仿BOSS直聘loading效果
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>loading</title>
<style>
*{
margin: 0;
padding: 0;
}
.box{
display: grid;
place-content: center;
height: 100vh;
}
h1{
display: inline-block;
color: #ccc;
padding: 0 2px;
}
p{
color: #888;
text-align: center;
}
.jump1{
animation: jump 0.6s ease-in-out infinite;
}
.jump2{
animation: jump 0.6s ease-in-out 0.2s infinite;
}
.jump3{
animation: jump 0.6s ease-in-out 0.4s infinite;
}
.jump4{
animation: jump 0.6s ease-in-out 0.6s infinite;
}
@keyframes jump{
0%{
transform: translateY(0);
}
50%{
transform: translateY(-10px);
}
100%{
transform: translateY(0);
}
}
</style>
</head>
<body>
<div class="box">
<div>
<h1 class="jump1">B</h1>
<h1 class="jump2">O</h1>
<h1 class="jump3">S</h1>
<h1 class="jump4">S</h1>
</div>
<p>正在加载中...</p>
</div>
<script>
</script>
</body>
</html>
运行结果如下: