Write a single, standalone SVG code (no HTML/CSS/JS external dependencies) that creates an animated, layered, and synchronized SVG scene depicting a mechanical solar system with the following specifications:
Structure & Elements
A central glowing sun with a pulsating outer corona, using an animated radial gradient and a feGaussianBlur filter.
Five orbiting planets, each on a unique elliptical orbit (different eccentricities and axes).
Each planet must:
code
Orbit the sun at different speeds, looping infinitely and smoothly.
Be rendered as a group (<g>) containing:
The planet (solid color or gradient),
An animated rotating ring (like Saturn's) using transform and animateTransform.
A shadow that rotates with the planet but shifts dynamically depending on position in orbit.
One of the planets must have a moon orbiting it, with synchronized secondary orbit logic.
Animations & Interactions
Use only SVG native animations (, , etc.)—no SMIL polyfill or JavaScript.
All orbits should use with animateMotion, and motion paths must be visible as faint, glowing lines.
Animate the sun’s corona with a time-offset breathing/pulsing effect using on r, opacity, and stop-color.
Animate eclipses when the moon moves in front of or behind its planet using or .
Visual & Technical Challenges
Add a glow effect around the sun and planets using SVG filters ( with feMerge, feOffset, etc.).
Use transforms with origin logic to ensure proper rotation of rings and moons.
Define custom gradients (radial for planets, linear for shadows), and apply dynamic animation to the gradient stops.
Add a background nebula layer with animated stars (twinkling, fading using opacity animation).
Ensure responsive scaling with viewBox and preserveAspectRatio, and keep animation proportions correct.
Constraints
The entire scene must work without any external scripts or styles—pure SVG only.
File must be a single self-contained tag.
Animation must loop indefinitely with no abrupt transitions.
No JavaScript or external CSS—only declarative SVG.
Optional (Bonus Complexity)
code
Assistant
Include a time-lapse indicator: a rotating outer gear that ticks once per full planetary cycle, using a complex path and synchronized timing.
Use begin attributes on animations to chain events (e.g. moon orbit begins after a certain fraction of the planet’s orbit).
Here's a standalone SVG that meets all your requirements, creating an animated mechanical solar system with a glowing sun, orbiting planets with rings and shadows, a moon with eclipse effects, and a nebula background:
A glowing sun with animated corona using radial gradients and filters
Five planets with:
Unique elliptical orbits
Different rotation speeds
Animated rings (for some planets)
Dynamic shadows that follow the planet's position
Glow effects using SVG filters
A moon orbiting one planet with eclipse effects using masks
An animated nebula background with twinkling stars
Visible orbit paths
A time-lapse gear indicator (bonus feature)
All animations are synchronized and loop smoothly
Pure SVG with no external dependencies
The animation uses only SVG's native animation elements (<animate>, <animateMotion>, <animateTransform>) and maintains proper proportions with the viewBox attribute.