The slide heading on the participant page was smaller than a regular h1 on phones. The theme switch now shows only its icon; the current and next scheme stay available as aria-label and tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1.2 KiB
PHP
26 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Icon-only button that cycles the colour scheme (wired up by webroot/js/plenario.js `Theme`);
|
|
* the current and next scheme are in aria-label and title.
|
|
* Without JavaScript it stays hidden, the system setting applies.
|
|
*
|
|
* @var \App\View\AppView $this
|
|
* @var string $key localStorage key, same as in element theme_init
|
|
* @var string $modes Comma separated cycle order of auto|light|dark
|
|
* @var string $class CSS class of the button
|
|
*/
|
|
$key ??= 'plenario-theme';
|
|
$modes ??= 'auto,light,dark';
|
|
$class ??= 'theme-switch';
|
|
?>
|
|
<button type="button" class="<?= h($class) ?>" data-theme-switch hidden
|
|
data-theme-key="<?= h($key) ?>" data-theme-modes="<?= h($modes) ?>"
|
|
data-label-auto="<?= __('Automatisch') ?>" data-label-light="<?= __('Hell') ?>" data-label-dark="<?= __('Dunkel') ?>"
|
|
data-label-prefix="<?= __('Farbschema') ?>" data-label-next="<?= __('wechseln zu') ?>"
|
|
<?= !empty($shortcut) ? 'aria-keyshortcuts="' . h($shortcut) . '"' : '' ?>>
|
|
<span class="theme-switch__icon" aria-hidden="true" data-theme-icon></span>
|
|
<?php if (!empty($shortcut)) : ?>
|
|
<kbd class="ctrl__key" aria-hidden="true">[<?= h($shortcut) ?>]</kbd>
|
|
<?php endif; ?>
|
|
</button>
|