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;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0