css实现一个五角变换动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现一个五角变换动画效果代码

代码标签: 五角 变换 动画 效果

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

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

<head>


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

body {
  background-image: radial-gradient(circle, #222, #000 20em);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 750px;
  overflow: hidden;
}

.scene {
  position: relative;
  -webkit-animation: scene 24s infinite linear;
          animation: scene 24s infinite linear;
}
@-webkit-keyframes scene {
  0% {
    transform: rotateY(360deg) rotateX(-45deg);
  }
  100% {
    transform: rotateY(0deg) rotateX(-45deg);
  }
}
@keyframes scene {
  0% {
    transform: rotateY(360deg) rotateX(-45deg);
  }
  100% {
    transform: rotateY(0deg) rotateX(-45deg);
  }
}

.pentagon {
  position: absolute;
  width: 8em;
  height: 0.32em;
  -webkit-animation: sqr 12s infinite linear;
          animation: sqr 12s infinite linear;
}
@-webkit-keyframes sqr {
  0% {
    top: -16em;
    transform: translate(-50%, -50%) rotateY(0deg);
  }
  100% {
    top: 16em;
    transform: translate(-50%, -50%) rotateY(-144deg);
  }
}
@keyframes sqr {
  0% {
    top: -16em;
    transform: translate(-50%, -50%) rotateY(0deg);
  }
  100% {
    top: 16em;
    transform: translate(-50%, -50%) rotateY(-144deg);
  }
}
.pentagon:nth-child(1) {
  -webkit-animation-delay: 0s;
          animation-delay: 0s;
}
.pentagon:nth-child(2) {
  -webkit-animation-delay: -0.375s;
          animation-delay: -0.375s;
}
.pentagon:nth-child(3) {
  -webkit-animation-delay: -0.75s;
          animation-delay: -0.75s;
}
.pentagon:nth-child(4) {
  -webkit-animation-delay: -1.125s;
          animation-delay: -1.125s;
}
.pentagon:nth-child(5) {
  -webkit-animation-delay: -1.5s;
          animation-delay: -1.5s;
}
.pentagon:nth-child(6) {
  -webkit-animation-delay: -1.875s;
          animation-delay: -1.875s;
}
.pentagon:nth-child(7) {
  -webkit-animation-delay: -2.25s;
          animation-delay: -2.25s;
}
.pentagon:nth-child(8) {
  -webkit-animation-delay: -2.625s;
          animation-delay: -2.625s;
}
.pentagon:nth-child(9) {
  -webkit-animation-delay: -3s;
          animation-delay: -3s;
}
.pentagon:nth-child(10) {
  -webkit-animation-delay: -3.375s;
          animation-delay: -3.375s;
}
.pentagon:nth-child(11) {
  -webkit-animation-delay: -3.75s;
          animation-delay: -3.75s;
}
.pentagon:nth-child(12) {
  -webkit-animation-delay: -4.125s;
          animation-delay: -4.125s;
}
.pentagon:nth-child(13) {
  -webkit-animation-delay: -4.5s;
          animation-delay: -4.5s;
}
.pentagon:nth-child(14) {
  -webkit-animation-delay: -4.87.........完整代码请登录后点击上方下载按钮下载查看

网友评论0