A little rocket climbs on the diagonal with a flickering exhaust flame while stars streak past. Drawn as one small SVG; the flame flicker is a scaleY from the nozzle.
Also known as: rocket launch animation, rocket loading css, spaceship loader.
<div class="ldr-rocket" role="status" aria-label="Loading">
<svg viewBox="5 5 38 38" aria-hidden="true">
<g transform="rotate(45 24 24)">
<path class="ldr-rocket-star" d="M8 6v5"/>
<path class="ldr-rocket-star" d="M40 2v5"/>
<path class="ldr-rocket-star" d="M11 26v4"/>
<path class="ldr-rocket-star" d="M37 20v4"/>
<g class="ldr-rocket-ship">
<path class="ldr-rocket-flame" d="M20.5 33Q24 46 27.5 33Z"/>
<path fill-rule="evenodd" d="M24 5c6 6 7 16 5 27H19c-2-11-1-21 5-27zM24 14.5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 1 0 0-7z"/>
<path d="M19 22l-5 7v5l5-3zM29 22l5 7v5l-5-3z"/>
</g>
</g>
</svg>
</div>.ldr-rocket {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
width: var(--s);
height: var(--s);
}
.ldr-rocket svg {
display: block;
width: 100%;
height: 100%;
fill: var(--c);
}
.ldr-rocket-ship {
animation: ldr-rocket-surge 1.2s ease-in-out infinite alternate;
}
.ldr-rocket-flame {
fill: color-mix(in srgb, var(--ldr-color, #3b82f6) 60%, transparent);
transform-box: fill-box;
transform-origin: 50% 0;
animation: ldr-rocket-flicker 0.14s ease-in-out infinite alternate;
}
.ldr-rocket-star {
fill: none;
stroke: color-mix(in srgb, var(--ldr-color, #3b82f6) 55%, transparent);
stroke-width: 2;
stroke-linecap: round;
animation: ldr-rocket-streak 0.9s linear infinite;
}
.ldr-rocket-star:nth-child(2) { animation-delay: -0.3s; }
.ldr-rocket-star:nth-child(3) { animation-delay: -0.55s; }
.ldr-rocket-star:nth-child(4) { animation-delay: -0.75s; }
@keyframes ldr-rocket-surge {
from { transform: translateY(3%); }
to { transform: translateY(-4%); }
}
@keyframes ldr-rocket-flicker {
from { transform: scaleY(0.6); }
to { transform: scaleY(1.1); }
}
@keyframes ldr-rocket-streak {
0% { transform: translateY(-40%); opacity: 0; }
30% { opacity: 1; }
100% { transform: translateY(70%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.ldr-rocket, .ldr-rocket *, .ldr-rocket::before, .ldr-rocket::after, .ldr-rocket *::before, .ldr-rocket *::after {
animation-duration: 3s;
}
}--ldr-color on the element or a parent.
Currently previewing #3b82f6.--ldr-size. Every dimension in the snippet is
derived from it. Currently previewing 64px.animation shorthand.
Delays on the children are relative, so they keep their rhythm.role="status" and an
aria-label so screen readers announce the wait. The reduced-motion rule
at the end slows the animation for users who asked for less motion.