html等待中动画,等待中loading 菊花图CSS 效果实现【Antd spin 源码实现】

缘起:

今天闲来无事,调试一个单页面VUE的效果,94年的开发小哥哥说,让我给他加个菊花图...Excuse me? 菊花图?长这样么?css

a817bc1bd91f0021b24b8f36245635c8.png仍是?长这样?

d6aa6af18d1074ca7f90f275125fa448.png简直让我脑洞大开。。html

其实呐,他说的是这个。。

5fc8d15777e342938ebacad4.html等待状态,我心里 

fbcc467524af04bb750009ebd5b54c68.pngantd

好了,那怎么实现呐spa

第一反应:gif

找个gif 图好麻烦~调试

想了想、、必定有别的解决方式。code

第二反应:看别的怎么作

第一个想起来宠幸的就是Antd,毕竟是我用的最多的库~component

来咱们去看看antd的loading怎么作的,点进去发现,它不叫loading~叫Spin~orm

来~看看怎么实现的吧~htm

超简单~ 只须要 HTML + CSSblog

.ant-spin-dot {

position: relative;

display: inline-block;

font-size: 20px;

width: 20px;

height: 20px;

}

.ant-spin-dot-spin{

transform: rotate(45deg);

animation: antRotate 1.2s infinite linear;

}

.ant-spin-dot i {

width: 9px;

height: 9px;

border-radius: 100%;

background-color: #1890ff;

transform: scale(0.75);

display: block;

position: absolute;

opacity: 0.3;

animation: antSpinMove 1s infinite linear alternate;

transform-origin: 50% 50%;

&:nth-child(1) {

left: 0;

top: 0;

}

&:nth-child(2) {

right: 0;

top: 0;

animation-delay: 0.4s;

}

&:nth-child(3) {

right: 0;

bottom: 0;

animation-delay: 0.8s;

}

&:nth-child(4) {

left: 0;

bottom: 0;

animation-delay: 1.2s;

}

}

@keyframes antSpinMove {

to {

opacity: 1;

}

}

@keyframes antRotate {

to {

transform: rotate(405deg);

}

}

资料库:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值