
:root {
  --primary-color: hsl(196, 78%, 61%);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at bottom, #0d1d31 0%, #0c0d13 100%);
  overflow: hidden;
}

.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  transform: rotate(-45deg);
}

.star {
  --star-color: var(--primary-color);
  --star-tail-length: 6em;
  --star-tail-height: 2px;
  --star-width: calc(var(--star-tail-length) / 6);
  --fall-duration: 9s;
  --tail-fade-duration: var(--fall-duration);
  position: absolute;
  top: var(--top-offset);
  left: 0;
  width: var(--star-tail-length);
  height: var(--star-tail-height);
  color: var(--star-color);
  background: linear-gradient(45deg, currentColor, transparent);
  border-radius: 50%;
  filter: drop-shadow(0 0 6px currentColor);
  transform: translate3d(104em, 0, 0);
  animation: fall var(--fall-duration) var(--fall-delay) linear infinite, tail-fade var(--tail-fade-duration) var(--fall-delay) ease-out infinite;
}
@media screen and (max-width: 750px) {
  .star {
    animation: fall var(--fall-duration) var(--fall-delay) linear infinite;
  }
}
.star:nth-child(1) {
  --star-tail-length: 6.61em;
  --top-offset: 46.57vh;
  --fall-duration: 11.173s;
  --fall-delay: 3.79s;
}
.star:nth-child(2) {
  --star-tail-length: 6.42em;
  --top-offset: 73.32vh;
  --fall-duration: 11.31s;
  --fall-delay: 7.497s;
}
.star:nth-child(3) {
  --star-tail-length: 6.85em;
  --top-offset: 71.32vh;
  --fall-duration: 6.283s;
  --fall-delay: 9.399s;
}
.star:nth-child(4) {
  --star-tail-length: 6.22em;
  --top-offset: 50.77vh;
  --fall-duration: 6.628s;
  --fall-delay: 9.917s;
}
.star:nth-child(5) {
  --star-tail-length: 5.59em;
  --top-offset: 32.86vh;
  --fall-duration: 8.792s;
  --fall-delay: 7.189s;
}
.star:nth-child(6) {
  --star-tail-length: 7.44em;
  --top-offset: 77.53vh;
  --fall-duration: 7.435s;
  --fall-delay: 7.225s;
}
.star:nth-child(7) {
  --star-tail-length: 7.44em;
  --top-offset: 33.98vh;
  --fall-duration: 8.382s;
  --fall-delay: 6.565s;
}
.star:nth-child(8) {
  --star-tail-length: 6.16em;
  --top-offset: 70.6vh;
  --fall-duration: 10.935s;
  --fall-delay: 3.593s;
}
.star:nth-child(9) {
  --star-tail-length: 5.53em;
  --top-offset: 52.86vh;
  --fall-duration: 11.18s;
  --fall-delay: 1.933s;
}
.star:nth-child(10) {
  --star-tail-length: 6.46em;
  --top-offset: 42.66vh;
  --fall-duration: 8.824s;
  --fall-delay: 8.234s;
}
.star:nth-child(11) {
  --star-tail-length: 7.37em;
  --top-offset: 42.33vh;
  --fall-duration: 6.128s;
  --fall-delay: 2.292s;
}
.star:nth-child(12) {
  --star-tail-length: 7.15em;
  --top-offset: 60.89vh;
  --fall-duration: 7.167s;
  --fall-delay: 5.321s;
}
.star:nth-child(13) {
  --star-tail-length: 6.47em;
  --top-offset: 80.85vh;
  --fall-duration: 9.54s;
  --fall-delay: 2.671s;
}
.star:nth-child(14) {
  --star-tail-length: 5.51em;
  --top-offset: 94.25vh;
  --fall-duration: 10.821s;
  --fall-delay: 2.163s;
}
.star:nth-child(15) {
  --star-tail-length: 5.63em;
  --top-offset: 2vh;
  --fall-duration: 7.985s;
  --fall-delay: 2.475s;
}
.star:nth-child(16) {
  --star-tail-length: 7.13em;
  --top-offset: 82.92vh;
  --fall-duration: 8.73s;
  --fall-delay: 9.406s;
}
.star:nth-child(17) {
  --star-tail-length: 7.21em;
  --top-offset: 85.68vh;
  --fall-duration: 8.917s;
  --fall-delay: 6.255s;
}
.star:nth-child(18) {
  --star-tail-length: 6.27em;
  --top-offset: 30.08vh;
  --fall-duration: 11.438s;
  --fall-delay: 0.656s;
}
.star:nth-child(19) {
  --star-tail-length: 6.28em;
  --top-offset: 47.64vh;
  --fall-duration: 9.366s;
  --fall-delay: 4.919s;
}
.star:nth-child(20) {
  --star-tail-length: 7.15em;
  --top-offset: 58.96vh;
  --fall-duration: 6.118s;
  --fall-delay: 5.717s;
}
.star:nth-child(21) {
  --star-tail-length: 7.21em;
  --top-offset: 46.79vh;
  --fall-duration: 8.54s;
  --fall-delay: 4.027s;
}
.star:nth-child(22) {
  --star-tail-length: 5.43em;
  --top-offset: 41.37vh;
  --fall-duration: 10.989s;
  --fall-delay: 3.588s;
}
.star:nth-child(23) {
  --star-tail-length: 6.23em;
  --top-offset: 73.9vh;
  --fall-duration: 7.211s;
  --fall-delay: 3.431s;
}
.star:nth-child(24) {
  --star-tail-length: 6.17em;
  --top-offset: 36.05vh;
  --fall-duration: 9.574s;
  --fall-delay: 4.699s;
}
.star:nth-child(25) {
  --star-tail-length: 6.39em;
  --top-offset: 9.03vh;
  --fall-duration: 6.193s;
  --fall-delay: 6.544s;
}
.star:nth-child(26) {
  --star-tail-length: 7.47em;
  --top-offset: 74.07vh;
  --fall-duration: 10.44s;
  --fall-delay: 9.084s;
}
.star:nth-child(27) {
  --star-tail-length: 5.4em;
  --top-offset: 34.92vh;
  --fall-duration: 7.374s;
  --fall-delay: 4.736s;
}
.star:nth-child(28) {
  --star-tail-length: 6.15em;
  --top-offset: 89.36vh;
  --fall-duration: 6.168s;
  --fall-delay: 0.338s;
}
.star:nth-child(29) {
  --star-tail-length: 6.93em;
  --top-offset: 10.61vh;
  --fall-duration: 6.284s;
  --fall-delay: 1.519s;
}
.star:nth-child(30) {
  --star-tail-length: 5.52em;
  --top-offset: 16.27vh;
  --fall-duration: 7.758s;
  --fall-delay: 9.724s;
}
.star:nth-child(31) {
  --star-tail-length: 7.46em;
  --top-offset: 31.69vh;
  --fall-duration: 6.27s;
  --fall-delay: 5.548s;
}
.star:nth-child(32) {
  --star-tail-length: 5.32em;
  --top-offset: 97.58vh;
  --fall-duration: 9.97s;
  --fall-delay: 9.636s;
}
.star:nth-child(33) {
  --star-tail-length: 5.94em;
  --top-offset: 58.04vh;
  --fall-duration: 10.378s;
  --fall-delay: 2.113s;
}
.star:nth-child(34) {
  --star-tail-length: 6.42em;
  --top-offset: 9.04vh;
  --fall-duration: 9.517s;
  --fall-delay: 0.089s;
}
.star:nth-child(35) {
  --star-tail-length: 5.34em;
  --top-offset: 76.85vh;
  --fall-duration: 8.645s;
  --fall-delay: 8.891s;
}
.star:nth-child(36) {
  --star-tail-length: 5.77em;
  --top-offset: 57.07vh;
  --fall-duration: 7.735s;
  --fall-delay: 8.189s;
}
.star:nth-child(37) {
  --star-tail-length: 6.14em;
  --top-offset: 86.59vh;
  --fall-duration: 10.919s;
  --fall-delay: 1.287s;
}
.star:nth-child(38) {
  --star-tail-length: 5.16em;
  --top-offset: 39.41vh;
  --fall-duration: 10.305s;
  --fall-delay: 2.86s;
}
.star:nth-child(39) {
  --star-tail-length: 6.86em;
  --top-offset: 53.83vh;
  --fall-duration: 6.799s;
  --fall-delay: 6.331s;
}
.star:nth-child(40) {
  --star-tail-length: 7.16em;
  --top-offset: 33.88vh;
  --fall-duration: 10.635s;
  --fall-delay: 6.411s;
}
.star:nth-child(41) {
  --star-tail-length: 6.79em;
  --top-offset: 64.82vh;
  --fall-duration: 8.882s;
  --fall-delay: 1.87s;
}
.star:nth-child(42) {
  --star-tail-length: 5.57em;
  --top-offset: 27.57vh;
  --fall-duration: 8.722s;
  --fall-delay: 3.211s;
}
.star:nth-child(43) {
  --star-tail-length: 6.09em;
  --top-offset: 56.13vh;
  --fall-duration: 7.469s;
  --fall-delay: 5.673s;
}
.star:nth-child(44) {
  --star-tail-length: 5.58em;
  --top-offset: 39.2vh;
  --fall-duration: 11.278s;
  --fall-delay: 0.895s;
}
.star:nth-child(45) {
  --star-tail-length: 5.77em;
  --top-offset: 5.45vh;
  --fall-duration: 9.364s;
  --fall-delay: 7.1s;
}
.star:nth-child(46) {
  --star-tail-length: 5.62em;
  --top-offset: 83.44vh;
  --fall-duration: 6.202s;
  --fall-delay: 9.594s;
}
.star:nth-child(47) {
  --star-tail-length: 6.33em;
  --top-offset: 20.71vh;
  --fall-duration: 9.04s;
  --fall-delay: 9.188s;
}
.star:nth-child(48) {
  --star-tail-length: 5.96em;
  --top-offset: 19.07vh;
  --fall-duration: 10.299s;
  --fall-delay: 3.712s;
}
.star:nth-child(49) {
  --star-tail-length: 5.18em;
  --top-offset: 12.63vh;
  --fall-duration: 11.8s;
  --fall-delay: 7.502s;
}
.star:nth-child(50) {
  --star-tail-length: 6.57em;
  --top-offset: 44.92vh;
  --fall-duration: 11.584s;
  --fall-delay: 3.375s;
}
.star::before, .star::after {
  position: absolute;
  content: "";
  top: 0;
  left: calc(var(--star-width) / -2);
  width: var(--star-width);
  height: 100%;
  background: linear-gradient(45deg, transparent, currentColor, transparent);
  border-radius: inherit;
  animation: blink 2s linear infinite;
}
.star::before {
  transform: rotate(45deg);
}
.star::after {
  transform: rotate(-45deg);
}

@keyframes fall {
  to {
    transform: translate3d(-30em, 0, 0);
  }
}
@keyframes tail-fade {
  0%, 50% {
    width: var(--star-tail-length);
    opacity: 1;
  }
  70%, 80% {
    width: 0;
    opacity: 0.4;
  }
  100% {
    width: 0;
    opacity: 0;
  }
}
@keyframes blink {
  50% {
    opacity: 0.6;
  }
}

View SCSS Code

