@flipbook-md/core 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # @flipbook-md/core
2
2
 
3
- The shared library behind [Flipbook MD](https://github.com/uminocelo/flipbook-md). It loads Markdown decks, applies templates, groups, themes and blueprints, serves the slide player, and exports PNG carousels and MP4 videos.
3
+ ![Flipbook Core](docs/logo.svg)
4
+
5
+ The shared library behind [Flipbook MD](https://github.com/FlipbookMD-HQ/flipbook-md). It loads Markdown decks, applies templates, groups, themes and blueprints, serves the slide player, and exports PNG carousels and MP4 videos.
4
6
 
5
7
  It is one of three Flipbook MD projects:
6
8
 
7
9
  | Project | What it is |
8
10
  | --- | --- |
9
- | [`flipbook-md`](https://github.com/uminocelo/flipbook-md) | The `flipbook` command: present, check and export decks. |
11
+ | [`flipbook-md`](https://github.com/FlipbookMD-HQ/flipbook-md) | The `flipbook` command: present, check and export decks. |
10
12
  | `@flipbook-md/core` (this package) | The library both apps build on: loading, rendering, blueprints, export and document import. |
11
13
  | Flipbook Studio | A self-hosted editor for the same deck files, with optional AI from a model running on your machine. **Coming soon.** |
12
14
 
@@ -235,7 +237,7 @@ const result = await importDeck("./decks", {
235
237
 
236
238
  Only the package entry is public. Deep imports such as `@flipbook-md/core/src/…` are blocked. Type declarations ship in `index.d.ts`.
237
239
 
238
- The deck file format (slides, `presentation.yml`, `templates.yml`, `blueprint.yml`, groups and themes) is documented in the [Flipbook MD README](https://github.com/uminocelo/flipbook-md#write-a-presentation).
240
+ The deck file format (slides, `presentation.yml`, `templates.yml`, `blueprint.yml`, groups and themes) is documented in the [Flipbook MD README](https://github.com/FlipbookMD-HQ/flipbook-md#write-a-presentation).
239
241
 
240
242
  ## Develop
241
243
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@flipbook-md/core",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "description": "Load, render, check and export Flipbook MD decks. Shared by the flipbook CLI and Flipbook Studio.",
5
5
  "license": "MIT",
6
6
  "author": "Celo (https://github.com/uminocelo)",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/uminocelo/flipbook-md-core.git"
9
+ "url": "git+https://github.com/FlipbookMD-HQ/flipbook-md-core.git"
10
10
  },
11
11
  "type": "module",
12
12
  "main": "./index.js",
@@ -36,13 +36,13 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "gray-matter": "^4.0.3",
39
- "marked": "^15.0.7",
39
+ "marked": "^18.2.1",
40
40
  "playwright": "^1.55.0",
41
41
  "sanitize-html": "^2.14.0",
42
42
  "yaml": "^2.7.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/node": "^20.17.6",
46
- "typescript": "^5.6.3"
45
+ "@types/node": "^26.6.6",
46
+ "typescript": "^7.0.2"
47
47
  }
48
48
  }
@@ -4,30 +4,67 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="color-scheme" content="dark">
7
- <title>Flipbook MD · Announcer</title>
7
+ <title>Flipbook MD · Presenter</title>
8
8
  <link rel="stylesheet" href="/styles.css">
9
9
  <script src="/app.js" defer></script>
10
10
  </head>
11
11
  <body class="announcer">
12
12
  <header class="topbar">
13
- <a class="brand" href="/" target="_blank" rel="noopener noreferrer" aria-label="Flipbook MD home">FLIPBOOK <span>MD</span></a>
14
- <div class="topbar-right"><span id="deck-title">Loading presentation…</span><a class="view-link" href="/" target="_blank" rel="noopener noreferrer">Deck</a><button id="fullscreen" class="icon-button" title="Toggle fullscreen (F)" aria-label="Toggle fullscreen">⛶</button></div>
13
+ <div class="topbar-left">
14
+ <a class="brand" href="/" target="_blank" rel="noopener noreferrer" aria-label="Flipbook MD home">FLIPBOOK <span>MD</span></a>
15
+ <span id="deck-title" class="deck-title">Loading presentation…</span>
16
+ </div>
17
+ <div class="presenter-clock-group">
18
+ <div class="timer-widget" aria-label="Speaker timer">
19
+ <span id="speaker-timer" class="timer-display">00:00</span>
20
+ <button id="timer-toggle" class="hud-button timer-button" type="button" aria-pressed="false">Start</button>
21
+ <button id="timer-reset" class="hud-button timer-button" type="button">Reset</button>
22
+ </div>
23
+ <span id="wall-clock" class="wall-clock" aria-label="Current time">--:--</span>
24
+ </div>
25
+ <div class="topbar-right">
26
+ <a class="view-link" href="/" target="_blank" rel="noopener noreferrer">Deck</a>
27
+ <button id="fullscreen" class="icon-button" type="button" title="Toggle fullscreen (F)" aria-label="Toggle fullscreen">⛶</button>
28
+ </div>
15
29
  </header>
16
- <main>
17
- <section id="slide" class="slide" aria-live="polite" aria-label="Current slide">
18
- <p class="loading">Loading your slides…</p>
30
+
31
+ <main class="presenter-main">
32
+ <section class="presenter-stage" aria-label="Current slide">
33
+ <div class="panel-label">Current slide</div>
34
+ <section id="slide" class="slide" aria-live="polite" aria-label="Current slide">
35
+ <p class="loading">Loading your slides…</p>
36
+ </section>
19
37
  </section>
20
- <aside class="notes-panel" aria-label="Speaker notes">
21
- <h2>Notes</h2>
22
- <div id="notes" class="notes-body" aria-live="polite"><p class="notes-empty">No notes for this slide.</p></div>
38
+
39
+ <aside class="presenter-sidebar" aria-label="Up next and speaker notes">
40
+ <section class="up-next-panel" aria-label="Up next slide">
41
+ <div class="panel-label">Up next</div>
42
+ <div class="up-next-frame">
43
+ <div id="up-next-slide" class="up-next-slide" aria-live="polite"></div>
44
+ </div>
45
+ </section>
46
+
47
+ <section class="notes-panel" aria-label="Speaker notes">
48
+ <div class="notes-header">
49
+ <h2>Notes</h2>
50
+ <div class="notes-scale-controls" role="group" aria-label="Notes font size">
51
+ <button id="notes-scale-down" class="hud-button scale-button" type="button" aria-label="Decrease notes font size" title="Decrease notes font size">A-</button>
52
+ <button id="notes-scale-up" class="hud-button scale-button" type="button" aria-label="Increase notes font size" title="Increase notes font size">A+</button>
53
+ </div>
54
+ </div>
55
+ <div id="notes" class="notes-body" aria-live="polite"><p class="notes-empty">No notes for this slide.</p></div>
56
+ </section>
23
57
  </aside>
24
- <nav class="controls" aria-label="Slide navigation">
25
- <button id="previous" class="nav-button" type="button" aria-label="Previous slide">← <span>Previous</span></button>
26
- <button id="play" class="nav-button primary" type="button" aria-pressed="false" aria-label="Play">▶ <span>Play</span></button>
27
- <div class="slide-meta"><span id="counter">— / —</span><div class="progress"><div id="progress-bar"></div></div></div>
28
- <button id="next" class="nav-button" type="button" aria-label="Next slide"><span>Next</span> →</button>
29
- </nav>
58
+
59
+ <section class="presenter-bottom" aria-label="Slide navigation and jump strip">
60
+ <div id="slide-strip" class="slide-strip" role="navigation" aria-label="Slide jump strip"></div>
61
+ <nav class="controls" aria-label="Slide navigation">
62
+ <button id="previous" class="nav-button" type="button" aria-label="Previous slide">← <span>Previous</span></button>
63
+ <button id="play" class="nav-button primary" type="button" aria-pressed="false" aria-label="Play">▶ <span>Play</span></button>
64
+ <div class="slide-meta"><span id="counter">— / —</span><div class="progress"><div id="progress-bar"></div></div></div>
65
+ <button id="next" class="nav-button" type="button" aria-label="Next slide"><span>Next</span> →</button>
66
+ </nav>
67
+ </section>
30
68
  </main>
31
- <footer><span>Made with <strong>Flipbook MD</strong></span><span>Speaker notes · ← / → or Space · P play</span></footer>
32
69
  </body>
33
70
  </html>
package/public/app.js CHANGED
@@ -6,10 +6,29 @@ const previous = document.querySelector("#previous");
6
6
  const next = document.querySelector("#next");
7
7
  const playButton = document.querySelector("#play");
8
8
  const notesRoot = document.querySelector("#notes");
9
+ const upNextRoot = document.querySelector("#up-next-slide");
10
+ const slideStrip = document.querySelector("#slide-strip");
11
+ const hud = document.querySelector("nav.hud");
12
+ const gridToggle = document.querySelector("#grid-toggle");
13
+ const gridClose = document.querySelector("#grid-close");
14
+ const overviewDialog = document.querySelector("#overview-grid");
15
+ const overviewCards = document.querySelector("#overview-cards");
16
+ const notesScaleDown = document.querySelector("#notes-scale-down");
17
+ const notesScaleUp = document.querySelector("#notes-scale-up");
18
+ const timerDisplay = document.querySelector("#speaker-timer");
19
+ const timerToggle = document.querySelector("#timer-toggle");
20
+ const timerReset = document.querySelector("#timer-reset");
21
+ const wallClock = document.querySelector("#wall-clock");
22
+
9
23
  const tabId = Math.random().toString(36).slice(2);
10
24
  let channel = null;
11
25
  try { channel = new BroadcastChannel("flipbook-md"); } catch { channel = null; }
12
26
 
27
+ const HUD_IDLE_MS = 2500;
28
+ const NOTES_SCALES = ["0.9", "1", "1.15", "1.3", "1.5"];
29
+ const PREVIEW_W = 960;
30
+ const PREVIEW_H = 540;
31
+
13
32
  let presentation;
14
33
  let current = 0;
15
34
  let playing = false;
@@ -18,9 +37,20 @@ let timer = null;
18
37
  let pendingRemote = null;
19
38
  let shown = null;
20
39
 
21
- function mountSlide() {
22
- if (slideRoot.shadowRoot) return slideRoot.shadowRoot;
23
- const shadow = slideRoot.attachShadow({ mode: "open" });
40
+ let hudHideTimer = null;
41
+ let hudHovered = false;
42
+ let overviewOpen = false;
43
+ let overviewBuilt = false;
44
+
45
+ let notesScale = "1";
46
+ let speakerElapsedMs = 0;
47
+ let speakerRunning = false;
48
+ let speakerStartedAt = 0;
49
+ let speakerInterval = null;
50
+
51
+ function mountSlide(host, { live = false } = {}) {
52
+ if (host.shadowRoot) return host.shadowRoot;
53
+ const shadow = host.attachShadow({ mode: "open" });
24
54
  const base = document.createElement("link");
25
55
  base.rel = "stylesheet";
26
56
  base.href = "/slide.css";
@@ -32,7 +62,7 @@ function mountSlide() {
32
62
  theme.href = "/presentation.css";
33
63
  const article = document.createElement("article");
34
64
  article.className = "slide-root";
35
- article.setAttribute("aria-live", "polite");
65
+ if (live) article.setAttribute("aria-live", "polite");
36
66
  shadow.append(base, templates, theme, article);
37
67
  return shadow;
38
68
  }
@@ -61,8 +91,8 @@ function restoreIndex() {
61
91
  }
62
92
  }
63
93
 
64
- function publish() {
65
- channel?.postMessage({ tab: tabId, index: current, playing: Boolean(playing && leader) });
94
+ function publish(type = "goto") {
95
+ channel?.postMessage({ tab: tabId, type, index: current, playing: Boolean(playing && leader) });
66
96
  remember();
67
97
  }
68
98
 
@@ -112,11 +142,8 @@ function animateIn(article, delta) {
112
142
  article.animate(frames, { duration: ms, easing: "ease-out" });
113
143
  }
114
144
 
115
- function render() {
116
- if (!presentation?.slides?.length) return;
117
- current = Math.max(0, Math.min(current, presentation.slides.length - 1));
118
- const slide = presentation.slides[current];
119
- const shadow = mountSlide();
145
+ function renderSlideInto(host, slide, { live = false, animateDelta = 0 } = {}) {
146
+ const shadow = mountSlide(host, { live });
120
147
  const article = shadow.querySelector(".slide-root");
121
148
  article.setAttribute("data-template", slide.template || "flow");
122
149
  setData(article, "layout", slide.layout);
@@ -125,18 +152,94 @@ function render() {
125
152
  const header = presentation.chromeHtml?.header ?? "";
126
153
  const footer = presentation.chromeHtml?.footer ?? "";
127
154
  article.innerHTML = `${header}<p class="eyebrow">${escapeHtml(presentation.title)}</p><div class="slide-body">${slide.html}</div>${footer}${slide.counterHtml ?? ""}`;
155
+ shadow.querySelectorAll("a").forEach((anchor) => {
156
+ anchor.setAttribute("target", "_blank");
157
+ anchor.setAttribute("rel", "noopener noreferrer");
158
+ });
159
+ if (animateDelta) animateIn(article, animateDelta);
160
+ }
161
+
162
+ function fitPreview(container, preview) {
163
+ if (!container || !preview) return;
164
+ const rect = container.getBoundingClientRect();
165
+ if (!rect.width || !rect.height) return;
166
+ const scale = Math.min(rect.width / PREVIEW_W, rect.height / PREVIEW_H);
167
+ const offsetX = Math.max(0, (rect.width - PREVIEW_W * scale) / 2);
168
+ const offsetY = Math.max(0, (rect.height - PREVIEW_H * scale) / 2);
169
+ preview.style.transform = `translate(${offsetX}px, ${offsetY}px) scale(${scale})`;
170
+ }
171
+
172
+ function renderUpNext() {
173
+ if (!upNextRoot || !presentation?.slides?.length) return;
174
+ const nextIndex = current + 1;
175
+ if (nextIndex >= presentation.slides.length) {
176
+ upNextRoot.innerHTML = `<p class="up-next-end">End of presentation</p>`;
177
+ return;
178
+ }
179
+ let preview = upNextRoot.querySelector(".up-next-preview");
180
+ if (!preview) {
181
+ upNextRoot.innerHTML = "";
182
+ preview = document.createElement("div");
183
+ preview.className = "up-next-preview";
184
+ upNextRoot.appendChild(preview);
185
+ }
186
+ renderSlideInto(preview, presentation.slides[nextIndex]);
187
+ fitPreview(upNextRoot.parentElement, preview);
188
+ }
189
+
190
+ function syncSlideStrip() {
191
+ if (!slideStrip) return;
192
+ slideStrip.querySelectorAll(".strip-item").forEach((btn) => {
193
+ const idx = Number(btn.dataset.index);
194
+ const active = idx === current;
195
+ btn.classList.toggle("is-active", active);
196
+ if (active) {
197
+ btn.setAttribute("aria-current", "true");
198
+ btn.scrollIntoView?.({ block: "nearest", inline: "nearest" });
199
+ } else {
200
+ btn.removeAttribute("aria-current");
201
+ }
202
+ });
203
+ }
204
+
205
+ function buildSlideStrip() {
206
+ if (!slideStrip || !presentation?.slides?.length) return;
207
+ const fragment = document.createDocumentFragment();
208
+ presentation.slides.forEach((slide, idx) => {
209
+ const btn = document.createElement("button");
210
+ btn.type = "button";
211
+ btn.className = "strip-item";
212
+ btn.dataset.index = String(idx);
213
+ const num = document.createElement("span");
214
+ num.className = "strip-item-num";
215
+ num.textContent = String(idx + 1);
216
+ const label = document.createElement("span");
217
+ label.className = "strip-item-title";
218
+ label.textContent = slide.title || `Slide ${idx + 1}`;
219
+ btn.append(num, label);
220
+ btn.addEventListener("click", () => go(idx));
221
+ fragment.appendChild(btn);
222
+ });
223
+ slideStrip.replaceChildren(fragment);
224
+ syncSlideStrip();
225
+ }
226
+
227
+ function render() {
228
+ if (!presentation?.slides?.length) return;
229
+ current = Math.max(0, Math.min(current, presentation.slides.length - 1));
230
+ const slide = presentation.slides[current];
231
+ const delta = shown == null ? 0 : current - shown;
232
+ renderSlideInto(slideRoot, slide, { live: true, animateDelta: delta });
128
233
  counter.textContent = `${current + 1} / ${presentation.slides.length}`;
129
234
  progress.style.width = `${((current + 1) / presentation.slides.length) * 100}%`;
130
235
  previous.disabled = current === 0;
131
236
  next.disabled = current === presentation.slides.length - 1;
132
- animateIn(article, shown == null ? 0 : current - shown);
133
237
  shown = current;
134
238
  renderNotes(slide);
239
+ renderUpNext();
135
240
  syncPlayButton();
136
- shadow.querySelectorAll("a").forEach((anchor) => {
137
- anchor.setAttribute("target", "_blank");
138
- anchor.setAttribute("rel", "noopener noreferrer");
139
- });
241
+ syncSlideStrip();
242
+ syncOverviewActive();
140
243
  }
141
244
 
142
245
  function go(index) {
@@ -154,13 +257,13 @@ function go(index) {
154
257
  }
155
258
  syncPlayButton();
156
259
  }
157
- publish();
260
+ publish("goto");
158
261
  }
159
262
 
160
- function setPlaying(next) {
263
+ function setPlaying(nextState) {
161
264
  if (!presentation?.slides?.length) return;
162
265
  clearTimer();
163
- if (next && current < presentation.slides.length - 1) {
266
+ if (nextState && current < presentation.slides.length - 1) {
164
267
  playing = true;
165
268
  leader = true;
166
269
  timer = setInterval(tick, intervalMs());
@@ -169,7 +272,7 @@ function setPlaying(next) {
169
272
  leader = false;
170
273
  }
171
274
  syncPlayButton();
172
- publish();
275
+ publish("play");
173
276
  }
174
277
 
175
278
  function tick() {
@@ -182,7 +285,7 @@ function tick() {
182
285
  leader = false;
183
286
  syncPlayButton();
184
287
  }
185
- publish();
288
+ publish("goto");
186
289
  }
187
290
 
188
291
  function applyRemote(message) {
@@ -203,7 +306,7 @@ channel?.addEventListener("message", (event) => {
203
306
  const message = event.data;
204
307
  if (!message || message.tab === tabId) return;
205
308
  if (message.type === "hello") {
206
- if (leader) publish();
309
+ if (leader) publish("play");
207
310
  return;
208
311
  }
209
312
  applyRemote(message);
@@ -216,23 +319,273 @@ window.addEventListener("pagehide", () => {
216
319
  clearTimer();
217
320
  playing = false;
218
321
  leader = false;
219
- publish();
322
+ publish("play");
323
+ });
324
+
325
+ /* Auto-hiding floating HUD on / */
326
+ function hudHasFocus() {
327
+ return Boolean(hud && document.activeElement && hud.contains(document.activeElement));
328
+ }
329
+
330
+ function hideHud() {
331
+ if (!hud) return;
332
+ if (overviewOpen || hudHovered || hudHasFocus()) return;
333
+ hud.classList.add("is-hidden");
334
+ }
335
+
336
+ function showHud() {
337
+ if (!hud) return;
338
+ hud.classList.remove("is-hidden");
339
+ if (hudHideTimer) {
340
+ clearTimeout(hudHideTimer);
341
+ hudHideTimer = null;
342
+ }
343
+ if (!overviewOpen && !hudHovered && !hudHasFocus()) {
344
+ hudHideTimer = setTimeout(hideHud, HUD_IDLE_MS);
345
+ }
346
+ }
347
+
348
+ if (hud) {
349
+ document.addEventListener("pointermove", showHud, { passive: true });
350
+ document.addEventListener("pointerdown", showHud, { passive: true });
351
+ hud.addEventListener("pointerenter", () => {
352
+ hudHovered = true;
353
+ showHud();
354
+ });
355
+ hud.addEventListener("pointerleave", () => {
356
+ hudHovered = false;
357
+ showHud();
358
+ });
359
+ hud.addEventListener("focusin", showHud);
360
+ hud.addEventListener("focusout", () => {
361
+ setTimeout(showHud, 0);
362
+ });
363
+ }
364
+
365
+ /* G Slide Overview Grid on / */
366
+ function syncOverviewActive() {
367
+ if (!overviewCards) return;
368
+ overviewCards.querySelectorAll(".overview-card").forEach((card) => {
369
+ const idx = Number(card.dataset.index);
370
+ const active = idx === current;
371
+ card.classList.toggle("is-active", active);
372
+ if (active) card.setAttribute("aria-current", "true");
373
+ else card.removeAttribute("aria-current");
374
+ });
375
+ }
376
+
377
+ function fitAllOverviewThumbs() {
378
+ if (!overviewCards) return;
379
+ overviewCards.querySelectorAll(".overview-thumb").forEach((thumb) => {
380
+ const inner = thumb.querySelector(".overview-thumb-inner");
381
+ fitPreview(thumb, inner);
382
+ });
383
+ }
384
+
385
+ function buildOverviewGrid() {
386
+ if (overviewBuilt || !overviewCards || !presentation?.slides?.length) return;
387
+ overviewBuilt = true;
388
+ const fragment = document.createDocumentFragment();
389
+ presentation.slides.forEach((slide, idx) => {
390
+ const card = document.createElement("button");
391
+ card.type = "button";
392
+ card.className = "overview-card";
393
+ card.dataset.index = String(idx);
394
+
395
+ const thumb = document.createElement("div");
396
+ thumb.className = "overview-thumb";
397
+ const inner = document.createElement("div");
398
+ inner.className = "overview-thumb-inner";
399
+ renderSlideInto(inner, slide);
400
+ thumb.appendChild(inner);
401
+
402
+ const meta = document.createElement("div");
403
+ meta.className = "overview-meta";
404
+ const num = document.createElement("span");
405
+ num.className = "overview-num";
406
+ num.textContent = String(idx + 1);
407
+ const title = document.createElement("span");
408
+ title.className = "overview-title";
409
+ title.textContent = slide.title || `Slide ${idx + 1}`;
410
+ meta.append(num, title);
411
+
412
+ card.append(thumb, meta);
413
+ card.addEventListener("click", () => {
414
+ go(idx);
415
+ closeOverview();
416
+ });
417
+ fragment.appendChild(card);
418
+ });
419
+ overviewCards.replaceChildren(fragment);
420
+ syncOverviewActive();
421
+ }
422
+
423
+ function openOverview() {
424
+ if (!overviewDialog || !presentation?.slides?.length) return;
425
+ buildOverviewGrid();
426
+ overviewOpen = true;
427
+ overviewDialog.hidden = false;
428
+ gridToggle?.setAttribute("aria-expanded", "true");
429
+ if (hudHideTimer) {
430
+ clearTimeout(hudHideTimer);
431
+ hudHideTimer = null;
432
+ }
433
+ syncOverviewActive();
434
+ requestAnimationFrame(() => {
435
+ fitAllOverviewThumbs();
436
+ const activeCard = overviewCards?.querySelector(`.overview-card[data-index="${current}"]`);
437
+ activeCard?.focus();
438
+ });
439
+ }
440
+
441
+ function closeOverview() {
442
+ if (!overviewDialog || !overviewOpen) return;
443
+ overviewOpen = false;
444
+ overviewDialog.hidden = true;
445
+ gridToggle?.setAttribute("aria-expanded", "false");
446
+ gridToggle?.focus();
447
+ showHud();
448
+ }
449
+
450
+ function toggleOverview() {
451
+ if (overviewOpen) closeOverview();
452
+ else openOverview();
453
+ }
454
+
455
+ gridToggle?.addEventListener("click", toggleOverview);
456
+ gridClose?.addEventListener("click", closeOverview);
457
+
458
+ /* Notes font scale in /announcer */
459
+ function restoreNotesScale() {
460
+ try {
461
+ const saved = localStorage.getItem("flipbook-notes-scale");
462
+ if (saved && NOTES_SCALES.includes(saved)) return saved;
463
+ } catch {
464
+ // Ignore storage failures and default to 1.
465
+ }
466
+ return "1";
467
+ }
468
+
469
+ function applyNotesScale(scale) {
470
+ notesScale = NOTES_SCALES.includes(scale) ? scale : "1";
471
+ if (notesRoot) notesRoot.style.fontSize = `${notesScale}rem`;
472
+ try {
473
+ localStorage.setItem("flipbook-notes-scale", notesScale);
474
+ } catch {
475
+ // Ignore storage failures; scale remains active in memory.
476
+ }
477
+ const idx = NOTES_SCALES.indexOf(notesScale);
478
+ if (notesScaleDown) notesScaleDown.disabled = idx <= 0;
479
+ if (notesScaleUp) notesScaleUp.disabled = idx >= NOTES_SCALES.length - 1;
480
+ }
481
+
482
+ notesScaleDown?.addEventListener("click", () => {
483
+ const idx = NOTES_SCALES.indexOf(notesScale);
484
+ if (idx > 0) applyNotesScale(NOTES_SCALES[idx - 1]);
485
+ });
486
+
487
+ notesScaleUp?.addEventListener("click", () => {
488
+ const idx = NOTES_SCALES.indexOf(notesScale);
489
+ if (idx < NOTES_SCALES.length - 1) applyNotesScale(NOTES_SCALES[idx + 1]);
490
+ });
491
+
492
+ /* Speaker elapsed timer + Wall clock in /announcer */
493
+ function formatElapsed(ms) {
494
+ const totalSec = Math.max(0, Math.floor(ms / 1000));
495
+ const hours = Math.floor(totalSec / 3600);
496
+ const mins = Math.floor((totalSec % 3600) / 60);
497
+ const secs = totalSec % 60;
498
+ const mm = String(mins).padStart(2, "0");
499
+ const ss = String(secs).padStart(2, "0");
500
+ return hours > 0 ? `${hours}:${mm}:${ss}` : `${mm}:${ss}`;
501
+ }
502
+
503
+ function currentElapsedMs() {
504
+ return speakerRunning ? speakerElapsedMs + (Date.now() - speakerStartedAt) : speakerElapsedMs;
505
+ }
506
+
507
+ function updateTimerDisplay() {
508
+ if (timerDisplay) timerDisplay.textContent = formatElapsed(currentElapsedMs());
509
+ }
510
+
511
+ function syncTimerButton() {
512
+ if (!timerToggle) return;
513
+ timerToggle.textContent = speakerRunning ? "Pause" : "Start";
514
+ timerToggle.setAttribute("aria-pressed", speakerRunning ? "true" : "false");
515
+ }
516
+
517
+ timerToggle?.addEventListener("click", () => {
518
+ if (speakerRunning) {
519
+ speakerElapsedMs = currentElapsedMs();
520
+ speakerRunning = false;
521
+ if (speakerInterval) {
522
+ clearInterval(speakerInterval);
523
+ speakerInterval = null;
524
+ }
525
+ } else {
526
+ speakerStartedAt = Date.now();
527
+ speakerRunning = true;
528
+ speakerInterval = setInterval(updateTimerDisplay, 250);
529
+ }
530
+ syncTimerButton();
531
+ updateTimerDisplay();
532
+ });
533
+
534
+ timerReset?.addEventListener("click", () => {
535
+ speakerRunning = false;
536
+ speakerElapsedMs = 0;
537
+ if (speakerInterval) {
538
+ clearInterval(speakerInterval);
539
+ speakerInterval = null;
540
+ }
541
+ syncTimerButton();
542
+ updateTimerDisplay();
543
+ });
544
+
545
+ function updateWallClock() {
546
+ if (!wallClock) return;
547
+ try {
548
+ wallClock.textContent = new Date().toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
549
+ } catch {
550
+ wallClock.textContent = "";
551
+ }
552
+ }
553
+
554
+ if (wallClock) {
555
+ updateWallClock();
556
+ setInterval(updateWallClock, 1000);
557
+ }
558
+
559
+ if (upNextRoot?.parentElement && typeof ResizeObserver !== "undefined") {
560
+ const ro = new ResizeObserver(() => {
561
+ fitPreview(upNextRoot.parentElement, upNextRoot.querySelector(".up-next-preview"));
562
+ });
563
+ ro.observe(upNextRoot.parentElement);
564
+ }
565
+
566
+ window.addEventListener("resize", () => {
567
+ if (overviewOpen) fitAllOverviewThumbs();
220
568
  });
221
569
 
222
570
  async function boot() {
571
+ if (notesRoot) applyNotesScale(restoreNotesScale());
572
+ if (timerDisplay) updateTimerDisplay();
223
573
  try {
224
574
  const response = await fetch("/api/presentation");
225
575
  if (!response.ok) throw new Error(`Server returned ${response.status}`);
226
576
  presentation = await response.json();
227
- document.title = `${presentation.title} · Flipbook MD`;
228
- titleRoot.textContent = presentation.title;
577
+ document.title = document.body.classList.contains("announcer")
578
+ ? `${presentation.title} · Presenter · Flipbook MD`
579
+ : `${presentation.title} · Flipbook MD`;
580
+ if (titleRoot) titleRoot.textContent = presentation.title;
581
+ buildSlideStrip();
229
582
  // ?slide=N (1-based) or the server's startSlide opens on that slide and tells the announcer.
230
583
  const requested = Number(new URLSearchParams(location.search).get("slide") ?? presentation.startSlide ?? NaN);
231
584
  if (Number.isInteger(requested) && requested >= 1) {
232
585
  pendingRemote = null;
233
586
  current = requested - 1;
234
587
  render();
235
- publish();
588
+ publish("goto");
236
589
  } else if (pendingRemote) {
237
590
  const message = pendingRemote;
238
591
  pendingRemote = null;
@@ -242,6 +595,7 @@ async function boot() {
242
595
  render();
243
596
  }
244
597
  channel?.postMessage({ tab: tabId, type: "hello" });
598
+ showHud();
245
599
  } catch (error) {
246
600
  slideRoot.innerHTML = `<p class="loading">Could not load this presentation: ${escapeHtml(error.message)}</p>`;
247
601
  }
@@ -257,11 +611,49 @@ function toggleFullscreen() {
257
611
  else document.exitFullscreen?.();
258
612
  }
259
613
 
614
+ function moveOverviewFocus(delta) {
615
+ const cards = Array.from(overviewCards?.querySelectorAll(".overview-card") ?? []);
616
+ if (!cards.length) return;
617
+ const activeIdx = cards.indexOf(document.activeElement);
618
+ const base = activeIdx >= 0 ? activeIdx : current;
619
+ const nextIdx = Math.max(0, Math.min(cards.length - 1, base + delta));
620
+ cards[nextIdx]?.focus();
621
+ }
622
+
260
623
  document.addEventListener("keydown", (event) => {
261
624
  if (["INPUT", "TEXTAREA", "SELECT"].includes(document.activeElement?.tagName)) return;
262
625
  if (!presentation?.slides?.length) return;
263
626
  if (event.metaKey || event.ctrlKey || event.altKey) return;
264
- if (event.key === "ArrowRight" || event.key === " ") {
627
+
628
+ if (overviewOpen) {
629
+ if (event.key === "Escape") {
630
+ event.preventDefault();
631
+ event.stopPropagation();
632
+ closeOverview();
633
+ } else if (event.key.toLowerCase() === "g") {
634
+ event.preventDefault();
635
+ closeOverview();
636
+ } else if (event.key === "ArrowRight" || event.key === "ArrowDown") {
637
+ event.preventDefault();
638
+ moveOverviewFocus(1);
639
+ } else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
640
+ event.preventDefault();
641
+ moveOverviewFocus(-1);
642
+ } else if (event.key === "Home") {
643
+ event.preventDefault();
644
+ moveOverviewFocus(-presentation.slides.length);
645
+ } else if (event.key === "End") {
646
+ event.preventDefault();
647
+ moveOverviewFocus(presentation.slides.length);
648
+ }
649
+ return;
650
+ }
651
+
652
+ if (event.key === "ArrowRight") {
653
+ event.preventDefault();
654
+ go(current + 1);
655
+ } else if (event.key === " ") {
656
+ if (document.activeElement?.closest("button, a")) return;
265
657
  event.preventDefault();
266
658
  go(current + 1);
267
659
  } else if (event.key === "ArrowLeft") {
@@ -278,6 +670,9 @@ document.addEventListener("keydown", (event) => {
278
670
  setPlaying(!playing);
279
671
  } else if (event.key.toLowerCase() === "f") {
280
672
  toggleFullscreen();
673
+ } else if (event.key.toLowerCase() === "g" && overviewDialog) {
674
+ event.preventDefault();
675
+ toggleOverview();
281
676
  }
282
677
  });
283
678
 
package/public/index.html CHANGED
@@ -8,22 +8,33 @@
8
8
  <link rel="stylesheet" href="/styles.css">
9
9
  <script src="/app.js" defer></script>
10
10
  </head>
11
- <body>
12
- <header class="topbar">
13
- <a class="brand" href="/" aria-label="Flipbook MD home">FLIPBOOK <span>MD</span></a>
14
- <div class="topbar-right"><span id="deck-title">Loading presentation…</span><a class="view-link" href="/announcer" target="_blank" rel="noopener noreferrer">Announcer</a><button id="fullscreen" class="icon-button" title="Toggle fullscreen (F)" aria-label="Toggle fullscreen">⛶</button></div>
15
- </header>
16
- <main>
11
+ <body class="audience">
12
+ <main class="stage">
17
13
  <section id="slide" class="slide" aria-live="polite" aria-label="Current slide">
18
14
  <p class="loading">Loading your slides…</p>
19
15
  </section>
20
- <nav class="controls" aria-label="Slide navigation">
21
- <button id="previous" class="nav-button" type="button" aria-label="Previous slide">← <span>Previous</span></button>
22
- <button id="play" class="nav-button primary" type="button" aria-pressed="false" aria-label="Play">▶ <span>Play</span></button>
23
- <div class="slide-meta"><span id="counter">— / —</span><div class="progress"><div id="progress-bar"></div></div></div>
24
- <button id="next" class="nav-button" type="button" aria-label="Next slide"><span>Next</span> →</button>
25
- </nav>
26
16
  </main>
27
- <footer><span>Made with <strong>Flipbook MD</strong></span><span>← / → or Space · P play · F fullscreen</span></footer>
17
+
18
+ <nav class="hud" aria-label="Slide navigation">
19
+ <button id="previous" class="hud-button nav-button" type="button" aria-label="Previous slide" title="Previous slide (←)">←</button>
20
+ <div class="slide-meta">
21
+ <span id="counter">— / —</span>
22
+ <div class="progress"><div id="progress-bar"></div></div>
23
+ </div>
24
+ <button id="next" class="hud-button nav-button" type="button" aria-label="Next slide" title="Next slide (→)">→</button>
25
+ <span class="hud-sep" aria-hidden="true"></span>
26
+ <button id="play" class="hud-button nav-button primary" type="button" aria-pressed="false" aria-label="Play" title="Play / Pause (P)">▶ <span>Play</span></button>
27
+ <button id="grid-toggle" class="hud-button nav-button" type="button" aria-expanded="false" aria-controls="overview-grid" aria-label="Slide overview" title="Slide overview (G)">▦ <span>Grid</span></button>
28
+ <a class="view-link hud-button" href="/announcer" target="_blank" rel="noopener noreferrer" title="Open Presenter View">Presenter</a>
29
+ <button id="fullscreen" class="hud-button icon-button" type="button" title="Toggle fullscreen (F)" aria-label="Toggle fullscreen">⛶</button>
30
+ </nav>
31
+
32
+ <div id="overview-grid" class="overview-dialog" role="dialog" aria-modal="true" aria-label="Slide overview" hidden>
33
+ <div class="overview-header">
34
+ <h2 id="deck-title">Slides</h2>
35
+ <button id="grid-close" class="hud-button icon-button" type="button" aria-label="Close slide overview" title="Close (Esc)">✕</button>
36
+ </div>
37
+ <div id="overview-cards" class="overview-cards"></div>
38
+ </div>
28
39
  </body>
29
40
  </html>
package/public/styles.css CHANGED
@@ -1,38 +1,113 @@
1
1
  /* Player chrome. Slide paint lives in slide.css, so presentation.css cannot restyle these controls. */
2
- :root{color-scheme:dark;--bg:#0a0f1d;--panel:#121a2e;--text:#f4f6fc;--muted:#a8b2ca;--accent:#9aa8ff;--mint:#75e3c2;--line:#2a3550;--code:#0a1020}
2
+ :root{color-scheme:dark;--bg:#070b14;--panel:#121a2e;--panel-soft:#16203a;--text:#f4f6fc;--muted:#a8b2ca;--accent:#9aa8ff;--mint:#75e3c2;--line:#2a3550;--code:#0a1020}
3
3
  *{box-sizing:border-box}
4
- body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:radial-gradient(ellipse at 50% -20%,#202d51 0,transparent 55%),var(--bg);color:var(--text);font:16px/1.55 ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
5
- .topbar{height:68px;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0 clamp(1rem,4vw,3.5rem);border-bottom:1px solid #ffffff12}
6
- .brand{font-weight:850;letter-spacing:.06em;color:var(--text);text-decoration:none}
7
- .brand span{color:var(--accent)}
8
- .topbar-right{display:flex;align-items:center;gap:1rem;color:var(--muted);font-size:.9rem}
9
- .icon-button,.nav-button{border:1px solid var(--line);background:#151e34;color:var(--text);padding:.65rem .95rem;border-radius:12px;font:inherit;cursor:pointer}
10
- .icon-button:hover,.nav-button:hover:not(:disabled){border-color:var(--accent)}
11
- main{width:min(1120px,94vw);margin:auto;flex:1;display:flex;flex-direction:column;justify-content:center;padding:clamp(1.25rem,4vh,3rem) 0}
12
- #slide{position:relative!important;z-index:0!important;width:100%!important;min-height:min(65vh,660px)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;justify-content:center!important}
13
- .controls{display:flex;align-items:center;gap:.8rem;padding:1rem .1rem}
14
- .nav-button:disabled{opacity:.35;cursor:not-allowed}
15
- .nav-button.primary{background:#aab4ff;color:#0b1020;border-color:#aab4ff;font-weight:750}
16
- .slide-meta{flex:1;text-align:center;color:var(--muted);font-size:.85rem;font-variant-numeric:tabular-nums}
17
- .progress{height:4px;max-width:180px;margin:.45rem auto 0;background:#29334c;border-radius:99px;overflow:hidden}
4
+ body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:radial-gradient(ellipse at 50% -20%,#1b2747 0,transparent 55%),var(--bg);color:var(--text);font:16px/1.55 ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
5
+
6
+ .icon-button,.hud-button,.nav-button{border:1px solid var(--line);background:#151e34;color:var(--text);padding:.5rem .8rem;border-radius:10px;font:inherit;font-size:.88rem;line-height:1.2;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;text-decoration:none;white-space:nowrap}
7
+ .icon-button:hover,.nav-button:hover:not(:disabled),.hud-button:hover:not(:disabled){border-color:var(--accent)}
8
+ .icon-button:focus-visible,.nav-button:focus-visible,.hud-button:focus-visible,.overview-card:focus-visible,.strip-item:focus-visible,.view-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
9
+ .nav-button:disabled,.hud-button:disabled{opacity:.38;cursor:not-allowed}
10
+ .nav-button.primary,.hud-button.primary{background:#aab4ff;color:#0b1020;border-color:#aab4ff;font-weight:750}
11
+ .nav-button[aria-pressed="true"],.hud-button[aria-pressed="true"]{background:var(--mint);color:#0b1020;border-color:var(--mint)}
12
+
13
+ #slide{position:relative!important;z-index:0!important;width:100%!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;justify-content:center!important}
14
+ .loading{color:var(--muted);text-align:center}
15
+
16
+ /* Audience cinema stage */
17
+ body.audience{height:100dvh;overflow:hidden;background:#060911}
18
+ body.audience .stage{flex:1;width:min(96vw,1320px);max-height:94dvh;margin:auto;display:flex;align-items:center;justify-content:center;padding:clamp(.5rem,2vh,1.5rem) 0}
19
+ body.audience #slide{min-height:min(76vh,720px)!important;max-height:92dvh!important}
20
+
21
+ /* Auto-hiding floating HUD pill */
22
+ .hud{position:fixed;left:50%;bottom:clamp(.85rem,2.6vh,1.6rem);transform:translateX(-50%);z-index:20;display:flex;align-items:center;gap:.45rem;padding:.4rem .6rem;border-radius:999px;background:rgba(15,22,40,.88);backdrop-filter:blur(14px);border:1px solid rgba(255,255,255,.14);box-shadow:0 16px 44px rgba(0,0,0,.55);transition:opacity .22s ease,transform .22s ease;max-width:96vw}
23
+ .hud.is-hidden{opacity:0;pointer-events:none;transform:translateX(-50%) translateY(8px)}
24
+ .hud .hud-button{border-radius:999px;padding:.45rem .72rem;background:rgba(24,34,60,.9)}
25
+ .hud .hud-button.primary{background:#aab4ff;color:#0b1020;border-color:#aab4ff}
26
+ .hud .hud-button[aria-pressed="true"]{background:var(--mint);color:#0b1020;border-color:var(--mint)}
27
+ .hud-sep{width:1px;height:20px;background:rgba(255,255,255,.14);margin:0 .1rem}
28
+ .hud .slide-meta{min-width:68px;flex:0 0 auto;padding:0 .3rem}
29
+
30
+ .slide-meta{flex:1;text-align:center;color:var(--muted);font-size:.82rem;font-variant-numeric:tabular-nums}
31
+ .progress{height:4px;max-width:160px;margin:.3rem auto 0;background:#29334c;border-radius:99px;overflow:hidden}
18
32
  .progress div{height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--mint));transition:width .2s}
19
- footer{display:flex;justify-content:space-between;gap:1rem;padding:1rem clamp(1rem,4vw,3.5rem);color:#8591ae;font-size:.78rem}
20
- footer strong{color:#c6ceff}
21
- .loading{color:var(--muted)}
22
- .view-link{color:var(--text);text-decoration:none;border:1px solid var(--line);border-radius:999px;padding:.28rem .7rem;font-size:.78rem;letter-spacing:.04em}
33
+
34
+ /* G overview thumbnail grid */
35
+ .overview-dialog{position:fixed;inset:0;z-index:40;background:rgba(7,11,20,.94);backdrop-filter:blur(14px);display:flex;flex-direction:column;padding:clamp(1rem,3vw,2rem);gap:1rem;overflow:hidden}
36
+ .overview-dialog[hidden]{display:none!important}
37
+ .overview-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding-bottom:.5rem;border-bottom:1px solid var(--line)}
38
+ .overview-header h2{margin:0;font-size:1rem;font-weight:700;letter-spacing:.02em;color:var(--text)}
39
+ .overview-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1rem;overflow-y:auto;padding:.35rem .25rem 1rem}
40
+ .overview-card{display:flex;flex-direction:column;gap:.5rem;padding:.65rem;border-radius:14px;border:1px solid var(--line);background:var(--panel);color:var(--text);text-align:left;cursor:pointer;font:inherit;transition:border-color .15s,transform .15s}
41
+ .overview-card:hover{border-color:var(--accent);transform:translateY(-2px)}
42
+ .overview-card.is-active{border-color:var(--mint);box-shadow:0 0 0 1px var(--mint)}
43
+ .overview-thumb{position:relative;width:100%;aspect-ratio:16/9;overflow:hidden;border-radius:8px;border:1px solid #ffffff14;background:#0d1426;pointer-events:none}
44
+ .overview-thumb-inner{position:absolute;top:0;left:0;width:960px;height:540px;transform-origin:top left;pointer-events:none}
45
+ .overview-meta{display:flex;align-items:center;gap:.5rem;font-size:.82rem;min-width:0}
46
+ .overview-num{flex:0 0 auto;font-variant-numeric:tabular-nums;color:var(--mint);font-weight:700}
47
+ .overview-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
48
+
49
+ /* Presenter View (/announcer) */
50
+ .topbar{min-height:56px;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.5rem clamp(1rem,3vw,2rem);border-bottom:1px solid #ffffff12;background:rgba(12,18,34,.8)}
51
+ .topbar-left{display:flex;align-items:center;gap:.85rem;min-width:0}
52
+ .brand{font-weight:850;letter-spacing:.06em;color:var(--text);text-decoration:none;white-space:nowrap}
53
+ .brand span{color:var(--accent)}
54
+ .deck-title{color:var(--muted);font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
55
+ .topbar-right{display:flex;align-items:center;gap:.6rem;color:var(--muted);font-size:.9rem}
56
+ .view-link{color:var(--text);text-decoration:none;border:1px solid var(--line);border-radius:999px;padding:.35rem .75rem;font-size:.8rem;letter-spacing:.03em;display:inline-flex;align-items:center}
23
57
  .view-link:hover{border-color:var(--accent);color:var(--accent)}
24
- .nav-button[aria-pressed="true"]{background:var(--mint);color:#0b1020;border-color:var(--mint)}
25
- body.announcer main{width:min(1280px,96vw);display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,380px);grid-template-areas:"slide notes" "controls controls";align-items:center;column-gap:1.25rem}
26
- body.announcer #slide{grid-area:slide}
27
- body.announcer .controls{grid-area:controls}
28
- .notes-panel{grid-area:notes;align-self:stretch;min-height:0;max-height:min(65vh,660px);overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:1rem 1.15rem 1.2rem}
29
- .notes-panel h2{margin:0 0 .75rem;font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
58
+
59
+ .presenter-clock-group{display:flex;align-items:center;gap:1rem;font-variant-numeric:tabular-nums}
60
+ .timer-widget{display:flex;align-items:center;gap:.45rem;padding:.25rem .45rem;border-radius:10px;background:var(--panel);border:1px solid var(--line)}
61
+ .timer-display{font-size:1.05rem;font-weight:750;min-width:3.6rem;text-align:center;color:var(--mint)}
62
+ .timer-button{padding:.28rem .55rem;font-size:.76rem;border-radius:7px}
63
+ .wall-clock{font-size:.92rem;color:var(--muted);min-width:3.5rem;text-align:right}
64
+
65
+ body.announcer .presenter-main{width:min(1440px,98vw);margin:0 auto;flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.4fr) minmax(290px,1fr);grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"stage sidebar" "bottom bottom";gap:1rem;padding:.85rem clamp(.75rem,2.5vw,1.75rem) 1rem}
66
+ .presenter-stage{grid-area:stage;display:flex;flex-direction:column;gap:.45rem;min-height:0}
67
+ body.announcer #slide{min-height:min(54vh,560px)!important;flex:1}
68
+ .panel-label{font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);font-weight:700}
69
+
70
+ .presenter-sidebar{grid-area:sidebar;display:flex;flex-direction:column;gap:.85rem;min-height:0}
71
+ .up-next-panel{display:flex;flex-direction:column;gap:.4rem}
72
+ .up-next-frame{position:relative;width:100%;aspect-ratio:16/9;max-height:220px;overflow:hidden;border-radius:14px;border:1px solid var(--line);background:#0c1222;display:flex;align-items:center;justify-content:center}
73
+ .up-next-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center;position:relative}
74
+ .up-next-preview{position:absolute;top:0;left:0;width:960px;height:540px;transform-origin:top left;pointer-events:none}
75
+ .up-next-end{margin:0;color:var(--muted);font-size:.92rem;font-weight:600;letter-spacing:.02em;padding:1rem;text-align:center}
76
+
77
+ .notes-panel{flex:1;min-height:170px;display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:.85rem 1rem 1rem;overflow:hidden}
78
+ .notes-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.6rem;flex:0 0 auto}
79
+ .notes-header h2{margin:0;font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
80
+ .notes-scale-controls{display:flex;gap:.35rem}
81
+ .scale-button{padding:.22rem .5rem;font-size:.76rem;border-radius:7px;font-weight:700}
82
+ .notes-body{flex:1;overflow:auto;font-size:1rem;line-height:1.55}
30
83
  .notes-body p,.notes-body ul,.notes-body ol{margin:.45rem 0}
31
84
  .notes-body ul,.notes-body ol{padding-left:1.15rem}
32
85
  .notes-body a{color:var(--accent)}
33
86
  .notes-body code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.88em}
34
87
  .notes-body img{max-width:100%;height:auto}
35
88
  .notes-empty{color:var(--muted)}
36
- @media(max-width:800px){body.announcer main{grid-template-columns:1fr;grid-template-areas:"slide" "controls" "notes"}.notes-panel{max-height:28vh}}
37
- @media(max-width:640px){.topbar{height:60px}.topbar-right{font-size:.75rem;gap:.5rem}#slide{min-height:66vh!important}.controls{gap:.4rem}.nav-button{padding:.65rem .7rem}.nav-button span{display:none}footer{font-size:.7rem}footer span:last-child{text-align:right}}
38
- @media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
89
+
90
+ .presenter-bottom{grid-area:bottom;display:flex;flex-direction:column;gap:.45rem}
91
+ .slide-strip{display:flex;align-items:center;gap:.4rem;overflow-x:auto;padding:.2rem .1rem}
92
+ .strip-item{flex:0 0 auto;display:inline-flex;align-items:center;gap:.35rem;padding:.35rem .65rem;border-radius:8px;border:1px solid var(--line);background:var(--panel);color:var(--muted);font:inherit;font-size:.78rem;cursor:pointer;max-width:180px}
93
+ .strip-item:hover{border-color:var(--accent);color:var(--text)}
94
+ .strip-item.is-active{border-color:var(--mint);background:#172742;color:var(--text);font-weight:700}
95
+ .strip-item-num{color:var(--mint);font-variant-numeric:tabular-nums}
96
+ .strip-item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
97
+
98
+ .controls{display:flex;align-items:center;gap:.8rem;padding:.35rem .1rem}
99
+
100
+ @media(max-width:900px){
101
+ body.announcer .presenter-main{grid-template-columns:1fr;grid-template-rows:auto auto auto;grid-template-areas:"stage" "sidebar" "bottom"}
102
+ .notes-panel{max-height:30vh}
103
+ .topbar{flex-wrap:wrap}
104
+ }
105
+ @media(max-width:640px){
106
+ .hud{gap:.25rem;padding:.35rem .45rem}
107
+ .hud .hud-button{padding:.4rem .55rem;font-size:.8rem}
108
+ .hud .hud-button span{display:none}
109
+ .controls{gap:.4rem}
110
+ .nav-button{padding:.5rem .65rem}
111
+ .nav-button span{display:none}
112
+ }
113
+ @media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}