div+css实现鲜花绽放动画效果代码

代码语言:html

所属分类:动画

代码描述:div+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 {
  background-color: #222;
  background-image: radial-gradient(circle at center, #222, #111 300px);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 420px;
  overflow: hidden;
}

.flower {
  position: relative;
  transform-style: preserve-3d;
  -webkit-animation: rotateFlower 60s infinite linear;
          animation: rotateFlower 60s infinite linear;
}
@-webkit-keyframes rotateFlower {
  to {
    transform: rotateY(360deg);
  }
}
@keyframes rotateFlower {
  to {
    transform: rotateY(360deg);
  }
}

.leaf {
  position: absolute;
  height: 120px;
  transform-origin: top;
  transform-style: preserve-3d;
  -webkit-clip-path: polygon(0 100%, 50% 0, 100% 100%, 0 100%);
          clip-path: polygon(0 100%, 50% 0, 100% 100%, 0 100%);
  background-image: linear-gradient(#000e, #fff1);
  border-radius: 100px;
  -webkit-animation: leafOpen 12s infinite ease-in-out, ocLeafWidth 6s infinite alternate ease-in-out;
          animation: leafOpen 12s infinite ease-in-out, ocLeafWidth 6s infinite alternate ease-in-out;
}
.leaf:nth-child(0) {
  --leafAngle: 0deg;
  -webkit-animation-delay: 0s;
          animation-delay: 0s;
  background-color: #ef8f8f;
}
.leaf:nth-child(1) {
  --leafAngle: 30deg;
  -webkit-animation-delay: -0.2s;
          animation-delay: -0.2s;
  background-color: #ef998f;
}
.leaf:nth-child(2) {
  --leafAngle: 60deg;
  -webkit-animation-delay: -0.4s;
          animation-delay: -0.4s;
  background-color: #efa38f;
}
.leaf:nth-child(3) {
  --leafAngle: 90deg;
  -webkit-animation-delay: -0.6s;
          animation-delay: -0.6s;
  background-color: #efac8f;
}
.leaf:nth-child(4) {
  --leafAngle: 120deg;
  -webkit-animation-delay: -0.8s;
          animation-delay: -0.8s;
  background-color: #efb68f;
}
.leaf:nth-child(5) {
  --leafAngle: 150deg;
  -webkit-animation-delay: -1s;
          animation-delay: -1s;
  background-color: #efbf8f;
}
.leaf:nth-child(6) {
  --leafAngle: 180deg;
  -webkit-animation-delay: -1.2s;
          animation-delay: -1.2s;
  background-c.........完整代码请登录后点击上方下载按钮下载查看

网友评论0