div+css实现动态旋转效果

代码语言:html

所属分类:动画

代码描述:div+css实现动态效果

代码标签: 旋转 效果

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


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

<style>
html, body {
  width: 100%;
  height: 100%;
}

body {
  background-color: #140032;
  overflow: hidden;
  margin: 0;
}
body *, body *:after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  border-radius: 50%;
}

.half:nth-child(2) {
  -webkit-transform: scale(-1, -1);
          transform: scale(-1, -1);
}
.half .life {
  width: 50px;
  height: 50px;
  -webkit-animation: Medallion 6s ease-in-out infinite;
          animation: Medallion 6s ease-in-out infinite;
}
.half .life:after {
  content: "";
  width: inherit;
  height: inherit;
  border-top: 25px dotted transparent;
  border-left: 5px solid transparent;
}
.half .life:nth-child(1) {
  -webkit-animation-delay: -0.06s;
          animation-delay: -0.06s;
}
.half .life:nth-child(1):after {
  border-color: #ff0200;
  -webkit-transform: rotate(7.2deg) translate(2px, -2px) scale(0.01);
          transform: rotate(7.2deg) translate(2px, -2px) scale(0.01);
}
.half .life:nth-child(2) {
  -webkit-animation-delay: -0.12s;
          animation-delay: -0.12s;
}
.half .life:nth-child(2):after {
  border-color: #ff0400;
  -webkit-transform: rotate(14.4deg) translate(4px, -4px) scale(0.02);
          transform: rotate(14.4deg) translate(4px, -4px) scale(0.02);
}
.half .life:nth-child(3) {
  -webkit-animation-delay: -0.18s;
          animation-delay: -0.18s;
}
.half .life:nth-child(3):after {
  border-color: #ff0600;
  -webkit-transform: rotate(21.6deg) translate(6px, -6px) scale(0.03);
          transform: rotate(21.6deg) translate(6px, -6px) scale(0.03);
}
.half .life:nth-child(4) {
  -webkit-animation-delay: -0.24s;
          animation-delay: -0.24s;
}
.half .life:nth-child(4):after {
  border-color: #ff0900;
  -webkit-transform: rotate(28.8deg) translate(8px, -8px) scale(0.04);
          transform: rotate(28.8deg) translate(8px, -8px) scale(0.04);
}
.half .life:nth-child(5) {
  -webkit-animation-delay: -0.3s;
          animation-delay: -0.3s;
}
.half .life:nth-child(5):after {
  border-color: #ff0b00;
  -webkit-transform: rotate(36deg) translate(10px, -10px) scale(0.05);
          transform: rotate(36deg) translate(10px, -10px) scale(0.05);
}
.half .life:nth-child(6) {
  -webkit-animation-delay: -0.36s;
          animation-delay: -0.36s;
}
.half .life:nth-child(6):after {
  border-color: #ff0d00;
  -webkit-transform: rotate(43.2deg) translate(12px, -12px) scale(0.06);
          transform: rotate(43.2deg) translate(12px, -12px) scale(0.06);
}
.half .life:nth-child(7) {
  -webkit-animation-delay: -0.42s;
          animation-delay: -0.42s;
}
.half .life:nth-child(7):after {
  border-color: #ff0f00;
  -webkit-transform: rotate(50.4deg) translate(14px, -14px) scale(0.07);
          transform: rotate(50.4deg) translate(14px, -14px) scale(0.07);
}
.half .life:nth-child(8) {
  -webkit-animation-delay: -0.48s;
          animation-delay: -0.48s;
}
.half .life:nth-child(8):after {
  border-color: #ff1100;
  -webkit-transform: rotate(57.6deg) translate(16px, -16px) scale(0.08);
          transform: rotate(57.6deg) translate(16px, -16px) scale(0.08);
}
.half .life:nth-child(9) {
  -webkit-animation-delay: -0.54s;
          animation-delay: -0.54s;
}
.half .life:nth-child(9):after {
  border-color: #ff1300;
  -webkit-transform: rotate(64.8deg) translate(18px, -18px) scale(0.09);
          transform: rotate(64.8deg) translate(18px, -18px) scale(0.09);
}
.half .life:nth-child(10) {
  -webkit-animation-delay: -0.6s;
          animation-delay: -0.6s;
}
.half .life:nth-child(10):after {
  border-color: #ff1500;
  -webkit-transform: rotate(72deg) translate(20px, -20px) scale(0.1);
          transform: rotate(72deg) translate(20px, -20px) scale(0.1);
}
.half .life:nth-child(11) {
  -webkit-animation-delay: -0.66s;
          animation-delay: -0.66s;
}
.half .life:nth-child(11):after {
  border-color: #ff1700;
  -webkit-transform: rotate(79.2deg) translate(22px, -22px) scale(0.11);
          transform: rotate(79.2deg) translate(22px, -22px) scale(0.11);
}
.half .l.........完整代码请登录后点击上方下载按钮下载查看

网友评论0