﻿.star {
    /* 绝对定位 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star span {
    top: 50%;
    left: 50%;
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 50%;
    /* 发光效果 */
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3),0 0 0 4px rgba(255,255,255,0.1), 0 0 10px 4px rgba(255,255,255,1);
    animation: animate 3s linear 1;
}

/* 拖尾效果 */
.star span::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 180px;
    height: 3px;
    transform: translateY(-50%);
    background: linear-gradient(90deg,#fff,transparent);
}

.star span:nth-child(1) {
    top: -10px;
    right: 240px;
    /* initial关键字用于设置CSS属性为它的默认值 */
    left: initial;
    /* 动画延迟时间 */
    animation-delay: 1s;
    /* 动画时长 */
    animation-duration: 2s;
}

/* 流星动画 */
@keyframes animate {
    0% {
        opacity: 1;
        transform: rotate(320deg) translateX(0) scale(1);
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: rotate(320deg) translateX(-2000px) scale(1.2);
    }
}
