45 lines
958 B
CSS
45 lines
958 B
CSS
.stars {
|
|
margin: 0 auto;
|
|
position: fixed;
|
|
top: 0;
|
|
z-index: 2;
|
|
}
|
|
|
|
.star, .r{
|
|
display: block;
|
|
width: 1px;
|
|
background: transparent;
|
|
position: absolute;
|
|
opacity: 0;
|
|
/*过渡动画*/
|
|
animation: star-fall 3s linear;
|
|
}
|
|
|
|
.star:after, .r:after {
|
|
content: '';
|
|
display: block;
|
|
border: 0px solid #fff;
|
|
border-width: 0px 90px 2px 90px;
|
|
border-color: transparent transparent transparent rgba(255, 255, 255, .5);
|
|
box-shadow: 0 0 1px 0 rgba(255, 255, 255, .1);
|
|
/*变形*/
|
|
transform: rotate(225deg) translate3d(1px, 3px, 0);
|
|
transform-origin: 0% 100%;
|
|
}
|
|
|
|
@keyframes star-fall {
|
|
0% {
|
|
opacity: 0;
|
|
transform: scale(0.5) translate3d(0, 0, 0);
|
|
}
|
|
|
|
50% {
|
|
opacity: 1;
|
|
transform: translate3d(200px, 200px, 0);
|
|
}
|
|
|
|
100% {
|
|
opacity: 0;
|
|
transform: scale(1.2) translate3d(300px, 300px, 0);
|
|
}
|
|
} |