Timeline Module

← App map · The Global Timeline: all eight wonders and 51 world events on one zoomable, scrubbable scroll from 3000 BCE to 2200 CE.

Screenshots scroll sideways · tap to enlarge

What it does

Opened from the menu or a wonder’s events tab with ?type=, it scrolls a vertical timeline of 5,200 years (WondersLogic.timelineStartYear −3000 to timelineEndYear 2200). The content height runs from 1,200 px minus half the viewport to 5,500 px with zoom (0–1, starting at 0.5); pinching (Ctrl + wheel on desktop) zooms while keeping the current year in place, and so does resizing the window. Year markers step every 500, 250 or 100 years as the content grows past 800 and 1,500 px. The 8 wonders sit on 3 non-overlapping tracks, each at least 100 px long, and each one’s image slides along its span as the centre year passes it; wonders other than the chosen one are greyed. A dashed centre line shows the year, the era below it changes at −600, 476 and 1450 (Prehistory, Classical, Early Modern, Modern), and on open the view jumps 200 px short of the wonder’s start year and glides there in 1.3 s. TimelineLogic.events holds 43 global events plus one “construction begins” event per wonder; the dot within 10 px of the centre line grows from 2 to 6 px with a haptic tick, and its card pops in after a 500 ms debounce. Tapping a dot scrolls to it. The 80 px scrubber at the bottom shares the same ScrollController: its box shows the visible part and dragging it scrolls the main view.

Logic class diagram

A shared ScrollController is the timeline’s only clock: a small controller turns pixels into years and back, and the markers, era text and scrubber all read from it.

Screen widget composition

Header, the zoomable viewport (year markers, wonder tracks, event dots, centre line, popup), the era label and the mini scrubber.

Open the timeline at a wonder and browse events sequence

Every change of scroll position is turned back into a year, and everything else follows from that year.

Key files