<div class="firework"></div>
body {
  background: #234;
}

@keyframes firework {
  0% { 
    transform: translate(-50%, 60vh);
    width: 0.5vmin;
    opacity: 1;
  }
  50% { 
    width: 0.5vmin;
    opacity: 1;
  }
  100% { 
    width: 45vmin; 
    opacity: 0; 
  }
}

.firework,
.firework::before,
.firework::after {
  --top: 60vh;
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.5vmin;
  aspect-ratio: 1;
  background:
    /* random backgrounds */
    radial-gradient(circle, #ff0 0.2vmin, #0000 0) 50% 00%,
    radial-gradient(circle, #ff0 0.3vmin, #0000 0) 00% 50%,
    radial-gradient(circle, #ff0 0.5vmin, #0000 0) 50% 99%,
    radial-gradient(circle, #ff0 0.2vmin, #0000 0) 99% 50%,
    radial-gradient(circle, #ff0 0.3vmin, #0000 0) 80% 90%,
    radial-gradient(circle, #ff0 0.5vmin, #0000 0) 95% 90%,
    radial-gradient(circle, #ff0 0.5vmin, #0000 0) 10% 60%,
    radial-gradient(circle, #ff0 0.2vmin, #0000 0) 31% 80%,
    radial-gradient(circle, #ff0 0.3vmin, #0000 0) 80% 10%,
    radial-gradient(circle, #ff0 0.2vmin, #0000 0) 90% 23%,
    radial-gradient(circle, #ff0 0.3vmin, #0000 0) 45% 20%,
    radial-gradient(circle, #ff0 0.5vmin, #0000 0) 13% 24%
    ;
  background-size: 0.5vmin 0.5vmin;
  background-repeat: no-repeat;
  animation: firework 2s infinite;
}

.firework::before {
  transform: translate(-50%, -50%) rotate(25deg) !important; 
}

.firework::after {
  transform: translate(-50%, -50%) rotate(-37deg) !important;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.