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.

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 information designer who builds clear, accessible history explainers.

Build a single-page interactive infographic called "Road to Independence" covering the American Revolution from 1763 to 1783. Show about 19 accurate key events, each tagged Political, Military or Social. Each event card shows a type badge, a large year, the exact date, a title, a 1-2 sentence summary, and a "Why it mattered" button that expands one extra sentence.

Rules:
1. Layout: on screens wider than 640px, the timeline is a horizontal, scroll-snapping row of cards on a connecting line with colored dots, plus previous and next arrow buttons. At 640px and below, it stacks vertically with the line on the left.
2. Filters: chips for All, Political, Military and Social, each showing its event count. Clicking a type chip while All is active isolates that type. Later clicks toggle types, and turning every type off resets to All. Use aria-pressed and a live line reading "Showing X of Y events".
3. Keyboard: arrow keys, Home and End move focus between visible cards and scroll the active card into view. Every control has a visible focus ring.
4. Palette: parchment background, dark ink text, navy for political, brick red for military, forest green for social, with readable contrast. Georgia headings and system body text.
5. Motion: smooth scrolling and a slight card lift on hover, both turned off under prefers-reduced-motion.
6. No external files, fonts or libraries.

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: Road to Independence, a filterable timeline of the American Revolution.

Nineteen events from the 1763 Proclamation to the 1783 Treaty of Paris sit on a colored timeline. On a laptop, scroll sideways or use the arrow buttons. On a phone, the cards stack top to bottom. Tap Military to see only battles, then add Social to compare protests with fighting. Open Why it mattered on any card, or focus the timeline and use the arrow keys to step through events.

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

Tips and common edits

Why this works

  • Fixing a breakpoint at 640px tells the model exactly when to switch from a horizontal row to a vertical stack.
  • Spelling out the chip logic (isolate, toggle, reset) avoids the common bug where filters can hide every event.
  • Asking for real dates and a 'why it mattered' line produces teachable content, not filler cards.

Paste into ChatGPT, Claude or Gemini. Save the returned code as revolution-timeline.html and open it in any browser, or view it in the chat's preview or canvas panel.

Common edits

  • Swap the topic and events for another era, such as the Civil Rights Movement, keeping the same three filter categories.
  • Add a fourth category like Economic with its own color, or change the palette to match your school or brand.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Infographics