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 <noreply@anthropic.com>
This commit is contained in:
1 parent
1efa61f9bc
commit
cae11c4f40
5 files changed
+34
-14
No files matched your search
@@ -269,7 +269,7 @@ tests/ PHPUnit; PlenarioTestTrait erzeugt Testdaten, Fixtures
|
|||||||
externen Ressourcen, keine CSS-Variablen, Schrift DejaVu Sans; Seitenzahlen setzt `PdfView::addPageNumbers()`.
|
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).
|
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).
|
(`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.
|
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,
|
Die Seite lädt bei Folienwechsel neu: der Wake Lock wird per `sessionStorage` (`plenario-wakelock`) wieder angefordert,
|
||||||
|
|||||||
@@ -40,13 +40,26 @@ $countdown = function (?int $remaining): string {
|
|||||||
|
|
||||||
<p class="eyebrow eyebrow--poll center"><?= h($poll->title) ?></p>
|
<p class="eyebrow eyebrow--poll center"><?= h($poll->title) ?></p>
|
||||||
|
|
||||||
<?php // Both buttons stay hidden unless the browser supports the API (no fullscreen on iPhone Safari). ?>
|
<?php // Icon buttons in the header, next to the theme switch. Hidden unless the browser supports the API (no fullscreen on iPhone). ?>
|
||||||
<div class="screen-tools center" role="group" aria-label="<?= h(__('Anzeige')) ?>">
|
<?php $this->start('headerTools'); ?>
|
||||||
<button type="button" class="button button--small" data-fullscreen-toggle hidden aria-pressed="false"
|
<button type="button" class="theme-switch" data-fullscreen-toggle hidden aria-pressed="false"
|
||||||
data-label-on="<?= h(__('Vollbild beenden')) ?>" data-label-off="<?= h(__('Vollbild')) ?>"><?= __('Vollbild') ?></button>
|
data-label-on="<?= h(__('Vollbild beenden')) ?>" data-label-off="<?= h(__('Vollbild')) ?>"
|
||||||
<button type="button" class="button button--small" data-wakelock-toggle hidden aria-pressed="false"
|
aria-label="<?= h(__('Vollbild')) ?>" title="<?= h(__('Vollbild')) ?>">
|
||||||
data-label-on="<?= h(__('Display bleibt an')) ?>" data-label-off="<?= h(__('Display anlassen')) ?>"><?= __('Display bleibt an') ?></button>
|
<svg class="theme-switch__icon" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||||
</div>
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||||
|
<path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="theme-switch" data-wakelock-toggle hidden aria-pressed="false"
|
||||||
|
data-label-on="<?= h(__('Display bleibt an – tippen zum Ausschalten')) ?>"
|
||||||
|
data-label-off="<?= h(__('Display bleibt nicht an – tippen zum Anlassen')) ?>"
|
||||||
|
aria-label="<?= h(__('Display anlassen')) ?>" title="<?= h(__('Display anlassen')) ?>">
|
||||||
|
<svg class="theme-switch__icon" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||||
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||||
|
<path d="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<?php $this->end(); ?>
|
||||||
|
|
||||||
<?php if (!$poll->is_active) : ?>
|
<?php if (!$poll->is_active) : ?>
|
||||||
<section class="card center">
|
<section class="card center">
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ $title = $this->fetch('title');
|
|||||||
<a href="<?= $this->Url->build(['_name' => 'join']) ?>"><?= __('Teilnehmen') ?></a>
|
<a href="<?= $this->Url->build(['_name' => 'join']) ?>"><?= __('Teilnehmen') ?></a>
|
||||||
<a href="<?= $this->Url->build(['_name' => 'recover']) ?>"><?= __('Admin-Link verloren?') ?></a>
|
<a href="<?= $this->Url->build(['_name' => 'recover']) ?>"><?= __('Admin-Link verloren?') ?></a>
|
||||||
</nav>
|
</nav>
|
||||||
<?= $this->element('theme_switch') ?>
|
<div class="header-tools">
|
||||||
|
<?= $this->fetch('headerTools') ?>
|
||||||
|
<?= $this->element('theme_switch') ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<main class="container main">
|
<main class="container main">
|
||||||
|
|||||||
@@ -172,8 +172,7 @@ h3 { font-size: 1.05rem; margin-top: 1.6em; }
|
|||||||
.button--danger:hover { border-color: var(--danger); }
|
.button--danger:hover { border-color: var(--danger); }
|
||||||
.button--ghost { border-color: transparent; background: transparent; }
|
.button--ghost { border-color: transparent; background: transparent; }
|
||||||
.button--small { padding: 6px 10px; font-size: .85rem; }
|
.button--small { padding: 6px 10px; font-size: .85rem; }
|
||||||
.screen-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 1em; }
|
.header-tools { display: flex; align-items: center; gap: 8px; }
|
||||||
.screen-tools .button[aria-pressed="true"] { border-color: var(--primary); }
|
|
||||||
.button--block { width: 100%; padding: 14px; font-size: 1.05rem; }
|
.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); }
|
.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 */
|
||||||
.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 { 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: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; }
|
.theme-switch__icon { font-size: 1.3em; line-height: 1; }
|
||||||
|
|
||||||
/* Slide form in a dialog (admin dashboard) */
|
/* Slide form in a dialog (admin dashboard) */
|
||||||
|
|||||||
@@ -1582,11 +1582,14 @@
|
|||||||
// Fullscreen and screen wake lock for the participant view (both optional, buttons stay hidden if unsupported).
|
// Fullscreen and screen wake lock for the participant view (both optional, buttons stay hidden if unsupported).
|
||||||
function initScreenTools(root) {
|
function initScreenTools(root) {
|
||||||
function setPressed(button, on) {
|
function setPressed(button, on) {
|
||||||
|
var text = button.getAttribute(on ? 'data-label-on' : 'data-label-off');
|
||||||
button.setAttribute('aria-pressed', on ? 'true' : 'false');
|
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) {
|
if (fsButton && document.fullscreenEnabled) {
|
||||||
fsButton.hidden = false;
|
fsButton.hidden = false;
|
||||||
fsButton.addEventListener('click', function () {
|
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) {
|
if (wlButton && 'wakeLock' in navigator) {
|
||||||
// The page reloads on every slide change, so the choice is kept per tab and re-applied on load.
|
// The page reloads on every slide change, so the choice is kept per tab and re-applied on load.
|
||||||
var STORE = 'plenario-wakelock';
|
var STORE = 'plenario-wakelock';
|
||||||
|
|||||||
Reference in new issue
Block a user