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

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

One HTML file. Save it and open it in any browser.Open full screen

Example: Prairie Energy Pyramid, a clickable explainer of the 10 percent rule.

Click or tap any of the five pyramid levels, from grasses up to hawks. The panel counts up that level's energy, shows how much came from the level below, and animates a stacked bar of where it goes: 10% up, the rest lost as heat or waste. Use the ↑ and ↓ keys to climb, and flip the comparison chart between linear and log scale to see the steady drop.

Written by AI from this prompt. Your results will vary.

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 in Infographics