Build an Interactive Cause-and-Effect Infographic on the Causes of World War I
An interactive infographic in one HTML file that links World War I causes with arrows and reveals dated evidence notes when you click a card.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
Act as an information designer and front-end developer who builds accessible explainer graphics for classrooms.
Build "Fault Lines to 1914", an interactive cause-and-effect infographic on the causes of World War I for secondary-school students.
Content:
- Four long-term cause cards: Militarism, Alliances, Imperialism, Nationalism.
- Five short-term trigger cards in a dated chain: the Sarajevo assassination (28 June 1914), Germany's blank cheque, Austria-Hungary's ultimatum to Serbia, Russian mobilisation and the invasion of Belgium.
- One outcome card: outbreak of war, August 1914.
Rules:
- Draw arrows in an SVG overlay calculated from card positions. Redraw them on resize and whenever a card changes size.
- Make long-term links solid navy arrows and short-term triggers dashed brick-red arrows. Show a legend for both.
- Make every card a button. Click, tap, Enter or Space expands 2-3 short evidence notes with real dates, plus "Driven by" and "Leads to" lines. Escape collapses all cards.
- When a card opens, highlight its connected arrows and dim the rest. Add All, Long-term only and Short-term only filter buttons using aria-pressed, plus an open-all toggle.
- Above 760px, use two columns with the outcome centred below. On narrow screens, use one column and route long-term arrows through a left gutter.
- Use a warm paper background, serif headings and visible focus rings. Animate the dashed arrows only when prefers-reduced-motion allows it. Use no external libraries, fonts or images.
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
- Arrows are computed from real card positions and redrawn when cards resize, so they stay attached when notes expand or the layout restacks.
- Solid versus dashed lines with distinct colours make long-term causes and short-term triggers clear, even without relying on colour alone.
- Cards are native buttons using aria-expanded, so keyboard, touch and screen readers all work without extra code.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as an .html file and open it in any browser, or view it in the chat's preview or canvas panel.
Common edits
- Swap the cards and evidence for another topic, such as the causes of the French Revolution or the Great Depression, while keeping the same two arrow types.
- Add a third arrow style, such as a dotted green line for consequences, and a matching column for the effects after 1914.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build an Interactive American Revolution Timeline with Event Filters in HTML
A single HTML file that renders a filterable American Revolution timeline from 1763 to 1783, scrolling sideways on desktop and stacking vertically on phones.
Build an Interactive History Timeline with Era Bands and Clickable Event Cards
Get a single-file interactive timeline with color-coded era bands, zoom controls, keyboard navigation and expandable event cards, ready for a history lesson.
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 Course Syllabus Roadmap Infographic with Weekly Deadline Badges
A prompt that produces an interactive one-page syllabus roadmap with week cards, quiz, project and exam badges, grade weights and a clickable detail panel.