css实现月牙中的星空流星动画效果

代码语言:html

所属分类:动画

代码描述:css实现月牙中的星空流星动画效果

代码标签: 中的 星空 流星 动画 效果

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


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

<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Anton'>
<style>
body {
  background: #ffe645;
  height: 100vh;
  overflow: hidden;
  display: -webkit-box;
  display: flex;
  font-family: 'Anton', sans-serif;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
}

.night {
  position: relative;
  width: 300px;
  height: 300px;
}
.night::after {
  content: '';
  position: absolute;
  left: 35%;
  width: 100%;
  height: 100%;
  background: #ffe645;
  border-radius: 100%;
  -webkit-transform: scale(1.1);
          transform: scale(1.1);
}
.night::before {
  content: '';
  position: absolute;
  bottom: -3%;
  left: -10%;
  width: 70%;
  height: 6%;
  background: #edcd2b;
  border-radius: 100%;
}

.window {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(-45deg, #0a1433 0%, #222b3f 100%);
  border-radius: 100%;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 1px;
  height: 1px;
}
.star:nth-child(1) {
  top: 92%;
  left: 96%;
  background: #9c9c9c;
}
.star:nth-child(2) {
  top: 97%;
  left: 47%;
  background: #b1b1b1;
}
.star:nth-child(3) {
  top: 12%;
  left: 58%;
  background: #949494;
}
.star:nth-child(4) {
  top: 13%;
  left: 33%;
  background: #929292;
}
.star:nth-child(5) {
  top: 19%;
  left: 49%;
  background: gainsboro;
}
.star:nth-child(6) {
  top: 57%;
  left: 25%;
  background: #a4a4a4;
}
.star:nth-child(7) {
  top: 68%;
  left: 62%;
  background: #181818;
}
.star:nth-child(8) {
  top: 38%;
  left: 48%;
  background: #474747;
}
.star:nth-child(9) {
  top: 30%;
  left: 20%;
  background: #121212;
}
.star:nth-child(10) {
  top: 41%;
  left: 93%;
  background: whitesmoke;
}
.star:nth-child(11) {
  top: 2%;
  left: 11%;
  background: #3b3b3b;
}
.star:nth-child(12) {
  top: 14%;
  left: 82%;
  background: #f2f2f2;
}
.star:nth-child(13) {
  top: 76%;
  left: 13%;
  background: #353535;
}
.star:nth-child(14) {
  top: 70%;
  left: 4%;
  background: #848484;
}
.star:nth-child(15) {
  top: 85%;
  left: 76%;
  background: #292929;
}
.star:nth-child(16) {
  top: 39%;
  left: 82%;
  background: #d1d1d1;
}
.star:nth-child(17) {
  top: 67%;
  left: 54%;
  background: #bebebe;
}
.star:nth-child(18) {
  top: 49%;
  left: 82%;
  background: #161616;
}
.star:nth-child(19) {
  top: 9%;
  left: 18%;
  background: #545454;
}
.star:nth-child(20) {
  top: 93%;
  left: 9%;
  background: #232323;
}
.star:nth-child(21) {
  top: 14%;
  left: 17%;
  background: #fefefe;
}
.star:nth-child(22) {
  top: 73%;
  left: 9%;
  background: #606060;
}
.star:nth-child(23) {
  top: 64%;
  left: 69%;
  background: #4c4c4c;
}
.star:nth-child(24) {
  top: 21%;
  left: 1%;
  background: #535353;
}
.star:nth-child(25) {
  top: 58%;
  left: 53%;
  background: #5e5e5e;
}
.star:nth-child(26) {
  top: 79%;
  left: 85%;
  background: #262626;
}
.star:nth-child(27) {
  top: 41%;
  left: 54%;
  background: #d2d2d2;
}
.star:nth-child(28) {
  top: 35%;
  left: 5%;
  background: #b9b9b9;
}
.star:nth-child(29) {
  top: 39%;
  left: 4%;
  background: #4b4b4b;
}
.star:nth-child(30) {
  top: 6%;
  left: 56%;
  background: #7e7e7e;
}
.star:nth-child(31) {
  top: 74%;
  left: 3%;
  background: #787878;
}
.star:nth-child(32) {
  top: 70%;
  left: 35%;
  background: #131313;
}
.star:nth-child(33) {
  top: 82%;
  left: 41%;
  background: #c1c1c1;
}
.star:nth-child(34) {
  top: 30%;
  left: 89%;
  background: #979797;
}
.star:nth-child(35) {
  top: 79%;
  left: 9%;
  background: #dedede;
}
.star:nth-child(36) {
  top: 32%;
  left: 71%;
  background: #3c3c3c;
}
.star:nth-child(37) {
  top: 72%;
  left: 17%;
  background: #6e6e6e;
}
.star:nth-child(38) {
  top: 38%;
  left: 7%;
  background: #f6f6f6;
}
.star:nth-child(39) {
  top: 29%;
  left: 65%;
  background: #dbdbdb;
}
.star:nth-child(40) {
  top: 1%;
  left: 73%;
  background: #a7a7a7;
}
.star:nth-child(41) {
  top: 42%;
  left: 52%;
  background: #4b4b4b;
}
.star:nth-child(42) {
  top: 61%;
  left: 30%;
  background: #686868;
}
.star:nth-child(43) {
  top: 93%;
  left: 37%;
  background: #777777;
}
.star:nth-child(44) {
  top: 33%;
  left: 38%;
  background: #8e8e8e;
}
.star:nth-child(45) {
  top: 64%;
  left: 11%;
  background: #252525;
}
.star:nth-child(46) {
  top: 13%;
  left: 60%;
  background: #b3b3b3;
}
.star:nth-child(47) {
  top: 34%;
  left: 47%;
  background: #cccccc;
}
.star:nth-child(48) {
  top: 80%;
  left: 86%;
  background: #949494;
}
.star:nth-child(49) {
  top: 36%;
  left: 35%;
  background: #adadad;
}
.star:nth-child(50) {
  top: 57%;
  left: 82%;
  background: #bcbcbc;
}
.star:nth-child(51) {
  top: 22%;
  left: 97%;
  background: #1b1b1b;
}
.star:nth-child(52) {
  top: 83%;
  left: 87%;
  background: dimgray;
}
.star:nth-child(53) {
  top: 10%;
  left: 8%;
  background: #cdcdcd;
}
.star:nth-child(54) {
  top: 8%;
  left: 97%;
  background: #626262;
}
.star:nth-child(55) {
  top: 27%;
  left: 85%;
  background: #939393;
}
.star:nth-child(56) {
  top: 100%;
  left: 1%;
  background: #404040;
}
.star:nth-child(57) {
  top: 45%;
  left: 56%;
  background: #1b1b1b;
}
.star:nth-child(58) {
  top: 58%;
  left: 78%;
  background: #a6a6a6;
}
.star:nth-child(59) {
  top: 48%;
  left: 46%;
  background: #3f3f3f;
}
.star:nth-child(60) {
  top: 1%;
  left: 81%;
  background: #888888;
}
.star:nth-child(61) {
  top: 17%;
  left: 36%;
  background: #a0a0a0;
}
.star:nth-child(62) {
  top: 14%;
  left: 9%;
  background: #898989;
}
.star:nth-child(63) {
  top: 64%;
  left: 92%;
  background: #0d0d0d;
}
.star:nth-child(64) {
  top: 43%;
  left: 82%;
  background: #3e3e3e;
}
.star:nth-child(65) {
  top: 80%;
  left: 51%;
  background: #a5a5a5;
}
.star:nth-child(66) {
  top: 40%;
  left: 62%;
  background: #fcfcfc;
}
.star:nth-child(67) {
  top: 98%;
  left: 72%;
  background: #101010;
}
.star:nth-child(68) {
  top: 47%;
  left: 1%;
  background: #6c6c6c;
}
.star:nth-child(69) {
  top: 64%;
  left: 40%;
  background: #868686;
}
.star:nth-child(70) {
  top: 6%;
  left: 58%;
  background: #373737;
}
.star:nth-child(71) {
  top: 98%;
  left: 64%;
  background: #cbcbcb;
}
.star:nth-child(72) {
  top: 93%;
  left: 46%;
  background: #9f9f9f;
}
.star:nth-child(73) {
  top: 85%;
  left: 73%;
  background: lightgray;
}
.star:nth-child(74) {
  top: 85%;
  left: 67%;
  background: #efefef;
}
.star:nth-child(75) {
  top: 23%;
  left: 33%;
  background: #787878;
}
.star:nth-child(76) {
  top: 19%;
  left: 84%;
  background: #d9d9d9;
}
.star:nth-child(77) {
  top: 92%;
  left: 8%;
  background: #a2a2a2;
}
.star:nth-child(78) {
  top: 34%;
  left: 4%;
  background: #c7c7c7;
}
.star:nth-child(79) {
  top: 30%;
  left: 33%;
  background: #cdcdcd;
}
.star:nth-child(80) {
  top: 62%;
  left: 32%;
  background: #0d0d0d;
}
.star:nth-child(81) {
  top: 3%;
  left: 44%;
  background: #3a3a3a;
}
.star:nth-child(82) {
  top: 18%;
  left: 33%;
  background: #2f2f2f;
}
.star:nth-child(83) {
  top: 38%;
  left: 7%;
  background: #b0b0b0;
}
.star:nth-child(84) {
  top: 68%;
  left: 89%;
  background: #828282;
}
.star:nth-child(85) {
  top: 92%;
  left: 56%;
  background: #f8f8f8;
}
.star:nth-child(86) {
  top: 80%;
  left: 86%;
  background: #2a2a2a;
}
.star:nth-child(87) {
  top: 81%;
  left: 57%;
  background: #1b1b1b;
}
.star:nth-child(88) {
  top: 60%;
  left: 7%;
  background: #f7f7f7;
}
.star:nth-child(89) {
  top: 4%;
  left: 61%;
  background: #dfdfdf;
}
.star:nth-child(90) {
  top: 90%;
  left: 87%;
  background: #c5c5c5;
}
.star:nth-child(91) {
  top: 37%;
  left: 94%;
  background: #d2d2d2;
}
.star:nth-child(92) {
  top: 10%;
  left: 25%;
  background: #e9e9e9;
}
.star:nth-child(93) {
  top: 21%;
  left: 7%;
  background: #747474;
}
.star:nth-child(94) {
  top: 21%;
  left: 21%;
  background: #1f1f1f;
}
.star:nth-child(95) {
  top: 56%;
  left: 46%;
  background: #bebebe;
}
.star:nth-child(96) {
  top: 62%;
  left: 93%;
  background: #6b6b6b;
}
.star:nth-child(97) {
  top: 26%;
  left: 29%;
  background: #1d1d1d;
}
.star:nth-child(98) {
  top: 20%;
  left: 23%;
  background: #aeaeae;
}
.star:nth-child(99) {
  top: 70%;
  left: 67%;
  background: #383838;
}
.star:nth-child(100) {
  top: 91%;
  left: 87%;
  background: #585858;
}
.star:nth-child(101) {
  top: 94%;
  left: 35%;
  background: #141414;
}
.star:nth-child(102) {
  top: 28%;
  left: 93%;
  background: #737373;
}
.star:nth-child(103) {
  top: 27%;
  left: 17%;
  background: #666666;
}
.star:nth-child(104) {
  top: 48%;
  left: 76%;
  background: #555555;
}
.star:nth-child(105) {
  top: 18%;
  left: 18%;
  background: #656565;
}
.star:nth-child(106) {
  top: 37%;
  left: 78%;
  background: #797979;
}
.star:nth-child(107) {
  top: 31%;
  left: 96%;
  background: #b4b4b4;
}
.star:nth-child(108) {
  top.........完整代码请登录后点击上方下载按钮下载查看

网友评论0