css+div实现精灵飞舞动画效果代码

代码语言:html

所属分类:动画

代码描述:css+div实现精灵飞舞动画效果代码

代码标签: css div 精灵 飞舞 动画

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

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

<head>
  <meta charset="UTF-8">
  
  
  
  
  
<style>
body {
  background: #1e3242;
}

.frame {
  position: absolute;
  width: 350px;
  height: 350px;
  left: calc(50% - 175px);
  top: calc(50% - 175px);
  border-radius: 2px;
  box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  background: linear-gradient(to bottom, #0a2342 0%, #283e51 100%);
}
.frame .star {
  position: absolute;
  width: 1px;
  height: 1px;
  border-radius: 1px;
  background: #fff;
}
.frame .star:nth-child(1) {
  left: 65%;
  bottom: 85%;
  opacity: 0.69;
  animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(2) {
  left: 98%;
  bottom: 4%;
  opacity: -0.37;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(3) {
  left: 63%;
  bottom: 66%;
  opacity: 0.33;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(4) {
  left: 15%;
  bottom: 4%;
  opacity: -0.4;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(5) {
  left: 7%;
  bottom: 92%;
  opacity: 0.47;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(6) {
  left: 72%;
  bottom: 93%;
  opacity: 0.77;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(7) {
  left: 86%;
  bottom: 54%;
  opacity: 0.11;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(8) {
  left: 57%;
  bottom: 29%;
  opacity: 0.13;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(9) {
  left: 84%;
  bottom: 50%;
  opacity: 0.31;
  animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(10) {
  left: 7%;
  bottom: 45%;
  opacity: 0.32;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(11) {
  left: 69%;
  bottom: 20%;
  opacity: 0.11;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(12) {
  left: 24%;
  bottom: 59%;
  opacity: 0.24;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(13) {
  left: 85%;
  bottom: 5%;
  opacity: -0.12;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(14) {
  left: 31%;
  bottom: 72%;
  opacity: 0.72;
  animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(15) {
  left: 9%;
  bottom: 66%;
  opacity: 0.18;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(16) {
  left: 40%;
  bottom: 52%;
  opacity: 0.48;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(17) {
  left: 67%;
  bottom: 53%;
  opacity: 0.43;
  animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(18) {
  left: 97%;
  bottom: 78%;
  opacity: 0.4;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(19) {
  left: 72%;
  bottom: 13%;
  opacity: -0.09;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(20) {
  left: 81%;
  bottom: 79%;
  opacity: 0.52;
  animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(21) {
  left: 26%;
  bottom: 41%;
  opacity: 0.38;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(22) {
  left: 16%;
  bottom: 23%;
  opacity: 0.16;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(23) {
  left: 54%;
  bottom: 97%;
  opacity: 0.83;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(24) {
  left: 64%;
  bottom: 61%;
  opacity: 0.4;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(25) {
  left: 20%;
  bottom: 28%;
  opacity: -0.13;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(26) {
  left: 25%;
  bottom: 24%;
  opacity: 0.2;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(27) {
  left: 85%;
  bottom: 76%;
  opacity: 0.43;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(28) {
  left: 69%;
  bottom: 64%;
  opacity: 0.28;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(29) {
  left: 89%;
  bottom: 96%;
  opacity: 0.53;
  animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(30) {
  left: 1%;
  bottom: 35%;
  opacity: 0.05;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(31) {
  left: 25%;
  bottom: 32%;
  opacity: -0.14;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(32) {
  left: 20%;
  bottom: 54%;
  opacity: 0.11;
  animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(33) {
  left: 19%;
  bottom: 62%;
  opacity: 0.54;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(34) {
  left: 42%;
  bottom: 63%;
  opacity: 0.42;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(35) {
  left: 78%;
  bottom: 21%;
  opacity: -0.26;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(36) {
  left: 5%;
  bottom: 38%;
  opacity: 0.11;
  animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(37) {
  left: 27%;
  bottom: 23%;
  opacity: 0.14;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(38) {
  left: 58%;
  bottom: 94%;
  opacity: 0.74;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(39) {
  left: 85%;
  bottom: 86%;
  opacity: 0.38;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(40) {
  left: 90%;
  bottom: 4%;
  opacity: -0.39;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(41) {
  left: 55%;
  bottom: 46%;
  opacity: 0.08;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(42) {
  left: 90%;
  bottom: 10%;
  opacity: -0.19;
  animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(43) {
  left: 79%;
  bottom: 92%;
  opacity: 0.67;
  animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(44) {
  left: 46%;
  bottom: 71%;
  opacity: 0.31;
  animation: 2s flickr -1s infinite.........完整代码请登录后点击上方下载按钮下载查看

网友评论0