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>
This commit is contained in:
1 parent
d9e52c4789
commit
d2f53ceb84
7 files changed
+178
-15
No files matched your search
@@ -1,5 +1,23 @@
|
||||
@php($phone = (string) config('fewo.owner.phone'))
|
||||
<header class="relative z-20">
|
||||
@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'])
|
||||
@@ -7,20 +25,24 @@
|
||||
</a>
|
||||
|
||||
<nav aria-label="Hauptnavigation" class="hidden xl:block">
|
||||
<ul class="flex gap-6 text-lg whitespace-nowrap xl:gap-7">
|
||||
@foreach ($theme->menu('main') as $item)
|
||||
<li><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></li>
|
||||
<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">
|
||||
@if ($phone)
|
||||
<a href="tel:{{ preg_replace('/[^0-9+]/', '', $phone) }}" class="hidden items-center gap-2 font-semibold whitespace-nowrap hover:text-accent 2xl:flex">
|
||||
<x-heroicon-o-phone class="size-5" aria-hidden="true" />{{ $phone }}
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route('booking.create') }}" class="btn-accent hidden whitespace-nowrap sm:inline-flex">Verfügbarkeit prüfen</a>
|
||||
<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ü">
|
||||
@@ -48,4 +70,35 @@
|
||||
</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>
|
||||
@@ -9,8 +9,8 @@
|
||||
<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>
|
||||
@if ($rotating)
|
||||
<div class="flex gap-2">
|
||||
<button type="button" data-rotator-prev class="flex size-12 items-center justify-center rounded-md border-2 border-ink hover:bg-ink/5" aria-label="Vorheriges Angebot"><x-heroicon-o-chevron-left class="size-5" aria-hidden="true" /></button>
|
||||
<button type="button" data-rotator-next class="flex size-12 items-center justify-center rounded-md border-2 border-ink hover:bg-ink/5" aria-label="Nächstes Angebot"><x-heroicon-o-chevron-right class="size-5" aria-hidden="true" /></button>
|
||||
<button type="button" data-rotator-prev class="flex size-12 items-center justify-center rounded-md border-2 border-ink hover:bg-ink/5" aria-label="Vorheriges Angebot"><x-heroicon-m-chevron-left class="size-5" aria-hidden="true" /></button>
|
||||
<button type="button" data-rotator-next class="flex size-12 items-center justify-center rounded-md border-2 border-ink hover:bg-ink/5" aria-label="Nächstes Angebot"><x-heroicon-m-chevron-right class="size-5" aria-hidden="true" /></button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user