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

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

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

Example: Fault Lines to 1914, a clickable cause-and-effect map of how World War I began.

Four long-term cause cards feed into a dated chain of five July Crisis triggers, which ends in the outbreak of war.

  • Solid navy arrows mark long-term causes.
  • Dashed red arrows mark short-term triggers.
  • Click or tap a card to reveal evidence notes and light up its links.
  • Filter buttons isolate either strand of arrows.
  • Esc closes all notes.
  • Resize the window to see the layout restack into one column.
Written by AI from this prompt. Your results will vary.

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