Files
LarsandClaude Opus 5.5 d2f53ceb84 Theme Seebad 0.4.0: menu panels; fix missing chevron icons; render test for all themes
- Menu panels: arrow next to each main menu item opens a panel with the page description (SEO text),
  jump links to the headed sections and a cartouche with booking and phone; Escape/outside click closes,
  focus returns; without JavaScript the menu stays plain links
- Header: booking button hidden between 1280 and 1535 px (too narrow with the arrows), desktop phone removed
- Fix: offers carousel and menu used outline chevron icons that do not exist (500 as soon as offers are shown);
  now mini chevrons
- New test: every installed theme renders all pages with reviews and offers in every display mode
- Wish: menu photo per page (ZUSAMMENARBEIT §5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 12:33:11 +02:00

105 lines
7.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@php
$phone = (string) config('fewo.owner.phone');
// Menu panels: jump links to the headed sections of each page (sections limited to appearances are left out).
$menuEntries = $theme->menu('main')->values()->map(fn ($page, $position) => [
'page' => $page,
'panel' => 'menu-panel-'.$position,
'anchors' => collect($page->sections ?? [])
->map(fn ($section, $index) => [
'label' => $section['data']['heading'] ?? null,
'id' => ($section['type'] ?? '').'-'.$index.'-title',
'type' => $section['type'] ?? '',
'limited' => ! empty($section['data']['appearances'] ?? []),
])
->filter(fn ($anchor) => filled($anchor['label']) && ! $anchor['limited']
&& ! in_array($anchor['type'], ['hero', 'booking', 'contact', 'rich_text', 'offers', 'reviews'], true))
->take(6)
->values(),
]);
@endphp
<header class="relative z-20" data-menu>
<div class="mx-auto flex max-w-7xl items-center justify-between gap-6 px-4 py-4 sm:px-8 lg:py-5">
<a href="{{ route('home') }}" class="flex min-w-0 items-center gap-3 sm:shrink-0" aria-label="{{ $theme->site->name }} – Startseite">
@include('theme::partials.logo', ['class' => 'h-12 w-auto shrink-0 lg:h-16', 'sizes' => '(min-width: 1024px) 9.5rem, 7rem'])
<span class="font-display text-[1.375rem] leading-tight font-medium sm:text-[1.75rem] sm:whitespace-nowrap">{{ $theme->site->name }}</span>
</a>
<nav aria-label="Hauptnavigation" class="hidden xl:block">
<ul class="flex gap-4 text-lg whitespace-nowrap 2xl:gap-6">
@foreach ($menuEntries as $entry)
@php($item = $entry['page'])
<li class="flex items-center gap-0.5">
<a href="{{ $item->url() }}" @class(['underline-offset-8 hover:underline', 'underline decoration-accent decoration-2' => url()->current() === $item->url()]) @if (url()->current() === $item->url()) aria-current="page" @endif>{{ $item->label() }}</a>
@if ($entry['anchors']->isNotEmpty())
<button type="button" data-menu-toggle aria-controls="{{ $entry['panel'] }}" aria-expanded="false" aria-label="Übersicht „{{ $item->label() }}“" hidden
class="flex size-9 items-center justify-center rounded-md hover:bg-ink/5 aria-expanded:bg-ink/5 aria-expanded:[&_svg]:rotate-180">
<x-heroicon-m-chevron-down class="size-5 transition" aria-hidden="true" />
</button>
@endif
</li>
@endforeach
</ul>
</nav>
<div class="flex items-center gap-2 sm:gap-4">
<a href="{{ route('booking.create') }}" class="btn-accent hidden whitespace-nowrap sm:inline-flex xl:hidden 2xl:inline-flex">Verfügbarkeit prüfen</a>
<details class="group xl:hidden">
<summary class="flex size-12 cursor-pointer list-none items-center justify-center rounded-md border border-line bg-surface [&::-webkit-details-marker]:hidden" aria-label="Menü">
<x-heroicon-o-bars-3 class="size-6 group-open:hidden" aria-hidden="true" />
<x-heroicon-o-x-mark class="hidden size-6 group-open:block" aria-hidden="true" />
</summary>
<div class="absolute inset-x-0 top-full overflow-hidden bg-band text-band-ink shadow-lg [--brand-navy:var(--band-ink)]">
<ul class="px-5 pt-2">
@foreach ($theme->menu('main') as $item)
<li class="border-b border-band-muted/30 last:border-0"><a href="{{ $item->url() }}" class="block py-3.5 font-display text-[1.75rem]">{{ $item->label() }}</a></li>
@endforeach
</ul>
<div class="flex flex-col gap-3 px-5 py-4">
<a href="{{ route('booking.create') }}" class="inline-flex min-h-12 items-center justify-center rounded-md bg-band-ink px-6 font-semibold text-band">Verfügbarkeit prüfen</a>
@if ($phone)
<a href="tel:{{ preg_replace('/[^0-9+]/', '', $phone) }}" class="inline-flex min-h-12 items-center justify-center gap-2 rounded-md border-2 border-band-ink px-6 font-semibold">
<x-heroicon-o-phone class="size-5" aria-hidden="true" />Anrufen: {{ $phone }}
</a>
@endif
</div>
<div class="bg-ground pt-1" aria-hidden="true">
@include('theme::partials.motif', ['slot' => 'closing', 'class' => 'motif-drift -ml-[45%] block h-auto w-[150%] max-w-none'])
</div>
</div>
</details>
</div>
</div>
@foreach ($menuEntries->filter(fn ($entry) => $entry['anchors']->isNotEmpty()) as $entry)
@php($item = $entry['page'])
<div id="{{ $entry['panel'] }}" data-menu-panel hidden class="absolute inset-x-0 top-full border-y border-line bg-surface shadow-lg shadow-ink/10">
<div class="mx-auto grid max-w-7xl grid-cols-[1.15fr_1fr_0.9fr] items-start gap-12 px-8 pt-10 pb-12">
<div>
<p class="font-display text-[2.25rem] leading-tight">{{ $item->label() }}</p>
@if ($item->seo_description)<p class="mt-3 max-w-[42ch] text-muted">{{ $item->seo_description }}</p>@endif
<a href="{{ $item->url() }}" class="mt-5 inline-block border-b-2 border-accent pb-0.5 font-semibold hover:text-accent">Zur Seite „{{ $item->label() }}“</a>
</div>
<nav aria-label="Auf der Seite „{{ $item->label() }}“">
<p class="eyebrow">Auf dieser Seite</p>
<ul class="divide-y divide-line border-y border-line">
@foreach ($entry['anchors'] as $anchor)
<li><a href="{{ $item->url() }}#{{ $anchor['id'] }}" class="block py-2.5 text-lg hover:text-accent">{{ $anchor['label'] }}</a></li>
@endforeach
</ul>
</nav>
<div class="cartouche mt-6 px-6 pt-12 pb-7 text-center">
<span class="absolute -top-8 left-1/2 -translate-x-1/2 bg-surface px-2" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'crest', 'class' => 'h-12 w-auto'])</span>
<span class="absolute -top-0.5 -left-0.5" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-9'])</span>
<span class="absolute -top-0.5 -right-0.5 -scale-x-100" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-9'])</span>
<p class="font-display text-[1.625rem] leading-tight">Ihr Wunschtermin?</p>
<a href="{{ route('booking.create') }}" class="btn-accent mt-4">Verfügbarkeit prüfen</a>
@if ($phone)
<a href="tel:{{ preg_replace('/[^0-9+]/', '', $phone) }}" class="mt-3 flex items-center justify-center gap-2 font-semibold hover:text-accent"><x-heroicon-o-phone class="size-5" aria-hidden="true" />{{ $phone }}</a>
@endif
</div>
</div>
</div>
@endforeach
</header>