.chrome-menu{position:fixed;z-index:30;width:230px;padding:8px;background:#203033;border:1px solid #557177;border-radius:10px;box-shadow:0 12px 45px #0008}.chrome-menu button{display:block;width:100%;text-align:left;border:0;background:transparent}.chrome-menu button:hover{background:#35484c}#presenterHeader.peek{position:fixed;top:var(--concept-height,0px);left:0;right:0;z-index:8;background:#192528;box-shadow:0 12px 35px #0008}#presenterFooter.peek{position:fixed;bottom:0;left:0;right:0;margin:0;padding:14px 24px;z-index:8;background:#192528;box-shadow:0 -12px 35px #0008}.layout-open #presenterFooter.peek{right:330px}.menu{z-index:10}@media(max-width:850px){.layout-open #presenterFooter.peek{right:0}}
</style>
</head>
<body>
<divclass="concept"><span><strong>INTERACTIVE CONCEPT</strong> · Mock slides and screens. No real display or system settings change.</span><labelclass="project-picker">Demo project <selectid="demoProject"><optionvalue="ideas">Making room for ideas</option><optionvalue="workshop">Workshop</option></select></label><label>Test setup <selectid="topology"><optionvalue="3">3 screens</option><optionvalue="4">4 screens</option><optionvalue="2">Projector disconnected</option><optionvalue="1">Laptop only</option></select></label></div>
<headerid="presenterHeader"><spanclass="brand">P</span><buttonid="menuButton"aria-expanded="false"aria-controls="menu">☰ Menu</button><divclass="doc"><bid="projectTitle">Making room for ideas</b><small>demo.pdf · 12 slides</small></div><divclass="toolbar"><buttonid="hideHeader"title="Hide header; move near the top edge to reveal"aria-label="Hide header">⌃</button><buttonid="displayButton">Displays · 1 → 3</button><buttonid="blankButton">Blank presentation</button><buttonid="slidesButton">All slides</button><buttonid="layoutButton"class="layout-button"aria-controls="layoutPanel"aria-expanded="false">Layout</button><divid="elapsedWidget"class="clock-widget"><small>Elapsed</small><spanclass="timer"id="timer">00:00</span></div><divid="clockWidget"class="clock-widget"><small>Time</small><spanclass="timer"id="wallClock">00:00</span></div></div></header>
<main><divclass="previews"id="previews"><sectionid="previousPreview"class="previous-preview"><divclass="caption"><span>PREVIOUS</span><spanid="previousCount"></span></div><divclass="slide"><spanclass="eyebrow">LOOKING BACK</span><h1id="previousTitle">Start of presentation</h1><divclass="orb"></div></div></section><sectionid="currentPreview"><divclass="caption"><span>CURRENT · <spanid="currentCount">1 / 12</span></span></div><divclass="slide"><spanclass="eyebrow">BEFFROI / FIELD NOTES</span><h1id="currentTitle">Making room<br>for ideas.</h1><pid="currentSubtitle">A clear view. A little space. A better presentation.</p><divclass="orb"></div><spanclass="slide-foot">DESIGN SESSION · NOVEMBER 2026</span></div></section><sectionclass="next"id="nextPreview"><divclass="caption"><span>NEXT</span><spanid="nextCount">2 / 12</span></div><divclass="slide"><spanclass="eyebrow">THE STARTING POINT</span><h1id="nextTitle">Keep the<br>focus.</h1><divclass="orb"></div></div><divclass="next-hint">Your slides go to <strongid="destination">Screen 3 · Epson projector</strong>.<br>Menus and notes stay on the presenter screen.</div></section></div>
<sectionclass="notes"id="notesWidget"><divclass="caption"><span>PRESENTER NOTES <small> · auto-fit</small></span><divclass="notes-tools"><buttonid="longNotes">Try long notes</button><buttonid="notesLayout">Resize & visibility</button></div></div><divclass="note-box"id="noteBox"><pclass="note-text"id="noteText"></p></div></section>
<footer><buttonid="previous">← Previous</button><buttonclass="primary"id="next">Next →</button><spanclass="kbd">← → slides · number + Enter to jump · B blank</span><bid="outputBadge">PRESENTATION VISIBLE</b><spanclass="status"id="routeStatus">Presenter 1 · Presentation 3</span></footer><divid="toast"role="status"aria-live="polite"></div></main>
<footerid="presenterFooter"><buttonid="previous">← Previous</button><buttonclass="primary"id="next">Next →</button><spanclass="kbd">← → slides · number + Enter to jump · B blank</span><bid="outputBadge">PRESENTATION VISIBLE</b><spanclass="status"id="routeStatus">Presenter 1 · Presentation 3</span><buttonid="hideFooter"title="Hide footer; move near the bottom edge to reveal"aria-label="Hide footer">⌄</button></footer><divid="toast"role="status"aria-live="polite"></div></main>
<divclass="layout-control"><label><inputid="showHeader"type="checkbox"checked> Keep header visible</label><labelstyle="margin-top:12px"><inputid="showFooter"type="checkbox"checked> Keep footer visible</label><small>Hidden bars reveal near the top/bottom edge. Right-click anywhere on the presenter to show them again.</small></div><divid="layoutControls"></div>
<small>Preview sizes share the available width. Notes size controls their share of the height; text always fits. Clock sizes control their text size.</small>
<small>Project layouts override the default for all projects. Saved layouts persist in this browser; native configuration remains planned.</small>
<divclass="layout-save"><buttonclass="primary"id="saveProjectLayout">Save layout · This project</button><buttonid="saveGlobalLayout">Save layout · All projects</button><buttonid="useGlobalLayout">Use all-projects default</button><pid="layoutSaveStatus"role="status"aria-live="polite"></p></div>
</aside>
<dialogid="displayDialog"aria-labelledby="displayTitle"><divclass="dialog-head"><div><h2id="displayTitle">Where should each view go?</h2><small>Presenter = your controls and notes. Presentation = slides for viewers.</small></div><buttonaria-label="Close displays"data-close="displayDialog">✕</button></div><divclass="dialog-body"><divstyle="display:flex;justify-content:space-between;align-items:center"><spanclass="pill">CONNECTED SCREENS · SIMULATED</span><buttonid="identify">Identify screens</button></div><divclass="map"id="screenMap"></div><divid="screenRoles"class="screen-roles"></div><buttonid="swap">⇄ Swap presenter and presentation groups</button><divclass="checks"><label><inputid="presenterFull"type="checkbox"checked> Presenter fullscreen</label><label><inputid="presentationFull"type="checkbox"checked> Presentation fullscreen</label><label><inputid="remember"type="checkbox"checked> Remember this setup</label></div><divclass="notice"id="displayNotice">Choose destinations, then Apply. Unused screens stay untouched.</div></div><divclass="dialog-actions"><small>Changes apply together.</small><buttondata-close="displayDialog">Cancel</button><buttonclass="primary"id="apply">Apply setup</button></div></dialog>
<dialogid="settingsDialog"aria-labelledby="settingsTitle"><divclass="dialog-head"><div><h2id="settingsTitle">Settings</h2><small>Proposed app behavior · not operating-system settings</small></div><buttonaria-label="Close settings"data-close="settingsDialog">✕</button></div><divclass="dialog-body"><divclass="settings-row"><b>Remember your screens</b><br><spanclass="muted">Keep preferred screen identities, fullscreen choices and notes layout in a per-user configuration. Temporary fallback does not replace your preferred setup.</span></div><divclass="settings-row"><b>Configuration location</b><br><code>Linux: $XDG_CONFIG_HOME/pdf-presenter/settings.toml</code><br><small>Defaults to ~/.config/pdf-presenter/settings.toml</small><br><code>Windows: %APPDATA%\Beffroi\PdfPresenter\settings.toml</code><br><code>macOS: ~/Library/Application Support/Beffroi/PdfPresenter/settings.toml</code></div><divclass="settings-row"><b>Keep screens awake during presentation</b><br><spanclass="muted">Planned native feature. Includes paused and blanked output; this HTML does not inhibit sleep.</span></div><divclass="notice">Saved layouts persist in this browser, with project overrides above the all-projects default. Screen assignments remain session-only. The native app's global configuration is not implemented yet.</div></div><divclass="dialog-actions"><buttonclass="primary"data-close="settingsDialog">Done</button></div></dialog>
<navid="chromeMenu"class="chrome-menu"aria-label="Presenter visibility"hidden><buttonid="contextHeader">Hide header</button><buttonid="contextFooter">Hide footer</button><buttonid="contextBoth">Show header and footer</button><buttonid="contextLayout">Layout…</button></nav>
</style></head><body><header><h1>All slides</h1><label>Preview size <inputid="thumbnailSize"type="range"min="130"max="380"value="220"></label><label><inputid="changeOnClick"type="checkbox"> Change on click</label><label>Open on <selectid="galleryMonitor"></select></label></header><pid="placementHint">Windowed by default. Monitor selection is simulated in this HTML prototype.</p><mainid="galleryGrid"aria-label="Slide thumbnails"></main><footer><spanid="galleryStatus"role="status"></span><buttonid="showSelected">Show selected slide</button><buttonid="closeGallery">Close</button></footer><divid="jumpIndicator"role="status"hidden></div></body></html>
</template>
<script>
@ -47,7 +50,7 @@ const titles=['Making room for ideas.','Keep the focus.','A shared perspective.'
let count=3,page=0,blank=false,long=false,start=Date.now(),active={presenter:[1],presentation:[3],presenterFull:true,presentationFull:true},preferred=structuredClone(active),draft=structuredClone(active);
$('useGlobalLayout').onclick=()=>{try{const saved=readLayouts();delete saved.projects[projectId];localStorage.setItem(layoutStorageKey,JSON.stringify(saved));restoreLayout();}catch{layoutStatus('Could not remove this project’s override. Your current layout is unchanged.');}};
$('demoProject').onchange=()=>{projectId=$('demoProject').value;$('projectTitle').textContent=$('demoProject').selectedOptions[0].textContent;restoreLayout();message('Demo project switched. Unsaved layout edits were discarded.');};
function availableHeight(){const main=document.querySelector('main');main.style.height=Math.max(430,innerHeight-main.getBoundingClientRect().top)+'px';}
function availableHeight(){document.documentElement.style.setProperty('--concept-height',document.querySelector('.concept').getBoundingClientRect().bottom+'px');const main=document.querySelector('main');main.style.height=Math.max(430,innerHeight-main.getBoundingClientRect().top)+'px';}
function applyLayout(){
resetChromePeek();
layoutStatus('Layout changes are not saved until you choose a save scope.');
for(const [key] of layoutSpecs){$(widgets[key]).hidden=!layout[key].show;const toggle=$('show-'+key);if(toggle)toggle.checked=layout[key].show;$('size-'+key).value=layout[key].size;$('size-'+key).disabled=!layout[key].show;$('value-'+key).textContent=layout[key].size+(key==='notes'?'%':['clock','elapsed'].includes(key)?'px':'');}
$('focusLayout').onclick=()=>{layout=structuredClone(layoutDefaults);for(const k of ['previous','next','notes','elapsed','clock'])layout[k].show=false;applyLayout();};
for(const key of ['header','footer']){const bar=chromeElement(key);bar.hidden=!layout.chrome[key]&&!chromePeek[key];bar.classList.toggle('peek',!layout.chrome[key]&&chromePeek[key]);$(key==='header'?'showHeader':'showFooter').checked=layout.chrome[key];}
function resetChromePeek(){for(const key of ['header','footer']){clearTimeout(chromeTimers[key]);chromePeek[key]=false;}paintChrome();}
function setChromePinned(key,visible){layout.chrome[key]=visible;if(!visible&&chromeElement(key).contains(document.activeElement))document.activeElement.blur();if(key==='header'&&!visible)closeMenu();applyLayout();}
function chromeBusy(key){const bar=chromeElement(key);return bar.contains(chromePointerTarget)||bar.contains(document.activeElement)||(key==='header'&&!$('menu').hidden);}
function scheduleChromeHide(key){clearTimeout(chromeTimers[key]);chromeTimers[key]=setTimeout(()=>{if(!chromeBusy(key)){chromePeek[key]=false;paintChrome();}},650);}
function revealChrome(key){if(layout.chrome[key])return;clearTimeout(chromeTimers[key]);if(chromePeek[key])return;chromePeek[key]=true;paintChrome();}
document.addEventListener('pointermove',e=>{chromePointerTarget=e.target;if(document.querySelector('dialog[open]')||!$('chromeMenu').hidden)return;const nearTop=e.clientY<=document.querySelector('.concept').getBoundingClientRect().bottom+14;const nearBottom=e.clientY>=innerHeight-18;for(const [key,near] of [['header',nearTop],['footer',nearBottom]]){if(near)revealChrome(key);else if(chromePeek[key]){if(chromeBusy(key))clearTimeout(chromeTimers[key]);else scheduleChromeHide(key);}}});
document.addEventListener('pointerleave',()=>{chromePointerTarget=null;for(const key of ['header','footer'])scheduleChromeHide(key);});
for(const key of ['header','footer'])chromeElement(key).addEventListener('focusout',()=>scheduleChromeHide(key));
function closeChromeMenu(){const hadFocus=$('chromeMenu').contains(document.activeElement);$('chromeMenu').hidden=true;if(hadFocus){document.body.tabIndex=-1;document.body.focus({preventScroll:true});}}
new ResizeObserver(availableHeight).observe(document.querySelector('.concept'));
new ResizeObserver(availableHeight).observe(document.querySelector('header'));window.addEventListener('resize',availableHeight);
function closeMenu(){$('menu').hidden=true;$('menuButton').setAttribute('aria-expanded','false');}
@ -166,7 +196,7 @@ function handleNumberJump(e,doc){
const indicator=doc.getElementById('jumpIndicator');indicator.hidden=false;indicator.textContent=`Go to slide ${digits} · Enter to show · Esc to cancel`;return true;
function updateClocks(){const seconds=Math.floor((Date.now()-start)/1000);$('timer').textContent=String(Math.floor(seconds/60)).padStart(2,'0')+':'+String(seconds%60).padStart(2,'0');const now=new Date();$('wallClock').textContent=String(now.getHours()).padStart(2,'0')+':'+String(now.getMinutes()).padStart(2,'0');}setInterval(updateClocks,1000);updateClocks();restoreLayout();render();
constr=$('chromeMenu').getBoundingClientRect();check(r.right<=innerWidth&&r.bottom<=innerHeight,'Context menu stays inside viewport');
$('contextBoth').click();check(!$('presenterHeader').hidden&&!$('presenterFooter').hidden&&layout.chrome.header&&layout.chrome.footer,'Context menu restores both bars');
check(!layout.chrome.header&&!layout.chrome.footer,'Hidden bars round-trip per project');
saveLayout('global');check(!readLayouts().global.chrome.header,'Global save includes visibility');
constold=structuredClone(layoutDefaults);deleteold.chrome;check(validateLayout(old).chrome.header&&validateLayout(old).chrome.footer,'Older records migrate to visible bars');
pointer(document.body,2);$('hideHeader').click();check(layout.chrome.header&&!$('presenterHeader').classList.contains('peek'),'Revealed bar can be pinned');