大数跨境
0
0

加载时的跳动动画(可复制源代码)

加载时的跳动动画(可复制源代码) 趣聊科技圈
2024-10-01
1

效果演示

html 代码

<link rel="stylesheet" href="index.css"><div class="wrap go">
    <div class="loader bar"> <!-- google now -->
      <div class="blue"></div>
      <div class="yellow"></div>
      <div class="green"></div>
      <div class="red"></div>
    </div>
    <div class="loader circle"> <!-- gmail -->
      <div class="blue"></div>
      <div class="red"></div>
      <div class="yellow"></div><div class="green"></div></div><div class="loader orbit"> <!-- moto360 boot screen --><div></div><div></div><div></div><div></div></div></div>

css 代码

* { padding0margin0box-sizing: inherit; }
html { font-size10px; }
body { box-sizing: border-box; background#f2f2f2; }
.red { background-color#D50F25; }
.yellow { background-color#EEB211; }
.green { background-color#009925; }
.blue { background-color#3369E8; }
.wrap { margin0 auto; line-height6remtext-align: center; }
.loader { position: absolute; margin0 auto 3rem auto; overflow: hidden; }
.loader > div { position: absolute; top0left0height100%width100%; }
.bar { width100%height: .5remtop0left0; }
.go .loader.bar > div { animation: loading-bar 2s infinite backwards ease-out; }
.bar > div { transformscaleX(1); }
.loader.bar div:nth-child(1) { animation-delay: -1.5s; }
.loader.bar div:nth-child(2) { animation-delay: -1s; }
.loader.bar div:nth-child(3) { animation-delay: -.5s; }
.loader.bar div:nth-child(4) { animation-delay0s; }
@keyframes loading-bar { 0% { transformscaleX(0); z-index15; } 22% { transformscaleX(0); z-index15; } 50% { transformscaleX(1); } 90% { transformscaleX(1); z-index1; } 100% { transformscaleX(1); z-index0; } }
.circle { height2remwidth2remborder-radius50%transformscale(1); top3remright3remmargin: auto; }
.circle > div { height100%width100%border-radius50%; }
.go .loader.circle > div { animation: loading-circle 2s infinite backwards ease-out; }
.loader.circle div:nth-child(1) { animation-delay: -1.5stransformtranslateX(-500%); }
.loader.circle div:nth-child(2) { animation-delay: -1stransformtranslateY(500%); }
.loader.circle div:nth-child(3) { animation-delay: -.5stransformtranslateX(500%); }
.loader.circle div:nth-child(4) { animation-delay0stransformtranslateY(-500%); }
@keyframes loading-circle { 0% { z-index10; } 75% { transformtranslateX(0); z-index1; } 100% { transformtranslateX(0); z-index0; } }
.orbit { height20remwidth20remtop0left0bottom0right0margin: auto; overflow: visible; background#111border-radius50%; }
.orbit > div { top2.5remleft2.5remfont-size1remheight15remwidth15remtransform-origin: center center; }
.orbit > div::before { position: absolute; leftcalc(50% - .5em); display: block; content''height1emwidth1emborder-radius50%transformscale(1); }
.orbit > div:nth-child(1)::before { background-color#3369E8; }
.orbit > div:nth-child(2)::before { background-color#D50F25; }
.orbit > div:nth-child(3)::before { background-color#009925; }
.orbit > div:nth-child(4)::before { background-color#EEB211; }
.go .loader.orbit > div { animation: loading-orbit 6s infinite linear; }
.go .loader.orbit > div::before { animation: loading-orbit-before 2s infinite ease-in-out; }
.loader.orbit > div:nth-child(1) { animation-delay0s; }
.loader.orbit > div:nth-child(2) { animation-delay: -.75s; }
.loader.orbit > div:nth-child(3) { animation-delay: -1.5s; }
.loader.orbit > div:nth-child(4) { animation-delay: -2.25s; }
.loader.orbit > div:nth-child(1)::before { animation-delay0s; }
.loader.orbit > div:nth-child(2)::before { animation-delay: -.5s; }
.loader.orbit > div:nth-child(3)::before { animation-delay: -1s; }
.loader.orbit > div:nth-child(4)::before { animation-delay: -1.5s; }
@keyframes loading-orbit { 0% { transformrotate(0deg); } 100% { transformrotate(360deg); } }
@keyframes loading-orbit-before { 0% { height1emwidth1emtransformtranslate3d(0,0,0); z-index5; } 5% { height1.25emwidth1.25em; } 25% { height2emwidth2emz-index10; } 50% { transformtranslate3d(1rem,15rem,0); z-index0height1emwidth1em; } 100% { transformtranslate3d(0,0,0); z-index0height1emwidth1em; } }


【声明】内容源于网络
0
0
趣聊科技圈
🧐探索科技,发现乐趣。🤩带你玩遍科技好物!
内容 511
粉丝 0
趣聊科技圈 🧐探索科技,发现乐趣。🤩带你玩遍科技好物!
总阅读63
粉丝0
内容511