html动画旋转,CSS旋转动画

css

/*variables*/

* {

padding: 0;

margin: 0;

box-sizing: border-box;

}

html, body {

width: 100%;

height: 100%;

}

body {

background-color: #140032;

overflow: hidden;

}

body * {

position: absolute;

top: 0;

bottom: 0;

left: 0;

right: 0;

margin: auto;

}

.square {

border: 2px solid #00ff96;

-webkit-animation: SwimmingPyramid 1.5s linear infinite, PyramidLight 1.5s linear infinite;

animation: SwimmingPyramid 1.5s linear infinite, PyramidLight 1.5s linear infinite;

}

.square:nth-child(1) {

width: 28px;

height: 28px;

-webkit-animation-delay: -0.55s;

animation-delay: -0.55s;

}

.square:nth-child(2) {

width: 56px;

height: 56px;

-webkit-animation-delay: -0.5s;

animation-delay: -0.5s;

}

.square:nth-child(3) {

width: 84px;

height: 84px;

-webkit-animation-delay: -0.45s;

animation-delay: -0.45s;

}

.square:nth-child(4) {

width: 112px;

height: 112px;

-webkit-animation-delay: -0.4s;

animation-delay: -0.4s;

}

.square:nth-child(5) {

width: 140px;

height: 140px;

-webkit-animation-delay: -0.35s;

animation-delay: -0.35s;

}

.square:nth-child(6) {

width: 168px;

height: 168px;

-webkit-animation-delay: -0.3s;

animation-delay: -0.3s;

}

.square:nth-child(7) {

width: 196px;

height: 196px;

-webkit-animation-delay: -0.25s;

animation-delay: -0.25s;

}

.square:nth-child(8) {

width: 224px;

height: 224px;

-webkit-animation-delay: -0.2s;

animation-delay: -0.2s;

}

.square:nth-child(9) {

width: 252px;

height: 252px;

-webkit-animation-delay: -0.15s;

animation-delay: -0.15s;

}

.square:nth-child(10) {

width: 280px;

height: 280px;

-webkit-animation-delay: -0.1s;

animation-delay: -0.1s;

}

.square:nth-child(11) {

width: 308px;

height: 308px;

-webkit-animation-delay: -0.05s;

animation-delay: -0.05s;

}

.square:nth-child(12) {

width: 336px;

height: 336px;

-webkit-animation-delay: 0s;

animation-delay: 0s;

}

@-webkit-keyframes PyramidLight {

20% {

border-width: 16px;

}

80% {

border-width: 2px;

}

}

@keyframes PyramidLight {

20% {

border-width: 16px;

}

80% {

border-width: 2px;

}

}

@-webkit-keyframes SwimmingPyramid {

100% {

-webkit-transform: rotate(360deg);

transform: rotate(360deg);

}

}

@keyframes SwimmingPyramid {

100% {

-webkit-transform: rotate(360deg);

transform: rotate(360deg);

}

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值