{
  "id": 131,
  "slug": "scrubbable-horizontal-timeline",
  "name": "Scrubbable Interactive Timeline",
  "kind": "ui",
  "family": "Temporal & Roadmap",
  "sourceSite": {
    "name": "Preceden",
    "url": "https://www.preceden.com/",
    "verifiedStatus": 200
  },
  "tagline": "Multi-lane horizontal timeline with a live playhead scrubber, track filters, zoom scale, and synchronized milestone inspector.",
  "whyUnique": "Pairs a tactile range scrubber and auto-scrubbing playhead needle with multi-track swimlanes so overlapping historical or roadmap periods can be explored fluidly on both desktop and mobile.",
  "theme": "dark",
  "mobileStrength": "high",
  "tags": [
    "timeline",
    "scrubber",
    "roadmap",
    "swimlanes",
    "interactive-chart",
    "chronology"
  ],
  "bestFor": [
    "Product roadmaps and release histories",
    "Interactive editorial chronologies and journalism",
    "Project milestone and Gantt-lite planners",
    "Museum, documentary, and educational archives"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#0F131A",
      "name": "Archival Night"
    },
    {
      "role": "surface",
      "hex": "#171D27",
      "name": "Deep Slate"
    },
    {
      "role": "ink",
      "hex": "#F3F1EA",
      "name": "Parchment Light"
    },
    {
      "role": "accent",
      "hex": "#EAB308",
      "name": "Playhead Gold"
    },
    {
      "role": "muted",
      "hex": "#939EB0",
      "name": "Alloy Gray"
    }
  ],
  "typography": {
    "display": "Inter",
    "body": "Inter",
    "mono": "JetBrains Mono",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&family=JetBrains+Mono:wght@600;700&display=swap",
    "scaleNotes": "28px mono playhead year readout, 12px milestone bars, 10px sticky track labels, 20px detail card heading."
  },
  "layoutNotes": "Scrubber header + horizontally scrollable multi-lane canvas with sticky track badges + 2-column detail/active-events cards below (stacking to 1 column on <=780px).",
  "interactionNotes": "Dragging the range scrubber or toggling Auto-Scrub sweeps the gold playhead across tracks, auto-scrolling the viewport and updating the Active at Playhead panel live.",
  "mobileNotes": "Keeps the page itself zero-overflow while confining horizontal pan strictly inside the rounded timeline viewport, backed by a full-width thumb scrubber and stacked detail cards.",
  "agentGuardrails": {
    "do": [
      "Confine horizontal timeline panning inside an overflow-x:auto container so the page never overflows.",
      "Keep swimlane labels position:sticky; left:10px so users never lose track context while scrolling.",
      "Sync scrubber position with a structured detail card below for effortless mobile reading."
    ],
    "dont": [
      "Never pack long descriptions directly inside narrow timeline bars.",
      "Avoid tiny <34px clickable milestone bars that are hard to tap on touchscreens."
    ]
  },
  "demoFile": "demos/scrubbable-horizontal-timeline.html",
  "thumbDesktop": "thumbs/scrubbable-horizontal-timeline-desktop.webp",
  "thumbMobile": "thumbs/scrubbable-horizontal-timeline-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/scrubbable-horizontal-timeline",
    "markdown": "https://templates.michaelpitts.net/t/scrubbable-horizontal-timeline.md",
    "api": "https://templates.michaelpitts.net/api/templates/scrubbable-horizontal-timeline",
    "demo": "https://templates.michaelpitts.net/demos/scrubbable-horizontal-timeline.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/scrubbable-horizontal-timeline-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/scrubbable-horizontal-timeline-mobile.webp"
  },
  "agentPrompt": "Design & build using template #131 \"Scrubbable Interactive Timeline\" (ui / Temporal & Roadmap, dark theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/scrubbable-horizontal-timeline.md\nLive demo: https://templates.michaelpitts.net/demos/scrubbable-horizontal-timeline.html\nReal-world inspiration: Preceden (https://www.preceden.com/)\n\nCore aesthetic: Pairs a tactile range scrubber and auto-scrubbing playhead needle with multi-track swimlanes so overlapping historical or roadmap periods can be explored fluidly on both desktop and mobile.\nPalette: canvas: #0F131A (Archival Night), surface: #171D27 (Deep Slate), ink: #F3F1EA (Parchment Light), accent: #EAB308 (Playhead Gold), muted: #939EB0 (Alloy Gray)\nTypography: Display=\"Inter\", Body=\"Inter\", Mono=\"JetBrains Mono\"\nLayout: Scrubber header + horizontally scrollable multi-lane canvas with sticky track badges + 2-column detail/active-events cards below (stacking to 1 column on <=780px).\nInteractions: Dragging the range scrubber or toggling Auto-Scrub sweeps the gold playhead across tracks, auto-scrolling the viewport and updating the Active at Playhead panel live.\nMobile: Keeps the page itself zero-overflow while confining horizontal pan strictly inside the rounded timeline viewport, backed by a full-width thumb scrubber and stacked detail cards.\n\nGuardrails:\n- DO: Confine horizontal timeline panning inside an overflow-x:auto container so the page never overflows.\n- DO: Keep swimlane labels position:sticky; left:10px so users never lose track context while scrolling.\n- DO: Sync scrubber position with a structured detail card below for effortless mobile reading.\n- DON'T: Never pack long descriptions directly inside narrow timeline bars.\n- DON'T: Avoid tiny <34px clickable milestone bars that are hard to tap on touchscreens.",
  "sourceCode": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Scrubbable Interactive Horizontal Timeline — Preceden-Inspired Pattern</title>\n<style>\n  :root {\n    --canvas: #0f131a;\n    --surface: #171d27;\n    --surface-2: #1f2735;\n    --border: rgba(255,255,255,0.1);\n    --ink: #f3f1ea;\n    --muted: #939eb0;\n    --gold: #eab308;\n    --cyan: #38bdf8;\n    --coral: #fb7185;\n    --emerald: #34d399;\n    --font: -apple-system, BlinkMacSystemFont, \"Inter\", \"Segoe UI\", sans-serif;\n    --mono: ui-monospace, \"SF Mono\", Menlo, monospace;\n  }\n  * { box-sizing: border-box; margin: 0; padding: 0; }\n  html, body { min-height: 100%; background: var(--canvas); color: var(--ink); font-family: var(--font); overflow-x: hidden; }\n  .shell { max-width: 1200px; margin: 0 auto; padding: 18px 16px 36px; display: grid; gap: 16px; }\n  .header {\n    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;\n    padding-bottom: 14px; border-bottom: 1px solid var(--border);\n  }\n  .title-block h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }\n  .title-block p { font-size: 13px; color: var(--muted); margin-top: 2px; }\n  .controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }\n  .pill-btn {\n    min-height: 40px; padding: 0 12px; border-radius: 999px;\n    border: 1px solid var(--border); background: var(--surface);\n    color: var(--muted); font: 600 13px var(--font); cursor: pointer;\n  }\n  .pill-btn.active, .pill-btn:hover { color: var(--ink); border-color: var(--gold); background: rgba(234,179,8,0.12); }\n\n  .scrubber-card {\n    background: var(--surface);\n    border: 1px solid var(--border);\n    border-radius: 16px;\n    padding: 16px;\n    display: grid;\n    gap: 14px;\n  }\n  .scrubber-top {\n    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;\n  }\n  .year-readout {\n    font: 700 28px var(--mono);\n    color: var(--gold);\n    letter-spacing: -0.02em;\n  }\n  .range-wrap { display: flex; align-items: center; gap: 12px; width: 100%; }\n  .scrubber-range {\n    flex: 1;\n    height: 36px;\n    accent-color: var(--gold);\n    cursor: pointer;\n  }\n  .timeline-viewport {\n    position: relative;\n    overflow-x: auto;\n    border-radius: 12px;\n    border: 1px solid var(--border);\n    background: #121721;\n    padding: 16px 0 18px;\n    scrollbar-color: var(--surface-2) transparent;\n  }\n  .timeline-canvas {\n    position: relative;\n    min-height: 250px;\n  }\n  .axis {\n    position: relative;\n    height: 28px;\n    border-bottom: 1px solid var(--border);\n    margin-bottom: 14px;\n  }\n  .tick {\n    position: absolute;\n    top: 0;\n    transform: translateX(-50%);\n    font: 600 11px var(--mono);\n    color: var(--muted);\n  }\n  .tick::after {\n    content: \"\";\n    position: absolute;\n    left: 50%;\n    top: 22px;\n    width: 1px;\n    height: 220px;\n    background: rgba(255,255,255,0.05);\n    pointer-events: none;\n  }\n  .playhead {\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    width: 2px;\n    background: var(--gold);\n    box-shadow: 0 0 14px rgba(234,179,8,0.6);\n    pointer-events: none;\n    z-index: 15;\n  }\n  .playhead::before {\n    content: \"\";\n    position: absolute;\n    top: 0; left: -5px;\n    width: 12px; height: 12px;\n    border-radius: 50%;\n    background: var(--gold);\n  }\n  .lane {\n    position: relative;\n    height: 56px;\n    margin-bottom: 10px;\n  }\n  .lane-label {\n    position: sticky;\n    left: 10px;\n    z-index: 5;\n    display: inline-block;\n    font: 700 10px var(--mono);\n    text-transform: uppercase;\n    letter-spacing: 0.08em;\n    color: var(--muted);\n    background: rgba(18,23,33,0.88);\n    padding: 2px 7px;\n    border-radius: 5px;\n  }\n  .bar-item {\n    position: absolute;\n    top: 20px;\n    min-height: 34px;\n    padding: 6px 10px;\n    border-radius: 8px;\n    border: 1px solid rgba(255,255,255,0.16);\n    color: #fff;\n    font: 600 12px var(--font);\n    cursor: pointer;\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    text-align: left;\n    transition: transform .12s, box-shadow .12s;\n  }\n  .bar-item:hover, .bar-item.active {\n    transform: translateY(-2px);\n    box-shadow: 0 8px 20px rgba(0,0,0,0.45);\n    border-color: #fff;\n    z-index: 10;\n  }\n\n  .detail-grid {\n    display: grid;\n    grid-template-columns: 1.35fr 0.65fr;\n    gap: 16px;\n  }\n  .detail-card {\n    background: var(--surface);\n    border: 1px solid var(--border);\n    border-radius: 16px;\n    padding: 20px;\n  }\n  .badge {\n    display: inline-block;\n    font: 700 11px var(--mono);\n    text-transform: uppercase;\n    padding: 4px 9px;\n    border-radius: 999px;\n    margin-bottom: 10px;\n  }\n  .detail-card h2 { font-size: 20px; margin-bottom: 8px; }\n  .detail-card p { font-size: 14.5px; line-height: 1.65; color: #cbd5e1; }\n  .nearby-list { display: grid; gap: 8px; margin-top: 10px; }\n  .nearby-btn {\n    width: 100%; min-height: 44px; padding: 8px 12px;\n    border-radius: 10px; border: 1px solid var(--border);\n    background: var(--surface-2); color: var(--ink);\n    display: flex; justify-content: space-between; align-items: center;\n    font: 500 13px var(--font); cursor: pointer; text-align: left;\n  }\n  .nearby-btn.active { border-color: var(--gold); }\n  @media (max-width: 780px) {\n    .detail-grid { grid-template-columns: 1fr; }\n    .year-readout { font-size: 22px; }\n  }\n</style>\n</head>\n<body>\n<div class=\"shell\">\n  <header class=\"header\">\n    <div class=\"title-block\">\n      <h1>Spaceflight & Web Computing Timeline (1969–2026)</h1>\n      <p>Scrub the playhead or tap any milestone bar to inspect historical eras.</p>\n    </div>\n    <div class=\"controls\" id=\"trackFilters\">\n      <button class=\"pill-btn active\" data-track=\"all\" type=\"button\">All Tracks</button>\n      <button class=\"pill-btn\" data-track=\"Spaceflight\" type=\"button\">Spaceflight</button>\n      <button class=\"pill-btn\" data-track=\"Computing\" type=\"button\">Computing</button>\n      <button class=\"pill-btn\" data-track=\"Web\" type=\"button\">Web & UI</button>\n    </div>\n  </header>\n\n  <section class=\"scrubber-card\">\n    <div class=\"scrubber-top\">\n      <div>\n        <div style=\"font:600 11px var(--mono);text-transform:uppercase;color:var(--muted);\">Playhead Position</div>\n        <div class=\"year-readout\" id=\"yearReadout\">1995</div>\n      </div>\n      <div class=\"controls\">\n        <button class=\"pill-btn\" id=\"playBtn\" type=\"button\">▶ Auto-Scrub</button>\n        <button class=\"pill-btn active\" data-zoom=\"1\" type=\"button\">1× Era</button>\n        <button class=\"pill-btn\" data-zoom=\"1.8\" type=\"button\">1.8× Detail</button>\n      </div>\n    </div>\n\n    <div class=\"range-wrap\">\n      <span style=\"font:600 12px var(--mono);color:var(--muted);\">1969</span>\n      <input class=\"scrubber-range\" id=\"scrubber\" type=\"range\" min=\"1969\" max=\"2026\" step=\"0.2\" value=\"1995\" aria-label=\"Scrub timeline year\">\n      <span style=\"font:600 12px var(--mono);color:var(--muted);\">2026</span>\n    </div>\n\n    <div class=\"timeline-viewport\" id=\"timelineViewport\">\n      <div class=\"timeline-canvas\" id=\"timelineCanvas\"></div>\n    </div>\n  </section>\n\n  <section class=\"detail-grid\">\n    <article class=\"detail-card\" id=\"detailCard\"></article>\n    <aside class=\"detail-card\">\n      <div style=\"font:700 11px var(--mono);text-transform:uppercase;color:var(--muted);margin-bottom:8px;\">Active at Playhead</div>\n      <div class=\"nearby-list\" id=\"nearbyList\"></div>\n    </aside>\n  </section>\n</div>\n\n<script>\nconst MIN_Y = 1969, MAX_Y = 2026;\nconst EVENTS = [\n  { id: 'e1', track: 'Spaceflight', color: '#eab308', start: 1969, end: 1972, title: 'Apollo Lunar Missions', desc: 'Apollo 11 through 17 landed twelve astronauts on the Moon using the 74 KB Apollo Guidance Computer.' },\n  { id: 'e2', track: 'Spaceflight', color: '#eab308', start: 1977, end: 1989, title: 'Voyager Grand Tour', desc: 'Twin probes explored Jupiter, Saturn, Uranus, and Neptune before entering interstellar space.' },\n  { id: 'e3', track: 'Spaceflight', color: '#eab308', start: 1998, end: 2025, title: 'International Space Station', desc: 'Continuous orbital laboratory assembled across 40+ missions with international crew rotation.' },\n  { id: 'e4', track: 'Spaceflight', color: '#eab308', start: 2021, end: 2026, title: 'JWST Deep-Field Era', desc: 'James Webb Space Telescope observes infrared galaxies formed within 300 million years of the Big Bang.' },\n\n  { id: 'e5', track: 'Computing', color: '#38bdf8', start: 1973, end: 1981, title: 'Xerox Alto & Bitmapped GUI', desc: 'Introduced desktop windows, overlapping panes, Ethernet, and the mouse-driven WYSIWYG workstation.' },\n  { id: 'e6', track: 'Computing', color: '#38bdf8', start: 1984, end: 1996, title: 'Personal Desktop Revolution', desc: 'Macintosh, NeXTSTEP, and Windows 95 brought direct-manipulation interfaces to millions of homes.' },\n  { id: 'e7', track: 'Computing', color: '#38bdf8', start: 2007, end: 2018, title: 'Multi-Touch Mobile Computing', desc: 'Capacitive touchscreens reshaped ergonomics around 44px thumb targets, physics inertia, and fluid sheets.' },\n  { id: 'e8', track: 'Computing', color: '#38bdf8', start: 2020, end: 2026, title: 'Neural & Agentic Workspaces', desc: 'On-device accelerators and multimodal reasoning models turn software into collaborative spatial canvases.' },\n\n  { id: 'e9', track: 'Web', color: '#34d399', start: 1990, end: 1999, title: 'Hypertext & Early HTML', desc: 'Tim Berners-Lee launched WorldWideWeb; CSS1 and JavaScript turned static pages into live documents.' },\n  { id: 'e10', track: 'Web', color: '#34d399', start: 2004, end: 2013, title: 'Ajax & Responsive Web Design', desc: 'Asynchronous web apps and fluid media queries unified desktop and mobile viewports under one URL.' },\n  { id: 'e11', track: 'Web', color: '#34d399', start: 2015, end: 2026, title: 'Design Systems & WebGPU', desc: 'Component tokens, CSS Grid, and hardware-accelerated canvases bring native-grade tools to the browser.' }\n];\n\nlet activeTrack = 'all';\nlet zoom = 1;\nlet playheadYear = 1995;\nlet selectedId = 'e9';\nlet playing = false;\nlet rafId = null;\n\nconst canvas = document.getElementById('timelineCanvas');\nconst viewport = document.getElementById('timelineViewport');\nconst scrubber = document.getElementById('scrubber');\nconst yearReadout = document.getElementById('yearReadout');\nconst detailCard = document.getElementById('detailCard');\nconst nearbyList = document.getElementById('nearbyList');\nconst playBtn = document.getElementById('playBtn');\n\nfunction pct(year) { return ((year - MIN_Y) / (MAX_Y - MIN_Y)) * 100; }\n\nfunction renderTimeline() {\n  const widthPx = Math.max(680, Math.round(980 * zoom));\n  canvas.style.width = widthPx + 'px';\n\n  const tracks = activeTrack === 'all' ? ['Spaceflight', 'Computing', 'Web'] : [activeTrack];\n  let html = `<div class=\"playhead\" id=\"playhead\" style=\"left:${pct(playheadYear)}%\"></div><div class=\"axis\">`;\n  for (let y = 1970; y <= 2025; y += 5) {\n    html += `<span class=\"tick\" style=\"left:${pct(y)}%\">${y}</span>`;\n  }\n  html += `</div>`;\n\n  for (const tr of tracks) {\n    const items = EVENTS.filter(e => e.track === tr);\n    html += `<div class=\"lane\"><span class=\"lane-label\">${tr}</span>`;\n    for (const ev of items) {\n      const left = pct(ev.start);\n      const w = Math.max(5.5, pct(ev.end) - left);\n      html += `<button type=\"button\" class=\"bar-item ${ev.id === selectedId ? 'active' : ''}\" data-id=\"${ev.id}\"\n        style=\"left:${left}%;width:${w}%;background:${ev.color}26;border-color:${ev.id === selectedId ? '#fff' : ev.color + '88'};color:#f8fafc;\">\n        ${ev.title}\n      </button>`;\n    }\n    html += `</div>`;\n  }\n\n  canvas.innerHTML = html;\n  canvas.querySelectorAll('.bar-item').forEach(btn => {\n    btn.addEventListener('click', () => {\n      selectedId = btn.dataset.id;\n      const ev = EVENTS.find(e => e.id === selectedId);\n      if (ev) {\n        playheadYear = Math.round((ev.start + ev.end) / 2);\n        scrubber.value = playheadYear;\n      }\n      updateReadout();\n      renderTimeline();\n    });\n  });\n  updateReadout();\n}\n\nfunction updateReadout() {\n  yearReadout.textContent = Math.floor(playheadYear);\n  const ph = document.getElementById('playhead');\n  if (ph) ph.style.left = pct(playheadYear) + '%';\n\n  const active = EVENTS.filter(e =>\n    (activeTrack === 'all' || e.track === activeTrack) &&\n    playheadYear >= e.start && playheadYear <= e.end\n  );\n\n  if (active.length && !active.some(e => e.id === selectedId)) {\n    selectedId = active[0].id;\n  }\n  const cur = EVENTS.find(e => e.id === selectedId) || active[0] || EVENTS[0];\n\n  detailCard.innerHTML = `\n    <span class=\"badge\" style=\"background:${cur.color}22;color:${cur.color};\">${cur.track} · ${cur.start}–${cur.end}</span>\n    <h2>${cur.title}</h2>\n    <p>${cur.desc}</p>\n  `;\n\n  nearbyList.innerHTML = active.length ? active.map(ev => `\n    <button type=\"button\" class=\"nearby-btn ${ev.id === cur.id ? 'active' : ''}\" data-id=\"${ev.id}\">\n      <span>${ev.title}</span>\n      <span style=\"font:600 11px var(--mono);color:${ev.color};\">${ev.start}–${ev.end}</span>\n    </button>\n  `).join('') : `<div style=\"font-size:13px;color:var(--muted);\">No overlapping milestones at ${Math.floor(playheadYear)}.</div>`;\n\n  nearbyList.querySelectorAll('.nearby-btn').forEach(btn => {\n    btn.addEventListener('click', () => {\n      selectedId = btn.dataset.id;\n      renderTimeline();\n    });\n  });\n}\n\nscrubber.addEventListener('input', () => {\n  playheadYear = Number(scrubber.value);\n  updateReadout();\n  const ratio = (playheadYear - MIN_Y) / (MAX_Y - MIN_Y);\n  viewport.scrollLeft = Math.max(0, ratio * canvas.scrollWidth - viewport.clientWidth * 0.5);\n});\n\ndocument.getElementById('trackFilters').addEventListener('click', e => {\n  const btn = e.target.closest('.pill-btn');\n  if (!btn) return;\n  activeTrack = btn.dataset.track;\n  document.querySelectorAll('#trackFilters .pill-btn').forEach(b => b.classList.toggle('active', b === btn));\n  renderTimeline();\n});\n\ndocument.querySelectorAll('[data-zoom]').forEach(btn => {\n  btn.addEventListener('click', () => {\n    zoom = Number(btn.dataset.zoom);\n    document.querySelectorAll('[data-zoom]').forEach(b => b.classList.toggle('active', b === btn));\n    renderTimeline();\n  });\n});\n\nfunction tick() {\n  if (!playing) return;\n  playheadYear += 0.12;\n  if (playheadYear > MAX_Y) playheadYear = MIN_Y;\n  scrubber.value = playheadYear.toFixed(1);\n  updateReadout();\n  rafId = requestAnimationFrame(tick);\n}\n\nplayBtn.addEventListener('click', () => {\n  playing = !playing;\n  playBtn.textContent = playing ? '⏸ Pause' : '▶ Auto-Scrub';\n  playBtn.classList.toggle('active', playing);\n  if (playing) tick();\n  else cancelAnimationFrame(rafId);\n});\n\nrenderTimeline();\n</script>\n</body>\n</html>\n"
}
