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.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
Act as a senior front-end developer and information designer. Build "Up and Away: 240 Years of Human Flight", an interactive history timeline infographic in a single self-contained HTML file. Plot 19 real milestones, from the first crewed balloon flight in 1783 to the Ingenuity helicopter on Mars in 2021, on a horizontal, scrollable year axis. Layer them over five color-coded era bands: Balloons and Gliders, Pioneers, Jet Age, Space Race and Global Skies.
Rules:
1. Each event is a pill button in its era color showing the year and a short label, joined to the axis by a thin stem. Overlapping pills stack into lanes automatically. At low zoom, show only the years.
2. Clicking an event opens a detail card below the timeline with the full date, title, a two-sentence summary and an era tag. A "More details" toggle reveals Who, Where and Why it matters.
3. Zoom with minus, Fit and plus buttons and with the + / - / 0 keys, keeping the selected event centered. Clicking a legend chip zooms to that era.
4. Left and Right arrows, Home and End move between events. Previous and Next buttons and an "Event 4 of 19" counter stay in sync.
5. Use a warm paper background, dark ink text, a system font stack, visible focus rings and readable contrast. Turn off smooth scrolling under prefers-reduced-motion.
6. Use no external libraries, fonts, images, storage or network calls. The page must fit 360-1280px widths and re-lay out on resize.
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
- Real dated events and named eras give the model concrete data, so the result reads like a finished lesson aid rather than a demo.
- Automatic lane stacking and a compact mode at low zoom stop labels from colliding, even on narrow phone screens.
- Spelling out the keyboard map, the counter and the reduced-motion behavior makes the timeline accessible and presentable from the first run.
Paste into ChatGPT, Claude or Gemini. Save the returned code as timeline.html and open it in any browser, or view it in the chat's preview or canvas. To cover a different topic, swap in your own eras and events.
Common edits
- Swap the topic: replace the eras and events with a unit you teach, such as the Industrial Revolution or the history of medicine.
- Add Web Audio click tones and a mute toggle, or add an era filter that fades out events from other periods.
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 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 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.
Build a Vertical Biography Timeline Infographic of a Famous Scientist in HTML
You get one HTML file with an alternating vertical timeline of a scientist's life, including milestones, quotes and awards, category filters and expandable details.
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.
Build an Interactive Periodic Table Infographic in a Single HTML File
Get a responsive periodic table of all 118 elements with family, state and metal-type filters and a detail panel for each element, in one HTML file.