css实现三维多边形球动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现三维多边形球动画效果代码

代码标签: 多边形 动画 效果

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


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
<style>
*, *::before, *::after {
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1125px;
  background-image: radial-gradient(circle, #000, #222);
}

.ball {
  position: relative;
  transform-style: preserve-3d;
  -webkit-animation: ball 60s infinite linear;
          animation: ball 60s infinite linear;
  --rx: 0deg;
  --ry: 0deg;
}
@-webkit-keyframes ball {
  from {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg);
  }
}
@keyframes ball {
  from {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg);
  }
}
.ball > :nth-child(1) {
  -webkit-animation-delay: -0.75s;
          animation-delay: -0.75s;
  -webkit-animation-duration: 3.8s;
          animation-duration: 3.8s;
}
.ball > :nth-child(1)::before {
  background-color: #9661ff;
}
.ball > :nth-child(2) {
  -webkit-animation-delay: -3.9125s;
          animation-delay: -3.9125s;
  -webkit-animation-duration: 5.45s;
          animation-duration: 5.45s;
}
.ball > :nth-child(2)::before {
  background-color: #a375ff;
}
.ball > :nth-child(3) {
  -webkit-animation-delay: -1.7875s;
          animation-delay: -1.7875s;
  -webkit-animation-duration: 5.3s;
          animation-duration: 5.3s;
}
.ball > :nth-child(3)::before {
  background-color: #8f57ff;
}
.ball > :nth-child(4) {
  -webkit-animation-delay: -1.7125s;
          animation-delay: -1.7125s;
  -webkit-animation-duration: 4.15s;
          animation-duration: 4.15s;
}
.ball > :nth-child(4)::before {
  background-color: #c5a8ff;
}
.ball > :nth-child(5) {
  -webkit-animation-delay: -3.875s;
          animation-delay: -3.875s;
  -webkit-animation-duration: 3.95s;
          animation-duration: 3.95s;
}
.ball > :nth-child(5)::before {
  background-color: #b48fff;
}
.ball > :nth-child(6) {
  -webkit-animation-delay: -0.1625s;
          animation-delay: -0.1625s;
  -webkit-animation-duration: 3.75.........完整代码请登录后点击上方下载按钮下载查看

网友评论0