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

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

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

Example: Up and Away, a zoomable history-of-flight timeline.

Nineteen milestones sit on five color-coded era bands, from the 1783 Paris balloon to Ingenuity on Mars. Click any pill to open its card, then press More details for who, where and why it matters.

Try the + / − / Fit buttons or keys to zoom into the crowded Space Race years. Click an era chip to jump straight to that era. Use ← →, Home and End to step through events like slides.

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

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