Blog
CSS Orbit Animation with CSS Keyframes | Live Demo
Try the live demo · Download the source ZIP
CSS keyframes change an element’s transform over time. Rotating an orbit wrapper keeps the center still while its children travel around it. Use a linear timing function for a steady pace and an infinite iteration count to repeat.
<div class="scene">
<div class="center">CSS</div>
<div class="orbit">
<span class="satellite">01</span>
<span class="satellite satellite-two">02</span>
<span class="satellite satellite-three">03</span>
</div>
</div>Position the orbit around the center, then animate a full turn. The duration sets how long one orbit takes.
.orbit {
position: absolute;
width: min(64vw, 390px);
height: min(64vw, 250px);
border: 1px solid #82caff66;
border-radius: 50%;
animation: orbit 18s linear infinite;
}
@keyframes orbit {
to { transform: rotate(360deg); }
}Keep the animation in CSS and use JavaScript only to toggle a paused class, reverse the animation direction, and change a CSS custom property for the duration. Give buttons clear labels, expose their state with aria-pressed, and announce changes through a polite status region.
orbit.classList.toggle('paused');
orbit.classList.toggle('reverse');
document.documentElement.style.setProperty('--orbit-speed', '12s');Decorative animation can distract some visitors. Honor the operating system preference and keep a visible pause button available:
@media (prefers-reduced-motion: reduce) {
.orbit { animation-duration: 60s; }
}Pause or reverse the orbit and adjust its speed. The demo is responsive, keyboard friendly, and has no external dependencies.
Try the live demo · Download the source ZIP
A dedicated rotating wrapper keeps CSS orbit animations simple. Add accessible pause, direction, and speed controls, and reduce motion when visitors request it. Download the standalone project to explore the complete example.
Interactive example
Pause, reverse, or adjust how long each orbit takes. Nothing is sent or saved.
Animation is running at a steady pace.