Build an Animated Water Cycle Step-by-Step Explainer in a Single HTML File
You get one self-contained HTML page with an animated SVG water cycle that walks through five stages, each in one sentence, with next, previous and play controls.
The prompt
Act as a front-end developer who designs clear science explainers for middle-school students. Build "Rain Loop: How the Water Cycle Works", a step-by-step animated infographic in one HTML file. Draw an inline SVG scene (viewBox 800 by 450) with a sun, an ocean, green land with a soil cross-section, a snow-capped mountain, a river, a tree and two clouds. Walk through five stages in order: Evaporation, Transpiration, Condensation, Precipitation and Collection, each narrated in exactly one plain sentence.
Rules:
1. Controls: Previous, Next, a Play/Pause loop button that advances every 5 seconds, and a Motion on/off toggle. Add a row of numbered stage buttons. Left and Right arrow keys step, Space plays or pauses, and clicking a stage label inside the SVG jumps to that stage.
2. The active stage's effects light up at full opacity: rising vapour wisps, dashed flow arrows, droplets forming in darkening clouds, falling rain, and a flowing river and groundwater line. All other effects fade to a faint preview.
3. Below the picture, show the stage name, a colored number badge, the step count out of 5 and the sentence in an aria-live region.
4. Use CSS keyframe animation only. Under prefers-reduced-motion, start with motion off and keep every element visible but still.
5. The layout fits 360 to 1280px wide, the SVG scales with the width, and buttons are at least 44px tall. Use dark navy text on white for strong contrast.
6. Do not use external files, fonts, storage or dialogs.
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 every scene element and all five stages up front gives the model a fixed checklist, so nothing is missing from the diagram.
- Tagging each effect with its stage numbers keeps the logic to one toggle loop, which avoids fragile per-stage code.
- Requiring CSS-only animation plus a motion toggle makes reduced-motion support simple and reliable on the first try.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as water-cycle.html and open it in any browser, or view it in the chat's preview or canvas panel.
Common edits
- Change the topic and stages to another process, such as photosynthesis, the rock cycle or the carbon cycle, keeping one sentence per step.
- Adjust the auto-play interval or add a short quiz question after the final stage for classroom use.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a Flip-Card Science Vocabulary Infographic in a Single HTML File
You get a ready-to-open HTML page with twelve cell-biology vocabulary cards that flip to show a definition, a real example and an emoji icon, plus shuffle, reveal-all and keyboard controls.
Build a How a Bill Becomes a Law Branching Flowchart in a Single HTML File
Get a one-file interactive civics flowchart that traces a U.S. bill from introduction to law, showing every point where it can fail or be vetoed, with click-to-expand notes and a text outline.
Build an Interactive Water Cycle Life-Cycle Infographic in One HTML File
Get a single-file circular SVG infographic of the water cycle with animated flowing arrows, clickable stages, a guided tour mode and a reduced-motion fallback.
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 Color-Coded Parts of Speech Grammar Cheat Sheet in One HTML File
A prompt that builds an interactive grammar cheat sheet where every word in the example sentences is colored by part of speech, and hovering or tapping a word explains why it fits that category.
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.