這是一個純CSS實作的Loading特效,由5個圓圈跳躍組成。這個特效使用了CSS的animation屬性,通過動态變化來實作圓圈的跳躍效果。同時,這個特效的實作沒有用到任何JavaScript,可以有效地提升網站的性能。
這個特效的設計非常巧妙,5個圓圈跳躍的交錯節奏感很強,能夠為使用者提供一個愉悅的等待體驗。整個特效的視覺效果非常出色,能夠為網站增添一些活力和趣味性。如果您正在尋找一個簡單而美觀的加載動畫,那麼這個純CSS實作的排隊跳躍的Loading特效一定會是一個不錯的選擇。
希望這個特效能夠為您的網站增添一些活力和趣味性!
<div class="loading">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<style>
.loading,
.loading > div {
position: relative;
box-sizing: border-box;
}
.loading {
display: block;
font-size: 0;
color: #000;
}
.loading.la-dark {
color: #333;
}
.loading > div {
display: inline-block;
float: none;
background-color: currentColor;
border: 0 solid currentColor;
}
.loading {
width: 10px;
height: 10px;
}
.loading > div {
position: absolute;
width: 10px;
height: 10px;
margin-left: -25px;
border-radius: 100%;
animation: ball-running-dots-animate 2s linear infinite;
}
.loading > div:nth-child(1) {
animation-delay: 0s;
}
.loading > div:nth-child(2) {
animation-delay: -0.4s;
}
.loading > div:nth-child(3) {
animation-delay: -0.8s;
}
.loading > div:nth-child(4) {
animation-delay: -1.2s;
}
.loading > div:nth-child(5) {
animation-delay: -1.6s;
}
.loading > div:nth-child(6) {
animation-delay: -2s;
}
.loading > div:nth-child(7) {
animation-delay: -2.4s;
}
.loading > div:nth-child(8) {
animation-delay: -2.8s;
}
.loading > div:nth-child(9) {
animation-delay: -3.2s;
}
.loading > div:nth-child(10) {
animation-delay: -3.6s;
}
.loading.la-sm {
width: 4px;
height: 4px;
}
.loading.la-sm > div {
width: 4px;
height: 4px;
margin-left: -12px;
}
.loading.la-2x {
width: 20px;
height: 20px;
}
.loading.la-2x > div {
width: 20px;
height: 20px;
margin-left: -50px;
}
.loading.la-3x {
width: 30px;
height: 30px;
}
.loading.la-3x > div {
width: 30px;
height: 30px;
margin-left: -75px;
}
@keyframes ball-running-dots-animate {
0%,
100% {
width: 100%;
height: 100%;
transform: translateY(0) translateX(500%);
}
80% {
transform: translateY(0) translateX(0);
}
85% {
width: 100%;
height: 100%;
transform: translateY(-125%) translateX(0);
}
90% {
width: 200%;
height: 75%;
}
95% {
width: 100%;
height: 100%;
transform: translateY(-100%) translateX(500%);
}
}
</style>