/**
* Director (DESIGN.md §12.8): a presenter menu for demos. Press "." (or
* triple-tap the Today title) to open it; each beat sets up its state
* deterministically so the demo never depends on luck. Number keys 1–9 jump
* straight to a beat while the menu is closed and the director is armed.
*/
import { icon } from './icons.js';
import { esc, haptic, toast } from './dom.js';
import { createSheet } from './sheet.js';
export function createDirector({ beats, onReset }) {
const sheet = createSheet({
label: 'Director',
detents: ['large'],
modal: true,
dismissible: true,
closeButton: true,
className: 'director-sheet',
heights: { large: (H) => Math.min(Math.round(H * 0.9), 820) },
});
let armed = false;
let current = -1;
function render() {
sheet.head.innerHTML = `
${icon('director')}DIRECTOR · DEMO MODE
The story, beat by beat
Each beat sets its own state. Keys 1–9 jump; “.” reopens this menu.