纯CSS实现波纹特效的Loading特效

(21) 2023-12-07 13:12

Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说纯CSS实现波纹特效的Loading特效,希望能够帮助你!!!。

这是一个纯CSS实现的Loading特效,由3个圆形波纹组成。这个特效使用了CSS的animation属性,通过动态变化来实现波纹的扩散和收缩效果。同时,这个特效的实现没有用到任何JavaScript,可以有效地提升网站的性能。

整个特效的视觉效果非常出色,能够为网站增添一些活力和趣味性。如果您正在寻找一个简单而美观的加载动画,那么这个纯CSS实现的波纹特效的Loading特效一定会是一个不错的选择。

希望这个特效能够为您的网站增添一些活力和趣味性!

纯CSS实现波纹特效的Loading特效_https://bianchenghao6.com/blog__第1张

<div class="loading">
    <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: 32px;
  height: 32px;
}

.loading > div {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 100%;
  opacity: 0;
  animation: ball-scale-multiple 1s 0s linear infinite;
}

.loading > div:nth-child(2) {
  animation-delay: 0.2s;
}

.loading > div:nth-child(3) {
  animation-delay: 0.4s;
}

.loading.la-sm {
  width: 16px;
  height: 16px;
}

.loading.la-sm > div {
  width: 16px;
  height: 16px;
}

.loading.la-2x {
  width: 64px;
  height: 64px;
}

.loading.la-2x > div {
  width: 64px;
  height: 64px;
}

.loading.la-3x {
  width: 96px;
  height: 96px;
}

.loading.la-3x > div {
  width: 96px;
  height: 96px;
}

@keyframes ball-scale-multiple {
  0% {
    opacity: 0;
    transform: scale(0);
  }

  5% {
    opacity: 0.75;
  }

  100% {
    opacity: 0;
    transform: scale(1);
  }
}
</style>

今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

上一篇

已是最后文章

下一篇

已是最新文章

发表回复