From cae11c4f40c52024512a152007efa5cd94f49d2f Mon Sep 17 00:00:00 2001 From: Patrick Niebeling Date: Wed, 11 Nov 2026 22:52:06 +0100 Subject: [PATCH] Move screen tools to header as icon buttons Fullscreen and keep-awake sit next to the theme switch (layout block headerTools), icon only with aria-label/title. Co-Authored-By: Claude Sonnet 5.5 --- AGENTS.md | 2 +- templates/Participate/view.php | 27 ++++++++++++++++++++------- templates/layout/default.php | 5 ++++- webroot/css/plenario.css | 5 +++-- webroot/js/plenario.js | 9 ++++++--- 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 244b94e..bd5f501 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -269,7 +269,7 @@ tests/ PHPUnit; PlenarioTestTrait erzeugt Testdaten, Fixtures externen Ressourcen, keine CSS-Variablen, Schrift DejaVu Sans; Seitenzahlen setzt `PdfView::addPageNumbers()`. Tests prüfen das HTML über `PlenarioTestTrait::exportHtml()` (das PDF selbst ist nicht durchsuchbar). -- **Vollbild & Display anlassen** (Teilnehmeransicht, `initScreenTools` in `plenario.js`): zwei optionale Buttons +- **Vollbild & Display anlassen** (Teilnehmeransicht, `initScreenTools` in `plenario.js`): zwei optionale Icon-Buttons im Header neben dem Farbschema-Schalter (Layout-Block `headerTools`) (`data-fullscreen-toggle`, `data-wakelock-toggle`), bleiben ohne Browser-Unterstützung versteckt (iPhone-Safari kennt kein Vollbild). Der Wake Lock ist standardmäßig an (braucht keine Nutzergeste); nur ein bewusstes Ausschalten wird gemerkt. Die Seite lädt bei Folienwechsel neu: der Wake Lock wird per `sessionStorage` (`plenario-wakelock`) wieder angefordert, diff --git a/templates/Participate/view.php b/templates/Participate/view.php index fb20ad5..11abae7 100644 --- a/templates/Participate/view.php +++ b/templates/Participate/view.php @@ -40,13 +40,26 @@ $countdown = function (?int $remaining): string {

title) ?>

- -
- - -
+ + start('headerTools'); ?> + + + end(); ?> is_active) : ?>
diff --git a/templates/layout/default.php b/templates/layout/default.php index 652a2a7..fcc41d2 100644 --- a/templates/layout/default.php +++ b/templates/layout/default.php @@ -32,7 +32,10 @@ $title = $this->fetch('title'); - element('theme_switch') ?> +
+ fetch('headerTools') ?> + element('theme_switch') ?> +
diff --git a/webroot/css/plenario.css b/webroot/css/plenario.css index bc047a9..9236a6b 100644 --- a/webroot/css/plenario.css +++ b/webroot/css/plenario.css @@ -172,8 +172,7 @@ h3 { font-size: 1.05rem; margin-top: 1.6em; } .button--danger:hover { border-color: var(--danger); } .button--ghost { border-color: transparent; background: transparent; } .button--small { padding: 6px 10px; font-size: .85rem; } -.screen-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 1em; } -.screen-tools .button[aria-pressed="true"] { border-color: var(--primary); } +.header-tools { display: flex; align-items: center; gap: 8px; } .button--block { width: 100%; padding: 14px; font-size: 1.05rem; } .badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); } @@ -741,6 +740,8 @@ body.present { /* ---------------------------------------------------------------- theme switch */ .theme-switch { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; } .theme-switch:hover { border-color: var(--primary); } +.theme-switch[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); } +.theme-switch[hidden] { display: none; } .theme-switch__icon { font-size: 1.3em; line-height: 1; } /* Slide form in a dialog (admin dashboard) */ diff --git a/webroot/js/plenario.js b/webroot/js/plenario.js index 89c25ff..9a2ba92 100644 --- a/webroot/js/plenario.js +++ b/webroot/js/plenario.js @@ -1582,11 +1582,14 @@ // Fullscreen and screen wake lock for the participant view (both optional, buttons stay hidden if unsupported). function initScreenTools(root) { function setPressed(button, on) { + var text = button.getAttribute(on ? 'data-label-on' : 'data-label-off'); button.setAttribute('aria-pressed', on ? 'true' : 'false'); - button.textContent = button.getAttribute(on ? 'data-label-on' : 'data-label-off'); + button.setAttribute('aria-label', text); + button.title = text; } - var fsButton = root.querySelector('[data-fullscreen-toggle]'); + // The buttons live in the layout header, outside the participant root. + var fsButton = document.querySelector('[data-fullscreen-toggle]'); if (fsButton && document.fullscreenEnabled) { fsButton.hidden = false; fsButton.addEventListener('click', function () { @@ -1602,7 +1605,7 @@ }); } - var wlButton = root.querySelector('[data-wakelock-toggle]'); + var wlButton = document.querySelector('[data-wakelock-toggle]'); if (wlButton && 'wakeLock' in navigator) { // The page reloads on every slide change, so the choice is kept per tab and re-applied on load. var STORE = 'plenario-wakelock'; -- 2.54.1