css+div实现精灵飞舞动画效果代码
代码语言:html
所属分类:动画
代码描述: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;
}
.frame .star:nth-child(45) {
left: 42%;
bottom: 90%;
opacity: 0.57;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(46) {
left: 63%;
bottom: 75%;
opacity: 0.42;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(47) {
left: 96%;
bottom: 68%;
opacity: 0.5;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(48) {
left: 41%;
bottom: 20%;
opacity: -0.25;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(49) {
left: 50%;
bottom: 31%;
opacity: 0.18;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(50) {
left: 32%;
bottom: 55%;
opacity: 0.38;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(51) {
left: 76%;
bottom: 32%;
opacity: -0.15;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(52) {
left: 33%;
bottom: 81%;
opacity: 0.69;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(53) {
left: 72%;
bottom: 14%;
opacity: -0.16;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(54) {
left: 53%;
bottom: 57%;
opacity: 0.34;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(55) {
left: 96%;
bottom: 83%;
opacity: 0.41;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(56) {
left: 76%;
bottom: 57%;
opacity: 0.36;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(57) {
left: 48%;
bottom: 43%;
opacity: 0.01;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(58) {
left: 15%;
bottom: 62%;
opacity: 0.18;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(59) {
left: 85%;
bottom: 47%;
opacity: 0.03;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(60) {
left: 60%;
bottom: 75%;
opacity: 0.28;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(61) {
left: 26%;
bottom: 94%;
opacity: 0.8;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(62) {
left: 17%;
bottom: 9%;
opacity: -0.17;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(63) {
left: 76%;
bottom: 79%;
opacity: 0.37;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(64) {
left: 47%;
bottom: 98%;
opacity: 0.52;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(65) {
left: 68%;
bottom: 86%;
opacity: 0.54;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(66) {
left: 31%;
bottom: 74%;
opacity: 0.33;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(67) {
left: 58%;
bottom: 56%;
opacity: 0.38;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(68) {
left: 99%;
bottom: 39%;
opacity: -0.07;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(69) {
left: 20%;
bottom: 39%;
opacity: 0.08;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(70) {
left: 35%;
bottom: 90%;
opacity: 0.43;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(71) {
left: 57%;
bottom: 22%;
opacity: 0.15;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(72) {
left: 10%;
bottom: 49%;
opacity: 0.1;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(73) {
left: 96%;
bottom: 23%;
opacity: -0.24;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(74) {
left: 26%;
bottom: 18%;
opacity: -0.19;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(75) {
left: 68%;
bottom: 76%;
opacity: 0.4;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(76) {
left: 77%;
bottom: 83%;
opacity: 0.7;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(77) {
left: 96%;
bottom: 73%;
opacity: 0.54;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(78) {
left: 22%;
bottom: 71%;
opacity: 0.5;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(79) {
left: 19%;
bottom: 86%;
opacity: 0.51;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(80) {
left: 5%;
bottom: 76%;
opacity: 0.56;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(81) {
left: 9%;
bottom: 63%;
opacity: 0.46;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(82) {
left: 22%;
bottom: 14%;
opacity: -0.29;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(83) {
left: 85%;
bottom: 40%;
opacity: 0.04;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(84) {
left: 84%;
bottom: 62%;
opacity: 0.49;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(85) {
left: 57%;
bottom: 23%;
opacity: 0.02;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(86) {
left: 89%;
bottom: 84%;
opacity: 0.59;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(87) {
left: 82%;
bottom: 27%;
opacity: 0.06;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(88) {
left: 41%;
bottom: 21%;
opacity: -0.2;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(89) {
left: 30%;
bottom: 88%;
opacity: 0.41;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(90) {
left: 91%;
bottom: 58%;
opacity: 0.38;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(91) {
left: 20%;
bottom: 9%;
opacity: -0.19;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(92) {
left: 28%;
bottom: 89%;
opacity: 0.53;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(93) {
left: 5%;
bottom: 87%;
opacity: 0.53;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(94) {
left: 16%;
bottom: 92%;
opacity: 0.67;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(95) {
left: 41%;
bottom: 62%;
opacity: 0.24;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(96) {
left: 46%;
bottom: 40%;
opacity: 0.02;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(97) {
left: 63%;
bottom: 36%;
opacity: 0.17;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(98) {
left: 1%;
bottom: 42%;
opacity: 0.39;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(99) {
left: 52%;
bottom: 69%;
opacity: 0.28;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(100) {
left: 11%;
bottom: 83%;
opacity: 0.64;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(101) {
left: 48%;
bottom: 94%;
opacity: 0.57;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(102) {
left: 6%;
bottom: 4%;
opacity: -0.42;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(103) {
left: 57%;
bottom: 14%;
opacity: 0.05;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(104) {
left: 30%;
bottom: 83%;
opacity: 0.7;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(105) {
left: 29%;
bottom: 53%;
opacity: 0.5;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(106) {
left: 28%;
bottom: 16%;
opacity: -0.16;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(107) {
left: 46%;
bottom: 29%;
opacity: 0.14;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(108) {
left: 77%;
bottom: 43%;
opacity: 0.27;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(109) {
left: 16%;
bottom: 0%;
opacity: -0.21;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(110) {
left: 12%;
bottom: 51%;
opacity: 0.45;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(111) {
left: 37%;
bottom: 94%;
opacity: 0.59;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(112) {
left: 15%;
bottom: 78%;
opacity: 0.33;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(113) {
left: 44%;
bottom: 30%;
opacity: 0.07;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(114) {
left: 76%;
bottom: 33%;
opacity: 0.16;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(115) {
left: 29%;
bottom: 29%;
opacity: 0.24;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(116) {
left: 17%;
bottom: 78%;
opacity: 0.68;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(117) {
left: 95%;
bottom: 30%;
opacity: 0.25;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(118) {
left: 96%;
bottom: 65%;
opacity: 0.46;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(119) {
left: 64%;
bottom: 10%;
opacity: -0.35;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(120) {
left: 64%;
bottom: 87%;
opacity: 0.54;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(121) {
left: 87%;
bottom: 9%;
opacity: -0.22;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(122) {
left: 65%;
bottom: 75%;
opacity: 0.64;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(123) {
left: 91%;
bottom: 41%;
opacity: 0.27;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(124) {
left: 4%;
bottom: 46%;
opacity: -0.01;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(125) {
left: 1%;
bottom: 41%;
opacity: -0.06;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(126) {
left: 33%;
bottom: 62%;
opacity: 0.35;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(127) {
left: 27%;
bottom: 9%;
opacity: -0.13;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(128) {
left: 45%;
bottom: 81%;
opacity: 0.53;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(129) {
left: 39%;
bottom: 18%;
opacity: 0.13;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(130) {
left: 96%;
bottom: 7%;
opacity: -0.41;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(131) {
left: 1%;
bottom: 0%;
opacity: -0.2;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(132) {
left: 88%;
bottom: 31%;
opacity: 0.21;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(133) {
left: 37%;
bottom: 95%;
opacity: 0.49;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(134) {
left: 73%;
bottom: 94%;
opacity: 0.62;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(135) {
left: 46%;
bottom: 19%;
opacity: -0.14;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(136) {
left: 13%;
bottom: 80%;
opacity: 0.65;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(137) {
left: 43%;
bottom: 79%;
opacity: 0.53;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(138) {
left: 57%;
bottom: 70%;
opacity: 0.23;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(139) {
left: 13%;
bottom: 67%;
opacity: 0.31;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(140) {
left: 43%;
bottom: 58%;
opacity: 0.22;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(141) {
left: 22%;
bottom: 74%;
opacity: 0.54;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(142) {
left: 83%;
bottom: 20%;
opacity: 0.18;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(143) {
left: 60%;
bottom: 48%;
opacity: 0.04;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(144) {
left: 82%;
bottom: 40%;
opacity: -0.04;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(145) {
left: 38%;
bottom: 27%;
opacity: 0.05;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(146) {
left: 60%;
bottom: 80%;
opacity: 0.55;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(147) {
left: 91%;
bottom: 73%;
opacity: 0.52;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(148) {
left: 21%;
bottom: 52%;
opacity: 0.08;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(149) {
left: 91%;
bottom: 18%;
opacity: -0.16;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(150) {
left: 2%;
bottom: 41%;
opacity: 0.4;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(151) {
left: 76%;
bottom: 99%;
opacity: 0.93;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(152) {
left: 89%;
bottom: 88%;
opacity: 0.46;
animation: 4s flickr -1s infinite;
}
.frame .star:nth-child(153) {
left: 77%;
bottom: 4%;
opacity: -0.4;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(154) {
left: 15%;
bottom: 18%;
opacity: 0.02;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(155) {
left: 82%;
bottom: 92%;
opacity: 0.78;
animation: 3s flickr -1s infinite;
}
.frame .star:nth-child(156) {
left: 13%;
bottom: 19%;
opacity: -0.28;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(157) {
left: 4%;
bottom: 93%;
opacity: 0.68;
animation: 2s flickr -1s infinite;
}
.frame .star:nth-child(158) {
left: 56%;
botto.........完整代码请登录后点击上方下载按钮下载查看
网友评论0