css3中圆性渐变,CSS3 方和圆的交替渐变动画

CSS

语言:

CSSSCSS

确定

.circle {

position: fixed;

top: 50%;

left: 50%;

-webkit-transform: translate(-50%, -50%);

transform: translate(-50%, -50%);

-webkit-transform-origin: 0% 0%;

transform-origin: 0% 0%;

border: 2px solid black;

-webkit-animation: animRadius 1000ms ease infinite alternate, animRotate 8000ms linear infinite;

animation: animRadius 1000ms ease infinite alternate, animRotate 8000ms linear infinite;

}

.circle:nth-of-type(1) {

width: 50px;

height: 50px;

-webkit-animation-delay: -200ms;

animation-delay: -200ms;

}

.circle:nth-of-type(2) {

width: 100px;

height: 100px;

-webkit-animation-delay: -400ms;

animation-delay: -400ms;

}

.circle:nth-of-type(3) {

width: 150px;

height: 150px;

-webkit-animation-delay: -600ms;

animation-delay: -600ms;

}

.circle:nth-of-type(4) {

width: 200px;

height: 200px;

-webkit-animation-delay: -800ms;

animation-delay: -800ms;

}

@-webkit-keyframes animRadius {

0% {

border-radius: 0%;

}

100% {

border-radius: 50%;

}

}

@keyframes animRadius {

0% {

border-radius: 0%;

}

100% {

border-radius: 50%;

}

}

@-webkit-keyframes animRotate {

0% {

-webkit-transform: rotate(0deg) translate(-50%, -50%);

transform: rotate(0deg) translate(-50%, -50%);

}

100% {

-webkit-transform: rotate(360deg) translate(-50%, -50%);

transform: rotate(360deg) translate(-50%, -50%);

}

}

@keyframes animRotate {

0% {

-webkit-transform: rotate(0deg) translate(-50%, -50%);

transform: rotate(0deg) translate(-50%, -50%);

}

100% {

-webkit-transform: rotate(360deg) translate(-50%, -50%);

transform: rotate(360deg) translate(-50%, -50%);

}

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值