Build a Labeled Solar System Scale Infographic with Planet Fact Cards in HTML
A single HTML file that switches the solar system between a readable view and a true-distance view, with clickable planet fact cards and a live scale check.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
You are a front-end developer and science-education designer. Build "Orbit Ruler," a one-page infographic that shows the Sun and the eight planets in a row. Students can switch between a readable view and a true-distance view to see why textbook diagrams distort scale.
Content: Mercury to Neptune with accurate rounded data. For each planet include diameter in km, size compared with Earth, distance in AU and in million km, length of day, length of year, known moons, sunlight travel time, and one surprising fact.
Rules:
1. Add a two-button segmented toggle. "Readable view" spaces the planets evenly, sizes them by the square root of diameter, shows a large Sun arc at the left edge and a "not to scale" badge. "True distances" places the planets in proportion to AU along a 0-30 AU axis, with the dots enlarged and labeled as enlarged. The S key also toggles.
2. Animate between views in about 0.9 s. Switch instantly under prefers-reduced-motion.
3. Under the chart, show a live "scale check" sentence. Calculate it from the current pixel sizes: how far away Earth would really be in pixels and chart widths, or how wide the Sun and Earth would really be.
4. Clicking a planet or a chip button opens its fact card. Arrow keys move between the chips.
5. In the true view, replace the crowded inner-planet labels with one bracket labeled Mercury to Mars.
6. Use a dark navy palette with one gold accent, system fonts and inline SVG only. Make the layout responsive from 360 to 1280 px and redraw on resize.
Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.Example output
Tips and common edits
Why this works
- Naming two exact layouts (square-root sizes vs AU positions) gives the model formulas, not vague art direction, so the scale contrast appears first time.
- The live scale-check sentence turns the visual into a lesson by computing real pixel distances from the current drawing.
- Chip buttons alongside the SVG keep tiny true-scale planets clickable and keyboard reachable.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as orbit-ruler.html and open it in any browser, or view it in the chat's canvas or preview. No internet or installs needed.
Common edits
- Add Pluto, Ceres and the asteroid belt as extra entries, or swap the facts for ones aligned with your curriculum.
- Add a third True sizes view that draws the planets at real relative diameters next to a slice of the Sun.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a 100-Person Icon Array Demographic Infographic in One HTML File
You get a single HTML file that shows a fictional town as 100 SVG person icons, with tabs for commute, age and housing and an interactive legend that highlights each group.
Build a Classroom Grade Distribution Infographic with Histogram and Quartiles
A single HTML file that turns an inline array of class scores into a histogram with mean and median markers, a box plot, stat cards and a plain-language summary.
Build a Gantt-Style Project Timeline Infographic with Milestones in Pure SVG
A single HTML file that draws a project Gantt chart in pure SVG, with progress bars, dependency arrows, milestone diamonds, a Today marker and hover tooltips.
Build a Mitosis vs Meiosis Comparison Infographic in a Single HTML File
Get a ready-to-open infographic that lines up mitosis and meiosis phase by phase, with SVG cell diagrams and a toggle that highlights only the differences.
Build a Real Estate Listing One-Pager with Clickable Floor Plan and Mortgage Slider
A polished single-file property listing page with an interactive SVG floor plan, key-feature icons and a live monthly mortgage estimate driven by sliders.
Build a Scientific Method Explainer Infographic With a Worked Plant Experiment
An interactive single-file infographic that walks through the eight steps of the scientific method, pairing each definition with a running bean-seedling light experiment and a live data chart.