div+css实现正方形嵌套旋转视觉动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现正方形嵌套旋转视觉动画效果代码

代码标签: div css 正方形 嵌套 旋转 视觉 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">

<style>
    .stage {
  position: absolute;
  width: 650px;
  height: 650px;
  left: 50%;
  top: 50%;
  margin: -325px 0 0 -325px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.stage div {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid #000;
  transform-origin: 50% 50% 0;
  -webkit-animation: move 700ms cubic-bezier(0.42, 0, 0.58, 1) 0s infinite alternate forwards;
          animation: move 700ms cubic-bezier(0.42, 0, 0.58, 1) 0s infinite alternate forwards;
}
.stage div:nth-child(45) {
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  -webkit-animation-delay: -30ms;
          animation-delay: -30ms;
}
.stage div:nth-child(44) {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  -webkit-animation-delay: -60ms;
          animation-delay: -60ms;
}
.stage div:nth-child(43) {
  width: 45px;
  height: 45px;
  margin: -22.5px 0 0 -22.5px;
  -webkit-animation-delay: -90ms;
          animation-delay: -90ms;
}
.stage div:nth-child(42) {
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  -webkit-animation-delay: -120ms;
          animation-delay: -120ms;
}
.stage div:nth-child(41) {
  width: 75px;
  height: 75px;
  margin: -37.5px 0 0 -37.5px;
  -webkit-animation-delay: -150ms;
          animation-delay: -150ms;
}
.stage div:nth-child(40) {
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  -webkit-animation-delay: -180ms;
          animation-delay: -180ms;
}
.stage div:nth-child(39) {
  width: 105px;
  height: 105px;
  margin: -52.5px 0 0 -52.5px;
  -webkit-animation-delay: -210ms;
          animation-delay: -210ms;
}
.stage div:nth-child(38) {
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  -webkit-animation-delay: -240ms;
          animation-delay: -240ms;
}
.stage div:nth-child(37) {
  width: 135px;
  height: 135px;
  margin: -67.5px 0 0 -67.5px;
  -webkit-animation-delay: -270ms;
          animation-delay: -270ms;
}
.stage div:nth-child(36) {
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  -webkit-animation-delay: -300ms;
          animation-delay: -300ms;
}
.stage div:nth-child(35) {
  width: 165px;
  height: 165px;
  margin: -82.5px 0 0 -82.5px;
  -webkit-animation-delay: -330ms;
          animation-delay: -330ms;
}
.stage div:nth-child(34) {
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  -webkit-animation-delay: -360ms;
          animation-delay: -360ms;
}
.stage div:nth-child(33) {
  width: 195px;
  height: 195px;
  margin: -97.5px 0 0 -97.5px;
  -webkit-animation-delay: -390ms;
          animation-delay: -390ms;
}
.stage div:nth-child(32) {
  width: 210px;
  height: 210px;
  margin: -105px 0 0 -105px;
  -webkit-animation-delay: -420ms;
          animation-delay: -420ms;
}
.stage div:nth-child(31) {
  width: 225px;
  height: 225px;
  margin: -112.5px 0 0 -112.5px;
  -webkit-animation-delay: -450ms;
          animation-delay: -450ms;
}
.stage div:nth-child(30) {
  width: 240px;
  height: 240px;
  margin: -120px 0 0 -120px;
  -webkit-animation-delay: -480ms;
          animation-delay: -480ms;
}
.stage div:nth-child(29) {
  width: 255px;
  height: 255px;
  margin: -127.5px 0 0 -127.5px;
  -webkit-animation-delay: -510ms;
          animation-delay: -510ms;
}
.stage div:nth-child(28) {
  width: 270px;
  height: 270px;
  margin: -135px 0 0 -135px;
  -webkit-animation-delay: -540ms;
          animation-delay: -540ms;
}
.stage div:nth-child(27) {
  width: 285px;
  height: 285px;
  margin: -142.5px 0 0 -142.5px;
  -webkit-animation-delay: -570ms;
          animation-delay: -570ms;
}
.stage div:nth-child(26) {
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  -webkit-animation-delay: -600ms;
          animation-delay: -600ms;
}
.stage div:nth-child(25) {
  width: 315px;
  height: 315px;
  margin: -157.5px 0 0 -157.5px;
  -webkit-animation-delay: -630ms;
          animation-delay: -630ms;
}
.stage div:nth-child(24) {
  width: 330px;
  height: 330px;
  margin: -165px 0 0 -165px;
  -webkit-animation-delay: -660ms;
          animation-delay: -660ms;
}
.stage div:nth-child(23) {
  width: 345px;
  height: 345px;
  margin: -172.5px 0 0 -172.5px;
  -webkit-animation-delay: -690ms;
          animation-delay: -690ms;
}
.stage div:nth-child(22) {
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  -webkit-animation-delay: -720ms;
          animation-delay: -720ms;
}
.stage div:nth-child(21) {
  width: 375px;
  height: 375px;
  margin: -187.5px 0 0 -187.5px;
  -webkit-animation-delay: -750ms;
          animation-delay: -750ms;
}
.stage div:nth-child(20) {
  width: 390px;
  height: 390px;
  margin: -195px 0 0 -195px;
  -webkit-animation-delay: -780ms;
          animation-delay: -780ms;
}
.stage div:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0