CSSFX的loding效果

效果如下:
在这里插入图片描述
页面部分:

		<div class="dots"> 
            <div></div> 
            <div></div> 
            <div></div> 
        </div> 

css部分:

.dots {
     width: 1.5rem;
     display: flex;
     flex-flow: row nowrap;
     align-items: center;
     justify-content: space-between;
 }

 .dots div {
     width: 0.4rem;
     height: 0.4rem;
     border-radius: 50%;
     background-color: #000000;
     animation: fade 0.8s ease-in-out alternate infinite;
 }

 .dots div:nth-of-type(1) {
     animation-delay: -0.4s;
 }

 .dots div:nth-of-type(2) {
     animation-delay: -0.2s;
 }

效果图:
在这里插入图片描述
页面部分:

    <div class="loadingdiv"></div>

css部分:

 .loadingdiv {
   width: .8rem;
   height: .96rem;
   border: 3px solid transparent;
   border-top-color: #666666;
   border-bottom-color: #666666;
   border-radius: 50%;
   animation: spin-stretch 2s ease infinite;
 }
 
 @keyframes spin-stretch {
   50% {
     transform: rotate(360deg) scale(0.4, 0.33);
     border-width: 8px;
   }
   100% {
     transform: rotate(720deg) scale(1, 1);
     border-width: 3px;
   }
 }
 

效果图:
在这里插入图片描述
页面部分:

        <div class="balls">
            <div></div>
            <div></div>
            <div></div>
        </div>

CSS部分:

.balls {
    width: 2rem;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
}

.balls div{
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background-color: #666666;
}

.balls div:nth-of-type(1) {
    transform: translateX(-100%);
    animation: left-swing 0.5s ease-in alternate infinite;
}

.balls div:nth-of-type(3) {
    transform: translateX(-95%);
    animation: right-swing 0.5s ease-out alternate infinite;
}

@keyframes left-swing {

    50%,
    100% {
        transform: translateX(95%);
    }
}

@keyframes right-swing {
    50% {
        transform: translateX(-95%);
    }

    100% {
        transform: translateX(100%);
    }
}

效果图:
在这里插入图片描述
html页面:

        <div class="loadingDiv">
            <span class="view_span"></span>
            <span class="view_span"></span>
            <span class="view_span"></span>
            <span class="view_span"></span>
        </div>

CSS部分:

.loadingDiv {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  width: .6rem;
}

.view_span {
  width: 0.1rem;
  height: .3rem;
  background-color: #666666;
}

.view_span:nth-of-type(1) {
  animation: grow 1s -0.45s ease-in-out infinite;
}

.view_span:nth-of-type(2) {
  animation: grow 1s -0.3s ease-in-out infinite;
}

.view_span:nth-of-type(3) {
  animation: grow 1s -0.15s ease-in-out infinite;
}

.view_span:nth-of-type(4) {
  animation: grow 1s ease-in-out infinite;
}

@keyframes grow {
  0%,
  100% {
    transform: scaleY(1);
  }

  50% {
    transform: scaleY(2);
  }
}

效果图:
在这里插入图片描述
页面部分:

	<div class="viewDiv"></div>

CSS部分:

.viewDiv {
     position: relative;
     width: 1rem;
     height: 1rem;
     border: 3px solid #3cefff;
     overflow: hidden;
     animation: spin 3s ease infinite;
 }

 .viewDiv::before {
     content: '';
     position: absolute;
     top: -3px;
     left: -3px;
     width: 1rem;
     height: 1rem;
     background-color: hsla(185, 100%, 62%, 0.75);
     transform-origin: center bottom;
     transform: scaleY(1);
     animation: fill 3s linear infinite;
 }

 @keyframes spin {

     50%,
     100% {
         transform: rotate(360deg);
     }
 }

 @keyframes fill {

     25%,
     50% {
         transform: scaleY(0);
     }

     100% {
         transform: scaleY(1);
     }
 }

效果图:
在这里插入图片描述
页面部分:

        <div class="dots">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>

CSS部分:

.dots {
     width: 1.5rem;
     height: 1.5rem;
     display: grid;
     grid-template-rows: repeat(3, 1fr);
     grid-template-columns: repeat(3, 1fr);
     justify-items: center;
     align-items: center;
 }

 .dots>div {
     width: 0.25rem;
     height: 0.25rem;
     background-color: #666666;
     border-radius: 50%;
     animation: fade 1.5s alternate ease-in-out infinite;
 }

 .dots>div:nth-of-type(2),
 .dots>div:nth-of-type(4) {
     animation-delay: 0.25s;
 }

 .dots>div:nth-of-type(3),
 .dots>div:nth-of-type(5),
 .dots>div:nth-of-type(7) {
     animation-delay: 0.5s;
 }

 .dots>div:nth-of-type(6),
 .dots>div:nth-of-type(8) {
     animation-delay: 0.75s;
 }

 .dots>div:nth-of-type(9) {
     animation-delay: 1s;
 }

 @keyframes fade {
     to {
         opacity: 0.2;
     }
 }
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值