Offers by their own rules, seasonal photos per section, theme authoring tooling

- Special offers: kinds (rule, fixed dates, gap filler), package price, priority, highlight;
  GapFinder detects calendar gaps (optionally waiving the minimum stay); OfferShowcase decides
  what the website advertises and prices fixed dates/gaps with PriceCalculator; offers section
  shows them side by side, as a list or rotating; hero can show the top offer. Appearances no
  longer carry a featured offer.
- Sections get stable ids; appearances set photos per section ("Bilder je Baustein") and
  sections can be limited to appearances. Photo pickers show thumbnails everywhere.
- Themes: themes:make (scaffold, never overwrites), themes:check (contract, build, markup,
  colours, external resources, WCAG contrast), themes:preview (signed links per page and
  appearance), signed ?theme= preview and preview action in the site form, inherited colour
  tokens in the admin. Base CSS split into theme.css + reusable theme-base.css.
- docs/THEME-ERSTELLUNG.md: binding guide for building additional themes elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lars StommerandClaude Opus 5.5 committed 2026-10-22 18:51:38 +02:00
1 parent bc77b64ea7
commit 7d0bc93abc
50 files changed
+2805 -259

No files matched your search

@@ -0,0 +1,143 @@
/* Reusable styles of "Ostsee-Licht" (fonts, token mapping, base classes) – imported by theme.css and by child themes. */
/* Self-hosted fonts (no request to Google – GDPR). */
@import '@fontsource/cormorant-garamond/500.css';
@import '@fontsource/cormorant-garamond/500-italic.css';
@import '@fontsource/cormorant-garamond/600.css';
@import '@fontsource/figtree/400.css';
@import '@fontsource/figtree/500.css';
@import '@fontsource/figtree/600.css';
/*
* Colour tokens come from theme.json and can be changed per site and per appearance; the layout prints them
* as CSS variables. Tailwind classes such as bg-accent or text-muted refer to these variables.
*/
@theme inline {
--color-ground: var(--ground);
--color-surface: var(--surface);
--color-ink: var(--ink);
--color-muted: var(--muted);
--color-line: var(--line);
--color-accent: var(--accent);
--color-accent-ink: var(--accent-ink);
--color-band: var(--band);
--color-band-ink: var(--band-ink);
--color-band-muted: var(--band-muted);
--color-banner: var(--banner);
--color-banner-ink: var(--banner-ink);
--font-display: 'Cormorant Garamond', Georgia, serif;
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif;
}
@layer base {
html {
scroll-behavior: smooth;
}
body {
background: var(--ground);
color: var(--ink);
transition: background-color 0.4s, color 0.4s;
}
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
border-width: 1px;
border-color: var(--line);
padding: 0.6rem 0.8rem;
background-color: var(--surface);
color: var(--ink);
}
input[type='checkbox'] {
width: 1rem;
height: 1rem;
accent-color: var(--accent);
}
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
}
@layer components {
.eyebrow {
@apply mb-3 text-xs font-semibold tracking-[0.24em] text-accent uppercase;
}
.heading-display {
@apply font-display text-4xl leading-[1.08] font-medium sm:text-[2.875rem];
}
.btn-primary {
@apply inline-flex min-h-11 items-center justify-center rounded-full bg-ink px-6 py-3 text-[15px] font-semibold text-ground transition hover:opacity-90;
}
.btn-accent {
@apply inline-flex min-h-11 items-center justify-center rounded-full bg-accent px-6 py-3 text-[15px] font-semibold text-accent-ink transition hover:opacity-90;
}
.prose-theme {
@apply text-muted;
}
.prose-theme p {
@apply mb-4;
}
.prose-theme ul,
.prose-theme ol {
@apply mb-4 ml-5 list-outside;
}
.prose-theme ul {
@apply list-disc;
}
.prose-theme ol {
@apply list-decimal;
}
.prose-theme a {
@apply text-accent underline;
}
.prose-theme h2,
.prose-theme h3 {
@apply mt-6 mb-2 font-display text-2xl text-ink;
}
}
/* Gentle reveal while scrolling – only where supported and only without "reduce motion". */
@media (prefers-reduced-motion: no-preference) {
@supports (animation-timeline: view()) {
.reveal {
animation: reveal linear both;
animation-timeline: view();
animation-range: entry 0% entry 35%;
}
@keyframes reveal {
from {
opacity: 0;
transform: translateY(24px);
}
}
}
}
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
*,
*::before,
*::after {
transition-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
}
}
+5 -142
View File
@@ -1,146 +1,9 @@
/*
* Entry point of the theme "Ostsee-Licht": Tailwind, the reusable theme styles and the template sources.
* Child themes import theme-base.css (not this file) and list their own sources – see docs/THEME-ERSTELLUNG.md.
*/
@import 'tailwindcss';
/* Self-hosted fonts (no request to Google – GDPR). */
@import '@fontsource/cormorant-garamond/500.css';
@import '@fontsource/cormorant-garamond/500-italic.css';
@import '@fontsource/cormorant-garamond/600.css';
@import '@fontsource/figtree/400.css';
@import '@fontsource/figtree/500.css';
@import '@fontsource/figtree/600.css';
@import './theme-base.css';
@source './views';
@source '../../views/livewire';
/*
* Colour tokens come from theme.json and can be changed per site and per appearance; the layout prints them
* as CSS variables. Tailwind classes such as bg-accent or text-muted refer to these variables.
*/
@theme inline {
--color-ground: var(--ground);
--color-surface: var(--surface);
--color-ink: var(--ink);
--color-muted: var(--muted);
--color-line: var(--line);
--color-accent: var(--accent);
--color-accent-ink: var(--accent-ink);
--color-band: var(--band);
--color-band-ink: var(--band-ink);
--color-band-muted: var(--band-muted);
--color-banner: var(--banner);
--color-banner-ink: var(--banner-ink);
--font-display: 'Cormorant Garamond', Georgia, serif;
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif;
}
@layer base {
html {
scroll-behavior: smooth;
}
body {
background: var(--ground);
color: var(--ink);
transition: background-color 0.4s, color 0.4s;
}
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
border-width: 1px;
border-color: var(--line);
padding: 0.6rem 0.8rem;
background-color: var(--surface);
color: var(--ink);
}
input[type='checkbox'] {
width: 1rem;
height: 1rem;
accent-color: var(--accent);
}
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
}
@layer components {
.eyebrow {
@apply mb-3 text-xs font-semibold tracking-[0.24em] text-accent uppercase;
}
.heading-display {
@apply font-display text-4xl leading-[1.08] font-medium sm:text-[2.875rem];
}
.btn-primary {
@apply inline-flex min-h-11 items-center justify-center rounded-full bg-ink px-6 py-3 text-[15px] font-semibold text-ground transition hover:opacity-90;
}
.btn-accent {
@apply inline-flex min-h-11 items-center justify-center rounded-full bg-accent px-6 py-3 text-[15px] font-semibold text-accent-ink transition hover:opacity-90;
}
.prose-theme {
@apply text-muted;
}
.prose-theme p {
@apply mb-4;
}
.prose-theme ul,
.prose-theme ol {
@apply mb-4 ml-5 list-outside;
}
.prose-theme ul {
@apply list-disc;
}
.prose-theme ol {
@apply list-decimal;
}
.prose-theme a {
@apply text-accent underline;
}
.prose-theme h2,
.prose-theme h3 {
@apply mt-6 mb-2 font-display text-2xl text-ink;
}
}
/* Gentle reveal while scrolling – only where supported and only without "reduce motion". */
@media (prefers-reduced-motion: no-preference) {
@supports (animation-timeline: view()) {
.reveal {
animation: reveal linear both;
animation-timeline: view();
animation-range: entry 0% entry 35%;
}
@keyframes reveal {
from {
opacity: 0;
transform: translateY(24px);
}
}
}
}
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
*,
*::before,
*::after {
transition-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
}
}
+25
View File
@@ -43,3 +43,28 @@ document.addEventListener('submit', (event) => {
form.querySelector('[name=anreise]').focus();
}
});
// Rotating offers: one slide at a time, advancing every 7 s; pauses on hover/focus and
// does not advance by itself when the visitor prefers reduced motion.
document.querySelectorAll('[data-rotator]').forEach((rotator) => {
const slides = [...rotator.querySelectorAll('[data-rotator-slide]')];
const dots = [...rotator.querySelectorAll('[data-rotator-dot]')];
let current = 0;
let paused = false;
const show = (index) => {
current = (index + slides.length) % slides.length;
slides.forEach((slide, i) => { slide.hidden = i !== current; });
dots.forEach((dot, i) => dot.setAttribute('aria-selected', i === current ? 'true' : 'false'));
};
rotator.querySelector('[data-rotator-prev]')?.addEventListener('click', () => show(current - 1));
rotator.querySelector('[data-rotator-next]')?.addEventListener('click', () => show(current + 1));
dots.forEach((dot, i) => dot.addEventListener('click', () => show(i)));
['mouseenter', 'focusin'].forEach((type) => rotator.addEventListener(type, () => { paused = true; }));
['mouseleave', 'focusout'].forEach((type) => rotator.addEventListener(type, () => { paused = false; }));
if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
setInterval(() => { if (!paused && !document.hidden) show(current + 1); }, 7000);
}
});
@@ -32,7 +32,7 @@
<a href="#inhalt" class="sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50 focus:rounded focus:bg-surface focus:px-4 focus:py-2">Zum Inhalt springen</a>
@if ($theme->isPreview)
<div class="bg-ink py-2 text-center text-sm text-ground">Vorschau des Erscheinungsbilds „{{ $theme->appearance?->name }}“</div>
<div class="bg-ink py-2 text-center text-sm text-ground">Vorschau · Theme „{{ $theme->manifest()->name }}“ · Erscheinungsbild „{{ $theme->appearance?->name ?? 'Standard' }}“</div>
@endif
@include('theme::partials.banner')
@@ -5,6 +5,17 @@
@if ($eyebrow)<p class="eyebrow">{{ $eyebrow }}</p>@endif
<h1 id="{{ $sectionId }}-title" class="font-display text-[2.5rem] leading-[1.02] font-medium sm:text-[3.5rem]">{!! preg_replace('/\*(.+?)\*/u', '<em>$1</em>', e($title)) !!}</h1>
@if ($text)<p class="mt-4 text-muted">{{ $text }}</p>@endif
@if ($featuredOffer ?? null)
<a href="{{ $featuredOffer->bookingUrl() }}" class="mt-5 flex items-center gap-3 rounded border border-accent p-3 hover:bg-surface">
<span class="rounded bg-accent px-2 py-1 text-sm font-semibold whitespace-nowrap text-accent-ink">{{ $featuredOffer->advantage }}</span>
<span class="text-sm">
<strong>{{ $featuredOffer->title }}</strong>
@if ($featuredOffer->arrival)
· {{ $featuredOffer->arrival->format('d.m.') }}–{{ $featuredOffer->departure->format('d.m.') }}
@endif
</span>
</a>
@endif
</div>
</div>
</section>
@@ -1,17 +1,74 @@
{{-- Contract: $heading, $display (grid|list|rotating), $offers (Collection of App\Pricing\AdvertisedOffer) --}}
@if ($offers->isNotEmpty())
<section class="mx-auto max-w-7xl px-4 py-16 sm:px-8" aria-labelledby="{{ $sectionId }}-title">
<h2 id="{{ $sectionId }}-title" class="heading-display mb-8">{{ $heading }}</h2>
<ul class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
@foreach ($offers as $offer)
<li @class(['reveal rounded bg-surface p-7', 'ring-2 ring-accent' => $offer->id === $featuredId])>
<p class="font-display text-2xl">{{ $offer->name }}</p>
@if ($offer->public_description)<p class="mt-2 text-muted">{{ $offer->public_description }}</p>@endif
@if ($offer->stay_from || $offer->stay_until)
<p class="mt-3 text-sm text-muted">Reisezeitraum {{ $offer->stay_from?->format('d.m.Y') ?? 'ab sofort' }} – {{ $offer->stay_until?->format('d.m.Y') ?? 'offen' }}</p>
@endif
@php($layout = $display === 'rotating' && $offers->count() === 1 ? 'grid' : $display)
@php($rotating = $layout === 'rotating')
<section class="mx-auto max-w-7xl px-4 py-16 sm:px-8" aria-labelledby="{{ $sectionId }}-title"
@if ($rotating) data-rotator aria-roledescription="Karussell" @endif>
<div class="mb-8 flex items-end justify-between gap-4">
<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>
@if ($rotating)
<div class="flex gap-2">
<button type="button" data-rotator-prev class="rounded border border-line px-3 py-1.5 hover:bg-surface" aria-label="Vorheriges Angebot">←</button>
<button type="button" data-rotator-next class="rounded border border-line px-3 py-1.5 hover:bg-surface" aria-label="Nächstes Angebot">→</button>
</div>
@endif
</div>
<ul @class([
'grid gap-4 sm:grid-cols-2 lg:grid-cols-3' => $layout === 'grid',
'grid gap-4' => $layout === 'list',
'relative' => $rotating,
]) @if ($rotating) data-rotator-track aria-live="polite" @endif>
@foreach ($offers as $advertised)
<li data-offer="{{ $advertised->key() }}" @class([
'reveal flex flex-col rounded bg-surface p-7',
'ring-2 ring-accent' => $advertised->offer->is_featured,
'sm:flex-row sm:items-center sm:gap-8' => $layout === 'list',
]) @if ($rotating) data-rotator-slide @if (! $loop->first) hidden @endif aria-label="Angebot {{ $loop->iteration }} von {{ $offers->count() }}" @endif>
<div class="flex-1">
<p class="inline-block rounded bg-accent px-2.5 py-1 text-sm font-semibold text-accent-ink">{{ $advertised->advantage }}</p>
<p class="mt-3 font-display text-2xl">{{ $advertised->title }}</p>
@if ($advertised->arrival)
<p class="mt-1 font-semibold">
{{ $advertised->arrival->locale('de')->isoFormat('dd DD.MM.') }} – {{ $advertised->departure->locale('de')->isoFormat('dd DD.MM.YYYY') }}
· {{ $advertised->nights() }} {{ $advertised->nights() === 1 ? 'Nacht' : 'Nächte' }}
</p>
@endif
@if ($advertised->description)<p class="mt-2 text-muted">{{ $advertised->description }}</p>@endif
@if ($advertised->conditions)
<ul class="mt-3 flex flex-wrap gap-2 text-sm text-muted">
@foreach ($advertised->conditions as $condition)
<li class="rounded border border-line px-2 py-0.5">{{ $condition }}</li>
@endforeach
</ul>
@endif
</div>
<div @class(['mt-5', 'sm:mt-0 sm:text-right' => $layout === 'list'])>
@if ($advertised->quote)
<p class="text-lg">
<strong>{{ \App\Support\Money::format($advertised->quote->total()) }}</strong>
@if ($advertised->regularTotal() > $advertised->quote->total())
<span class="text-muted">statt <s>{{ \App\Support\Money::format($advertised->regularTotal()) }}</s></span>
@endif
</p>
<p class="text-sm text-muted">für {{ $advertised->quote->guests }} {{ $advertised->quote->guests === 1 ? 'Person' : 'Personen' }} inkl. Endreinigung</p>
@endif
<a href="{{ $advertised->bookingUrl() }}" class="mt-3 inline-block rounded bg-accent px-5 py-2.5 font-semibold text-accent-ink hover:opacity-90">
{{ $advertised->arrival ? 'Diesen Termin anfragen' : 'Preis berechnen' }}
</a>
</div>
</li>
@endforeach
</ul>
<p class="mt-4 text-sm text-muted">Angebote werden bei der Preisberechnung automatisch berücksichtigt.</p>
@if ($rotating)
<div class="mt-4 flex justify-center gap-2" role="tablist" aria-label="Angebote">
@foreach ($offers as $advertised)
<button type="button" data-rotator-dot="{{ $loop->index }}" role="tab" aria-label="Angebot {{ $loop->iteration }}"
aria-selected="{{ $loop->first ? 'true' : 'false' }}" class="size-2.5 rounded-full bg-line aria-selected:bg-accent"></button>
@endforeach
</div>
@endif
<p class="mt-4 text-sm text-muted">Angebote werden bei der Preisberechnung automatisch berücksichtigt – Sie erhalten immer das für Sie günstigste.</p>
</section>
@endif