css怎么写数字平方,CSS3 平方反比定律动画演示

CSS

语言:

CSSSCSS

确定

body {

padding: 0px;

margin: 0px;

background-color: black;

text-align: center;

position: absolute;

top: 0px;

bottom: 0px;

left: 0px;

right: 0px;

overflow: hidden;

}

#outer {

position: relative;

width: 400px;

height: 400px;

margin: 100px auto;

animation: twirl 10s linear infinite;

border-radius: 50%;

border: solid 1px purple;

}

#outer div {

height: 100px;

width: 100px;

position: absolute;

border-radius: 50%;

}

#outer div:before {

content: "";

position: absolute;

top: 5%;

left: 5%;

width: 90%;

height: 90%;

border-radius: 50%;

background: radial-gradient(circle at 50% 10%, #eeeeee, rgba(200, 200, 200, 0) 58%);

filter: blur(5px);

z-index: 2;

animation: counter 10s linear infinite;

}

#outer div:first-child {

background-color: blue;

left: 0px;

top: 0px;

box-shadow: inset 0 0 20px black, 0 0 20px blue;

}

#outer div:nth-child(2) {

background-color: green;

left: 0px;

bottom: 0px;

box-shadow: inset 0 0 20px black, 0 0 20px green;

}

#outer div:nth-child(3) {

background-color: yellow;

right: 0px;

top: 0px;

box-shadow: inset 0 0 20px black, 0 0 20px yellow;

}

#outer div:last-child {

background-color: red;

right: 0px;

bottom: 0px;

box-shadow: inset 0 0 20px black, 0 0 20px red;

}

@keyframes twirl {

0% {

transform: rotate(0deg);

width: 400px;

height: 400px;

}

10% {

transform: rotate(180deg);

width: 400px;

height: 400px;

}

20% {

transform: rotate(360deg);

width: 400px;

height: 400px;

}

30% {

transform: rotate(720deg);

width: 300px;

height: 300px;

}

32% {

transform: rotate(1080deg);

width: 300px;

height: 300px;

}

34% {

transform: rotate(1440deg);

width: 200px;

height: 200px;

}

36% {

transform: rotate(1800deg);

width: 200px;

height: 200px;

}

38% {

transform: rotate(2160deg);

width: 200px;

height: 200px;

}

40% {

transform: rotate(2520deg);

width: 200px;

height: 200px;

}

42% {

transform: rotate(2880deg);

width: 200px;

height: 200px;

}

44% {

transform: rotate(3240deg);

width: 300px;

height: 300px;

}

48% {

transform: rotate(3600deg);

width: 300px;

height: 300px;

}

50% {

transform: rotate(3960deg);

width: 300px;

height: 300px;

}

60% {

transform: rotate(4320deg);

width: 350px;

height: 350px;

}

70% {

transform: rotate(4680deg);

width: 350px;

height: 350px;

}

80% {

transform: rotate(5040deg);

width: 400px;

height: 400px;

}

90% {

transform: rotate(5400deg);

width: 400px;

height: 400px;

}

100% {

transform: rotate(5760deg);

width: 400px;

height: 400px;

}

}

@keyframes counter {

0% {

transform: rotate(0deg);

}

10% {

transform: rotate(-180deg);

}

20% {

transform: rotate(-360deg);

}

30% {

transform: rotate(-720deg);

}

32% {

transform: rotate(-1080deg);

}

34% {

transform: rotate(-1440deg);

}

36% {

transform: rotate(-1800deg);

}

38% {

transform: rotate(-2160deg);

}

40% {

transform: rotate(-2520deg);

}

42% {

transform: rotate(-2880deg);

}

44% {

transform: rotate(-3240deg);

}

48% {

transform: rotate(-3600deg);

}

50% {

transform: rotate(-3960deg);

}

60% {

transform: rotate(-4320deg);

}

70% {

transform: rotate(-4680deg);

}

80% {

transform: rotate(-5040deg);

}

90% {

transform: rotate(-5400deg);

}

100% {

transform: rotate(-5760deg);

}

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值