feat: optional fullscreen mode

New content element option "Vollbild-Schaltfläche anzeigen" (on by default).
The button only appears once the browser confirms it exposes the Fullscreen API
for ordinary elements -- iOS Safari offers it for video only, so there it stays
hidden rather than presenting a control that cannot work.

Fitting the book to the screen needed the layout to become height-aware. Page
size was derived from width alone, which at screen width puts an A4-proportioned
page well below the bottom of the viewport. In fullscreen the page now fits to
the available height and the narrower book is centred; pages re-render at the
new size through the existing generation-stamped path.

The height fit writes a max-width onto the stage, so in fullscreen the available
width is measured on the parent instead -- measuring the element we just
constrained would oscillate. Verified stable across repeated samples.

The resize handler body moved into relayout(), shared with the fullscreen
toggle. destroy() leaves fullscreen first so the browser is not left holding a
node that is about to go away.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Jürgen Mummert
2026-08-05 15:12:10 +02:00
co-authored by Claude Opus 5
parent 24d5606b26
commit 204fee73f5
10 changed files with 237 additions and 37 deletions
@@ -20,7 +20,7 @@ class BlatterbaresPdfController extends AbstractContentElementController
/**
* Bumped when the shipped assets change, so browsers do not keep a stale copy.
*/
private const ASSET_VERSION = '2.0.0';
private const ASSET_VERSION = '2.1.0';
public function __construct(
#[Autowire('%kernel.project_dir%')]
@@ -35,6 +35,7 @@ class BlatterbaresPdfController extends AbstractContentElementController
$template->set('pdfUrl', $this->resolvePdfUrl($model));
$template->set('showNavigation', '1' === (string) ($model->flipbookShowNavigation ?? '1'));
$template->set('showFullscreen', '1' === (string) ($model->flipbookShowFullscreen ?? '1'));
$template->set('playTurnSound', '1' === (string) ($model->flipbookPlaySound ?? '1'));
$template->set('splitSpreads', '1' === (string) ($model->flipbookSplitSpreads ?? '0'));
$template->set('initialRenderPages', $this->normalizeInitialRenderPages((string) ($model->flipbookInitialPages ?? '4')));