Build an Interactive Food Chain Energy Pyramid Infographic in One HTML File
A clickable prairie energy pyramid where each trophic level reveals its energy, the 10 percent passed upward, and animated bars scaled to the real numbers.
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 illustrator who builds clear, interactive teaching graphics.
Build "Prairie Energy Pyramid," an interactive infographic explaining the food chain and energy pyramid of a tallgrass prairie. Show five stacked trophic levels: producers (grasses, 10,000 kcal per m² per year), primary consumers (grasshoppers, voles, bison, 1,000), secondary consumers (frogs, meadowlarks, 100), tertiary consumers (snakes, badgers, 10) and apex predators (hawks, coyotes, 1). Clicking a level reveals how only about 10 percent of its energy passes upward.
Rules:
- Draw the pyramid as clickable CSS trapezoid buttons showing an emoji and the energy value, with a sunlight line under the base. Arrow Up and Down keys move between levels; focus outlines stay visible.
- A detail panel shows the level name, example organisms, an animated count-up of its energy and one plain-language fact.
- Add a stacked bar splitting that level's energy into passed up (10%), body heat (about 60%) and uneaten or waste to decomposers (about 30%), with labeled values; the apex passes nothing up.
- Add a bar chart of all five levels whose bars animate to widths scaled to the numbers, with a linear and log scale toggle.
- Use a warm paper background, one color per level with readable contrast, two columns above 860px stacking down to 360px, and no transitions under prefers-reduced-motion.
- No external libraries, fonts, images or storage.
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
- Giving the exact kcal value for every level means the bars, labels and 10 percent math come out consistent without the model inventing numbers.
- Naming the energy split (10/60/30) and the apex exception gives the stacked bar a clear, correct story for every level.
- The linear and log toggle solves the classic problem of the top levels shrinking to invisible slivers on a linear chart.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as energy-pyramid.html and open it in any browser, or view it in the chat's preview or canvas panel.
Common edits
- Swap the ecosystem: use a kelp forest, coral reef or Arctic tundra with its own organisms, colors and emoji.
- Add a 'step through' button that auto-advances from producers to apex, or a short quiz asking how much energy reaches the hawks.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
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.
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.
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 12-Week Fitness Progress Tracker Infographic in a Single HTML File
Generates a one-page fitness report with bodyweight and lift line charts, personal-record badges, a streak calendar and an instant kg/lb toggle, all from built-in sample data.
Build a Before-and-After Statistics Infographic With Color-Coded Change Arrows
A single HTML infographic comparing two years across nine metrics, showing old and new values, absolute and percent change, and arrows colored by whether up is good.
Build a Before-During-After Field Trip Checklist Infographic in One HTML File
A ready-to-paste prompt that builds a three-phase field trip checklist with tabbed columns, tickable steps, per-phase counters and an overall progress bar.