纯css实现彩虹动画

代码语言:html

所属分类:动画

代码描述:纯css实现彩虹动画

代码标签: 彩虹 动画

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


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

<style>
.red {
  border: 18px solid red;
  border-radius: 50%;
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
}

.runanimation .red {
  animation: bow2 0.35s forwards;
  animation-delay: 5.45s;
}

.orange {
  border: 18px solid orange;
  border-radius: 50%;
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  bottom: 18px;
}

.runanimation .orange {
  animation: bow 0.35s forwards;
  animation-delay: 5.1s;
}

.yellow {
  border: 18px solid yellow;
  border-radius: 50%;
  position: absolute;
  top: 36px;
  left: 36px;
  right: 36px;
  bottom: 36px;
}

.runanimation .yellow {
  animation: bow2 0.35s forwards;
  animation-delay: 4.75s;
}

.green {
  border: 18px solid green;
  border-radius: 50%;
  position: absolute;
  top: 54px;
  left: 54px;
  right: 54px;
  bottom: 54px;
}

.runanimation .green {
  animation: bow 0.35s forwards;
  animation-delay: 4.4s;
}

.blue {
  border: 18px solid blue;
  border-radius: 50%;
  position: absolute;
  top: 72px;
  left: 72px;
  right: 72px;
  bottom: 72px;
}

.runanimation .blue {
  animation: bow2 0.35s forwards;
  animation-delay: 4.05s;
}

.indigo {
  border: 18px solid indigo;
  border-radius: 50%;
  position: absolute;
  top: 90px;
  left: 90px;
  right: 90px;
  bottom: 90px;
}

.runanimation .indigo {
  animation: bow 0.35s forwards;
  animation-delay: 3.7s;
}

.violet {
  border: 18px solid violet;
  border-radius: 50%;
  position: absolute;
  top: 108px;
  left: 108px;
  right: 108px;
  bottom: 108px;
}

.runanimation .violet {
  animation: bow2 0.35s forwards;
  animation-delay: 3.35s;
}

.bow {
  border-top: 18px solid transparent;
  border-right: 18px solid transparent;
  transform: rotate(-45deg);
}

@keyframes bow {
  0% {
    transform: rotate(-45deg);
  }
  100% {
    transform: rotate(-225deg);
  }
}
@keyframes bow2 {
  0% {
    transform: rotate(-45deg);
  }
  100% {
    transform: rotate(135deg);
  }
}
.sky {
  width: 400px;
  height: 400px;
  background: #92d6ed;
  background: #b8e1fc;
  margin: calc(50vh - 200px) auto 0 auto;
  position: relative;
  overflow: hidden;
}

body {
  background: #F7FAFC;
}

.clouds {
  position: absolute;
  top: 0;
  width: 105px;
  height: 50px;
  opacity: 0;
  animation: clouds 4s forwards;
  animation-delay: 6s;
}

.clouds1 {
  top: 120px;
  left: 20px;
  z-index: 1;
}

.clouds2 {
  top: 80px;
  right: 20px;
  z-index: 2;
}

.cloud {
  border-radius: 50%;
  position: absolute;
  background: #fff;
}

.cloud1 {
  height: 40px;
  width: 40px;
  right: 0;
  top: 5px;
  z-index: 2;
  background: linear-gradient(45deg, #f2f9fe 0%, #d6f0fd 100%);
}

.cloud2 {
  height: 50px;
  width: 50px;
  right: 20px;
  top: 0;
  z-index: 3;
  background: linear-gradient(45deg, #f2f9fe 0%, #d6f0fd 100%);
}

.cloud3 {
  height: 45px;
  width: 45px;
  right: 43px;
  top: 3px;
  z-index: 4;
  background: linear-gradient(45deg, #f2f9fe 0%, #d6f0fd 100%);
}

.cloud4 {
  height: 40px;
  width: 40px;
  right: 65px;
  top: 5px;
  z-index: 5;
  background: linear-gradient(45deg, #f2f9fe 0%, #d6f0fd 100%);
}

.grass {
  position: absolute;
  bottom: -0;
  height: 200px;
  width: 100%;
}

.grass0 {
  height: 1000px;
  width: 1000px;
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0