Design Stufe 2: Tipp-Karten zum Umdrehen, Sommer/Winter-Vergleich, Galerie mit weichem Vergroessern
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m45s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m45s
- Baustein "Ausflugstipps" (tips): Karten mit Foto vorne, Tipp/Weg/beste Zeit hinten; Seebad als Ansichtskarten - Baustein "Sommer/Winter-Vergleich" (compare): Trennlinie ziehen, Tastatur ueber Range-Input, einmaliger Hinweis-Schwenk - Lightbox: Foto waechst aus der Vorschau, Blaettern (Pfeile, Tasten, Wischen), Zaehler, Bildunterschrift; partials/lightbox - Bewegung reduzieren: Ueberblenden statt Drehen, kein Schwenk, keine Zoom-Animation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c8bb0f6e97
commit
4c9e6992f4
20 files changed
+785
-43
No files matched your search
@@ -120,6 +120,104 @@ @layer components {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Cards to turn over (sections/tips). Without JavaScript both faces stand one below the other; theme.js sets
|
||||
* data-flip="ready", stacks the faces in one grid cell (the card takes the height of the taller face) and toggles
|
||||
* data-flipped. With "reduce motion" the faces cross-fade instead of turning.
|
||||
*/
|
||||
[data-flip='ready'] {
|
||||
perspective: 1800px;
|
||||
}
|
||||
|
||||
[data-flip='ready'] > [data-flip-inner] {
|
||||
display: grid;
|
||||
height: 100%;
|
||||
transform-style: preserve-3d;
|
||||
transition: transform 0.8s cubic-bezier(0.3, 0.7, 0.2, 1);
|
||||
}
|
||||
|
||||
[data-flip='ready'] [data-flip-face] {
|
||||
grid-area: 1 / 1;
|
||||
backface-visibility: hidden;
|
||||
-webkit-backface-visibility: hidden;
|
||||
}
|
||||
|
||||
[data-flip='ready'] [data-flip-face='back'] {
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
|
||||
[data-flip='ready'][data-flipped] > [data-flip-inner] {
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
[data-flip='ready'] > [data-flip-inner],
|
||||
[data-flip='ready'][data-flipped] > [data-flip-inner],
|
||||
[data-flip='ready'] [data-flip-face='back'] {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
[data-flip='ready'] [data-flip-face] {
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
[data-flip='ready'] [data-flip-face='back'],
|
||||
[data-flip='ready'][data-flipped] [data-flip-face='front'] {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
[data-flip='ready'][data-flipped] [data-flip-face='back'] {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Two photos with a dividing line (sections/compare): --split is the share of the first photo. theme.js moves it by
|
||||
* dragging or tapping; the visually hidden range input does the same by keyboard and screen reader.
|
||||
*/
|
||||
[data-compare] {
|
||||
--split: 50%;
|
||||
position: relative;
|
||||
touch-action: pan-y;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
[data-compare] img {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
[data-compare-first] {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
clip-path: inset(0 calc(100% - var(--split)) 0 0);
|
||||
}
|
||||
|
||||
[data-compare-handle] {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: var(--split);
|
||||
translate: -50% 0;
|
||||
}
|
||||
|
||||
[data-compare]:has(input:focus-visible) [data-compare-handle] {
|
||||
outline: 3px solid var(--accent);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
/* Lightbox (layout dialog#lightbox): the backdrop fades; the photo's way out of the gallery is animated in theme.js. */
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
#lightbox[open]::backdrop {
|
||||
animation: lightbox-fade 0.35s ease-out;
|
||||
}
|
||||
|
||||
@keyframes lightbox-fade {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Gentle reveal while scrolling – only where supported and only without "reduce motion". */
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
@supports (animation-timeline: view()) {
|
||||
|
||||
@@ -2,32 +2,137 @@
|
||||
* Theme "Ostsee-Licht": small progressive enhancements. Everything works without JavaScript.
|
||||
*/
|
||||
|
||||
// Lightbox for galleries: links with data-lightbox open the large image in a <dialog>.
|
||||
document.addEventListener('click', (event) => {
|
||||
const link = event.target.closest('a[data-lightbox]');
|
||||
if (!link) {
|
||||
return;
|
||||
}
|
||||
// Lightbox for galleries: links with data-lightbox open the large image in the layout's dialog#lightbox. The photo
|
||||
// grows out of its thumbnail and shrinks back on closing; the links of one section form a series to browse with the
|
||||
// arrow buttons, the arrow keys or a swipe. Without JavaScript the link simply opens the large image.
|
||||
const lightbox = document.getElementById('lightbox');
|
||||
if (lightbox && typeof lightbox.showModal === 'function') {
|
||||
const image = lightbox.querySelector('img');
|
||||
const caption = lightbox.querySelector('[data-caption]');
|
||||
const counter = lightbox.querySelector('[data-counter]');
|
||||
const browseButtons = lightbox.querySelectorAll('[data-prev], [data-next]');
|
||||
const ease = 'cubic-bezier(0.2, 0.8, 0.2, 1)';
|
||||
let series = [];
|
||||
let index = 0;
|
||||
|
||||
const dialog = document.getElementById('lightbox');
|
||||
if (!dialog || typeof dialog.showModal !== 'function') {
|
||||
return;
|
||||
}
|
||||
const thumbnailOf = (link) => link.querySelector('img');
|
||||
|
||||
event.preventDefault();
|
||||
const image = dialog.querySelector('img');
|
||||
image.src = link.href;
|
||||
image.alt = link.dataset.alt ?? '';
|
||||
dialog.querySelector('[data-caption]').textContent = link.dataset.alt ?? '';
|
||||
dialog.showModal();
|
||||
});
|
||||
// Transform that lays the opened image over the thumbnail: same centre, scaled to cover it, cropped like object-cover.
|
||||
const fromThumbnail = (thumbnail) => {
|
||||
const from = thumbnail.getBoundingClientRect();
|
||||
const to = image.getBoundingClientRect();
|
||||
if (!from.width || !to.width) {
|
||||
return null;
|
||||
}
|
||||
const scale = Math.max(from.width / to.width, from.height / to.height);
|
||||
const insetX = (to.width * scale - from.width) / (2 * scale);
|
||||
const insetY = (to.height * scale - from.height) / (2 * scale);
|
||||
const x = from.left + from.width / 2 - (to.left + to.width / 2);
|
||||
const y = from.top + from.height / 2 - (to.top + to.height / 2);
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const dialog = event.target.closest('dialog#lightbox');
|
||||
if (dialog && (event.target === dialog || event.target.closest('[data-close]'))) {
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
return { transform: `translate(${x}px, ${y}px) scale(${scale})`, clipPath: `inset(${insetY}px ${insetX}px round 4px)` };
|
||||
};
|
||||
|
||||
const visible = (element) => {
|
||||
const rect = element.getBoundingClientRect();
|
||||
return rect.bottom > 0 && rect.top < window.innerHeight && rect.width > 0;
|
||||
};
|
||||
|
||||
const show = (position) => {
|
||||
index = (position + series.length) % series.length;
|
||||
const link = series[index];
|
||||
const thumbnail = thumbnailOf(link);
|
||||
image.src = thumbnail?.currentSrc || link.href;
|
||||
image.alt = link.dataset.alt ?? '';
|
||||
caption.textContent = link.dataset.caption || link.dataset.alt || '';
|
||||
if (counter) {
|
||||
counter.textContent = series.length > 1 ? `${index + 1} von ${series.length}` : '';
|
||||
}
|
||||
if (image.src !== link.href) {
|
||||
const large = new Image();
|
||||
large.onload = () => { if (series[index] === link) image.src = link.href; };
|
||||
large.src = link.href;
|
||||
}
|
||||
};
|
||||
|
||||
const browse = (step) => {
|
||||
if (series.length < 2) {
|
||||
return;
|
||||
}
|
||||
show(index + step);
|
||||
if (!reducedMotion()) {
|
||||
image.animate([{ opacity: 0, transform: `translateX(${step * 2.5}rem)` }, { opacity: 1, transform: 'none' }], { duration: 320, easing: ease });
|
||||
}
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
const thumbnail = thumbnailOf(series[index] ?? lightbox);
|
||||
const start = !reducedMotion() && thumbnail && visible(thumbnail) ? fromThumbnail(thumbnail) : null;
|
||||
if (!start) {
|
||||
lightbox.close();
|
||||
return;
|
||||
}
|
||||
lightbox.querySelectorAll('[data-chrome]').forEach((element) => element.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 150, fill: 'forwards' }));
|
||||
image.animate([{ transform: 'none', clipPath: 'inset(0 0 round 4px)' }, start], { duration: 380, easing: ease, fill: 'forwards' })
|
||||
.finished.then(() => {
|
||||
lightbox.close();
|
||||
lightbox.getAnimations({ subtree: true }).forEach((animation) => animation.cancel());
|
||||
});
|
||||
};
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const link = event.target.closest('a[data-lightbox]');
|
||||
if (!link) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
series = [...(link.closest('section') ?? document).querySelectorAll('a[data-lightbox]')];
|
||||
browseButtons.forEach((button) => { button.hidden = series.length < 2; });
|
||||
show(series.indexOf(link));
|
||||
lightbox.showModal();
|
||||
|
||||
const thumbnail = thumbnailOf(link);
|
||||
const start = !reducedMotion() && thumbnail ? fromThumbnail(thumbnail) : null;
|
||||
if (start) {
|
||||
image.animate([start, { transform: 'none', clipPath: 'inset(0 0 round 4px)' }], { duration: 480, easing: ease });
|
||||
lightbox.querySelectorAll('[data-chrome]').forEach((element) => element.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 250, delay: 300, fill: 'backwards' }));
|
||||
}
|
||||
});
|
||||
|
||||
lightbox.addEventListener('click', (event) => {
|
||||
if (event.target.closest('[data-prev]')) {
|
||||
browse(-1);
|
||||
} else if (event.target.closest('[data-next]')) {
|
||||
browse(1);
|
||||
} else if (event.target === lightbox || event.target.closest('[data-close]')) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
lightbox.addEventListener('cancel', (event) => {
|
||||
event.preventDefault();
|
||||
close();
|
||||
});
|
||||
|
||||
lightbox.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
||||
event.preventDefault();
|
||||
browse(event.key === 'ArrowLeft' ? -1 : 1);
|
||||
}
|
||||
});
|
||||
|
||||
let swipeStart = null;
|
||||
lightbox.addEventListener('pointerdown', (event) => { swipeStart = { x: event.clientX, y: event.clientY }; });
|
||||
lightbox.addEventListener('pointerup', (event) => {
|
||||
const dx = swipeStart ? event.clientX - swipeStart.x : 0;
|
||||
const dy = swipeStart ? event.clientY - swipeStart.y : 0;
|
||||
swipeStart = null;
|
||||
if (Math.abs(dx) > 50 && Math.abs(dx) > Math.abs(dy) * 1.5) {
|
||||
browse(dx < 0 ? 1 : -1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Availability search in the hero: forwards the dates to the booking page.
|
||||
document.addEventListener('submit', (event) => {
|
||||
@@ -171,3 +276,84 @@ if (!reducedMotion() && 'IntersectionObserver' in window) {
|
||||
reveal.observe(element);
|
||||
});
|
||||
}
|
||||
|
||||
// Cards to turn over (sections/tips): [data-flip] card, [data-flip-inner], [data-flip-face="front|back"], buttons
|
||||
// [data-flip-toggle] (hidden without JavaScript). The hidden face is inert, so keyboard and screen reader stay on the
|
||||
// visible one; focus moves to the button of the face that turns up.
|
||||
document.querySelectorAll('[data-flip]').forEach((card) => {
|
||||
const front = card.querySelector('[data-flip-face="front"]');
|
||||
const back = card.querySelector('[data-flip-face="back"]');
|
||||
const turn = (flipped) => {
|
||||
card.toggleAttribute('data-flipped', flipped);
|
||||
front.inert = flipped;
|
||||
back.inert = !flipped;
|
||||
card.querySelectorAll('[data-flip-toggle]').forEach((button) => button.setAttribute('aria-expanded', String(flipped)));
|
||||
(flipped ? back : front).querySelector('[data-flip-toggle]')?.focus({ preventScroll: true });
|
||||
};
|
||||
|
||||
card.dataset.flip = 'ready';
|
||||
back.inert = true;
|
||||
card.querySelectorAll('[data-flip-toggle]').forEach((button) => {
|
||||
button.hidden = false;
|
||||
button.addEventListener('click', () => turn(!card.hasAttribute('data-flipped')));
|
||||
});
|
||||
});
|
||||
|
||||
// Season comparison (sections/compare): dragging or tapping moves the dividing line, the hidden range input
|
||||
// ([data-compare-range]) does the same by keyboard. Once in view, the line sweeps briefly to show it can be moved.
|
||||
document.querySelectorAll('[data-compare]').forEach((box) => {
|
||||
const range = box.querySelector('[data-compare-range]');
|
||||
let touched = false;
|
||||
const set = (percent) => {
|
||||
const value = Math.min(100, Math.max(0, percent));
|
||||
box.style.setProperty('--split', `${value}%`);
|
||||
range.value = String(Math.round(value));
|
||||
};
|
||||
const fromPointer = (event) => {
|
||||
const rect = box.getBoundingClientRect();
|
||||
set(((event.clientX - rect.left) / rect.width) * 100);
|
||||
};
|
||||
|
||||
range.hidden = false;
|
||||
range.addEventListener('input', () => { touched = true; set(Number(range.value)); });
|
||||
box.addEventListener('pointerdown', (event) => {
|
||||
touched = true;
|
||||
box.setPointerCapture(event.pointerId);
|
||||
fromPointer(event);
|
||||
});
|
||||
box.addEventListener('pointermove', (event) => {
|
||||
if (box.hasPointerCapture(event.pointerId)) {
|
||||
fromPointer(event);
|
||||
}
|
||||
});
|
||||
|
||||
if (reducedMotion() || !('IntersectionObserver' in window)) {
|
||||
return;
|
||||
}
|
||||
const hint = new IntersectionObserver(([entry]) => {
|
||||
if (!entry.isIntersecting) {
|
||||
return;
|
||||
}
|
||||
hint.disconnect();
|
||||
const keys = [[0, 50], [0.35, 68], [0.75, 34], [1, 50]];
|
||||
const duration = 2200;
|
||||
let begin = null;
|
||||
const step = (time) => {
|
||||
if (touched) {
|
||||
return;
|
||||
}
|
||||
begin ??= time;
|
||||
const t = Math.min(1, (time - begin) / duration);
|
||||
const k = keys.findIndex(([at]) => at >= t);
|
||||
const [t0, v0] = keys[Math.max(0, k - 1)];
|
||||
const [t1, v1] = keys[k];
|
||||
const local = t1 === t0 ? 1 : (t - t0) / (t1 - t0);
|
||||
set(v0 + (v1 - v0) * (0.5 - Math.cos(Math.PI * local) / 2));
|
||||
if (t < 1) {
|
||||
requestAnimationFrame(step);
|
||||
}
|
||||
};
|
||||
setTimeout(() => requestAnimationFrame(step), 400);
|
||||
}, { threshold: 0.6 });
|
||||
hint.observe(box);
|
||||
});
|
||||
@@ -48,13 +48,7 @@
|
||||
@include('theme::partials.footer')
|
||||
@include('theme::partials.mobile-booking-bar')
|
||||
|
||||
<dialog id="lightbox" class="m-auto max-h-[92vh] max-w-[92vw] bg-transparent p-0 backdrop:bg-black/80" aria-label="Bild vergrößert">
|
||||
<figure class="relative">
|
||||
<img src="" alt="" class="max-h-[85vh] max-w-[92vw] object-contain">
|
||||
<figcaption data-caption class="mt-2 text-center text-sm text-white"></figcaption>
|
||||
<button type="button" data-close class="absolute top-2 right-2 rounded-full bg-black/60 px-3 py-1 text-white" aria-label="Schließen">✕</button>
|
||||
</figure>
|
||||
</dialog>
|
||||
@include('theme::partials.lightbox')
|
||||
|
||||
@livewireScripts
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{{--
|
||||
Lightbox dialog for all a[data-lightbox] links (theme.js): img, [data-caption], [data-counter], [data-prev]/[data-next]
|
||||
(hidden for a single photo), [data-close]. Elements with [data-chrome] fade in after the photo has grown out of its
|
||||
thumbnail. Links may set data-caption (shown below) besides data-alt (alternative text).
|
||||
--}}
|
||||
<dialog id="lightbox" class="m-auto max-h-[94vh] max-w-[94vw] overflow-visible bg-transparent p-0 backdrop:bg-black/85" aria-label="Bild vergrößert">
|
||||
<figure class="relative">
|
||||
<img src="" alt="" class="max-h-[84vh] max-w-[94vw] rounded object-contain">
|
||||
<button type="button" data-prev data-chrome hidden class="absolute top-1/2 left-2 flex size-12 -translate-y-1/2 items-center justify-center rounded-full bg-black/60 text-white hover:bg-black/80" aria-label="Vorheriges Foto">
|
||||
<x-heroicon-o-chevron-left class="size-6" aria-hidden="true" />
|
||||
</button>
|
||||
<button type="button" data-next data-chrome hidden class="absolute top-1/2 right-2 flex size-12 -translate-y-1/2 items-center justify-center rounded-full bg-black/60 text-white hover:bg-black/80" aria-label="Nächstes Foto">
|
||||
<x-heroicon-o-chevron-right class="size-6" aria-hidden="true" />
|
||||
</button>
|
||||
<figcaption data-chrome class="mt-3 flex flex-wrap items-baseline justify-between gap-x-6 gap-y-1 px-1 text-base text-white">
|
||||
<span data-caption></span>
|
||||
<span data-counter class="text-white/70 tabular-nums"></span>
|
||||
</figcaption>
|
||||
<button type="button" data-close data-chrome class="absolute top-2 right-2 flex size-12 items-center justify-center rounded-full bg-black/60 text-white hover:bg-black/80" aria-label="Schließen">
|
||||
<x-heroicon-o-x-mark class="size-6" aria-hidden="true" />
|
||||
</button>
|
||||
</figure>
|
||||
</dialog>
|
||||
@@ -0,0 +1,27 @@
|
||||
{{--
|
||||
Contract: $eyebrow, $heading, $text, $first, $second (Photo|null – renders nothing without both), $firstLabel, $secondLabel.
|
||||
theme.js: [data-compare] box with the second photo underneath, [data-compare-first] (first photo, clipped at --split),
|
||||
[data-compare-handle] (the line) and [data-compare-range] (range input 0–100, hidden without JavaScript).
|
||||
--}}
|
||||
@if ($first && $second)
|
||||
<section class="mx-auto max-w-6xl px-4 py-16 sm:px-8" @if ($heading) aria-labelledby="{{ $sectionId }}-title" @else aria-label="{{ $firstLabel }} und {{ $secondLabel }}" @endif>
|
||||
@if ($eyebrow)<p class="eyebrow">{{ $eyebrow }}</p>@endif
|
||||
@if ($heading)<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>@endif
|
||||
@if ($text)<p class="mt-4 max-w-[60ch] text-muted">{{ $text }}</p>@endif
|
||||
|
||||
<div data-compare class="mt-8 aspect-[3/2] cursor-ew-resize overflow-hidden rounded bg-surface">
|
||||
@include('theme::partials.image', ['photo' => $second, 'sizes' => '(min-width: 1152px) 72rem, 100vw', 'class' => 'absolute inset-0 h-full w-full object-cover'])
|
||||
<div data-compare-first>
|
||||
@include('theme::partials.image', ['photo' => $first, 'sizes' => '(min-width: 1152px) 72rem, 100vw', 'class' => 'h-full w-full object-cover'])
|
||||
</div>
|
||||
<span class="absolute top-4 left-4 rounded-full bg-ink/75 px-4 py-1.5 font-semibold text-ground">{{ $firstLabel }}</span>
|
||||
<span class="absolute top-4 right-4 rounded-full bg-ink/75 px-4 py-1.5 font-semibold text-ground">{{ $secondLabel }}</span>
|
||||
<div data-compare-handle class="w-1 bg-ground" aria-hidden="true">
|
||||
<span class="absolute top-1/2 left-1/2 flex size-12 -translate-1/2 items-center justify-center rounded-full bg-ground text-ink shadow-lg">
|
||||
<x-heroicon-o-arrows-right-left class="size-6" />
|
||||
</span>
|
||||
</div>
|
||||
<input type="range" min="0" max="100" value="50" hidden data-compare-range class="sr-only" aria-label="Trennlinie zwischen {{ $firstLabel }} und {{ $secondLabel }} verschieben">
|
||||
</div>
|
||||
</section>
|
||||
@endif
|
||||
@@ -4,7 +4,7 @@
|
||||
<ul class="grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4">
|
||||
@foreach ($photos as $index => $photo)
|
||||
<li @class(['reveal', 'col-span-2 row-span-2' => $index === 0])>
|
||||
<a href="{{ $photo->url('lg') }}" data-lightbox data-alt="{{ $photo->alt_text }}" class="group block overflow-hidden rounded-sm">
|
||||
<a href="{{ $photo->url('lg') }}" data-lightbox data-alt="{{ $photo->alt_text }}" data-caption="{{ $photo->caption }}" class="group block overflow-hidden rounded-sm">
|
||||
@include('theme::partials.image', [
|
||||
'photo' => $photo,
|
||||
'sizes' => $index === 0 ? '(min-width: 1024px) 50vw, 100vw' : '(min-width: 1024px) 25vw, 50vw',
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
{{--
|
||||
Contract: $eyebrow, $heading, $text, $signature (string|null), $tips (list: title, photo (Photo|null), tip, way, bestTime).
|
||||
theme.js: each card [data-flip] > [data-flip-inner] > [data-flip-face="front"] + [data-flip-face="back"], buttons
|
||||
[data-flip-toggle] with aria-controls of the back (hidden without JavaScript – then both faces are shown).
|
||||
--}}
|
||||
@if ($tips !== [])
|
||||
<section class="mx-auto max-w-7xl px-4 py-16 sm:px-8" @if ($heading) aria-labelledby="{{ $sectionId }}-title" @else aria-label="Ausflugstipps" @endif>
|
||||
@if ($eyebrow)<p class="eyebrow">{{ $eyebrow }}</p>@endif
|
||||
@if ($heading)<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>@endif
|
||||
@if ($text)<p class="mt-4 max-w-[60ch] text-muted">{{ $text }}</p>@endif
|
||||
|
||||
<ul class="mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@foreach ($tips as $tip)
|
||||
@php($backId = $sectionId.'-tip-'.$loop->index)
|
||||
<li data-flip>
|
||||
<div data-flip-inner>
|
||||
<div data-flip-face="front" class="flex flex-col overflow-hidden rounded bg-surface">
|
||||
@include('theme::partials.image', ['photo' => $tip['photo'], 'sizes' => '(min-width: 1024px) 30vw, (min-width: 640px) 45vw, 100vw', 'class' => 'aspect-[4/3] w-full object-cover'])
|
||||
<div class="flex flex-1 items-center justify-between gap-4 p-5">
|
||||
<h3 class="font-display text-2xl leading-tight">{{ $tip['title'] }}</h3>
|
||||
<button type="button" hidden data-flip-toggle aria-expanded="false" aria-controls="{{ $backId }}" class="btn-primary shrink-0">Tipp lesen</button>
|
||||
</div>
|
||||
</div>
|
||||
<div data-flip-face="back" id="{{ $backId }}" class="flex flex-col gap-4 rounded border border-line bg-surface p-6">
|
||||
<p class="font-display text-2xl leading-tight">{{ $tip['title'] }}</p>
|
||||
<p class="text-lg leading-relaxed">{{ $tip['tip'] }}</p>
|
||||
@if ($signature)<p class="font-display text-xl text-accent italic">{{ $signature }}</p>@endif
|
||||
@if ($tip['way'] || $tip['bestTime'])
|
||||
<dl class="mt-auto grid gap-2 border-t border-line pt-4 text-muted">
|
||||
@if ($tip['way'])<div class="flex gap-3"><dt><x-heroicon-o-map class="size-5" aria-hidden="true" /><span class="sr-only">Weg</span></dt><dd>{{ $tip['way'] }}</dd></div>@endif
|
||||
@if ($tip['bestTime'])<div class="flex gap-3"><dt><x-heroicon-o-clock class="size-5" aria-hidden="true" /><span class="sr-only">Beste Zeit</span></dt><dd>{{ $tip['bestTime'] }}</dd></div>@endif
|
||||
</dl>
|
||||
@endif
|
||||
<button type="button" hidden data-flip-toggle aria-expanded="false" aria-controls="{{ $backId }}" class="self-start font-semibold text-accent underline underline-offset-4">Zurück zum Foto</button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</section>
|
||||
@endif
|
||||
@@ -132,6 +132,33 @@ @layer components {
|
||||
@apply font-semibold text-accent;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ansichtskarte (Ausflugstipps): weißer Bildrand, feiner Schatten, leicht gegeneinander verdreht wie auf dem
|
||||
* Tisch ausgelegt; gerade, sobald man sie anfasst oder umdreht. Rückseite mit Briefmarke (gezähnter Rand).
|
||||
*/
|
||||
.postcard {
|
||||
@apply h-full bg-surface shadow-[0_1px_2px_rgb(19_41_75/0.12),0_12px_28px_-14px_rgb(19_41_75/0.4)];
|
||||
}
|
||||
|
||||
.postcard-tilt {
|
||||
@apply transition-[rotate] duration-500 sm:odd:-rotate-[0.8deg] sm:even:rotate-[0.6deg] sm:hover:rotate-0;
|
||||
}
|
||||
|
||||
.postcard-tilt[data-flipped] {
|
||||
@apply rotate-0;
|
||||
}
|
||||
|
||||
.stamp {
|
||||
@apply block size-[4.5rem] shrink-0 bg-ground p-2.5 text-ink;
|
||||
mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 0.2rem, #0000 95%, #000) -0.3rem -0.3rem / 0.6rem 0.6rem round;
|
||||
box-shadow: inset 0 0 0 0.375rem var(--surface), inset 0 0 0 0.5rem var(--brand-reed);
|
||||
}
|
||||
|
||||
/* Sommer/Winter-Vergleich: Knauf auf der Trennlinie. */
|
||||
.compare-knob {
|
||||
@apply absolute top-1/2 left-1/2 flex size-14 -translate-1/2 items-center justify-center rounded-full border-2 border-ink bg-surface text-ink shadow-lg;
|
||||
}
|
||||
|
||||
/* Kartusche: Doppelrahmen, Rundbogengaube als Kopf, Kopfbänder der Terrassen als Eckkonsolen. */
|
||||
.cartouche {
|
||||
@apply relative border-2 border-ink bg-surface outline outline-1 -outline-offset-[10px] outline-[var(--brand-reed)];
|
||||
|
||||
@@ -48,13 +48,7 @@
|
||||
@include('theme::partials.footer')
|
||||
@include('theme::partials.mobile-booking-bar')
|
||||
|
||||
<dialog id="lightbox" class="m-auto max-h-[92vh] max-w-[92vw] bg-transparent p-0 backdrop:bg-black/80" aria-label="Bild vergrößert">
|
||||
<figure class="relative">
|
||||
<img src="" alt="" class="max-h-[85vh] max-w-[92vw] object-contain">
|
||||
<figcaption data-caption class="mt-2 text-center text-base text-white"></figcaption>
|
||||
<button type="button" data-close class="absolute top-2 right-2 min-h-11 min-w-11 rounded-full bg-black/60 px-3 text-white" aria-label="Schließen">✕</button>
|
||||
</figure>
|
||||
</dialog>
|
||||
@include('theme::partials.lightbox')
|
||||
|
||||
@livewireScripts
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{{--
|
||||
Contract: see ostsee-licht/views/sections/compare.blade.php. Seebad: heading and text above, the photos in the
|
||||
double frame of the house (as the tour), the labels below the frame at both ends, so they never cover the view.
|
||||
--}}
|
||||
@if ($first && $second)
|
||||
<section class="mx-auto max-w-6xl px-4 py-14 sm:px-8 sm:py-20" @if ($heading) aria-labelledby="{{ $sectionId }}-title" @else aria-label="{{ $firstLabel }} und {{ $secondLabel }}" @endif>
|
||||
<div class="flex flex-wrap items-end gap-x-14 gap-y-4">
|
||||
<div class="min-w-0 flex-[1_1_24rem]">
|
||||
@if ($eyebrow)<p class="eyebrow">{{ $eyebrow }}</p>@endif
|
||||
@if ($heading)<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>@endif
|
||||
</div>
|
||||
@if ($text)<p class="min-w-0 max-w-[52ch] flex-[1_1_22rem] text-muted">{{ $text }}</p>@endif
|
||||
</div>
|
||||
|
||||
<figure class="mt-10">
|
||||
<div class="relative border-2 border-ink bg-surface p-2.5 sm:p-3.5">
|
||||
<span class="absolute -top-0.5 -left-0.5 z-10" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-10'])</span>
|
||||
<span class="absolute -top-0.5 -right-0.5 z-10 -scale-x-100" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-10'])</span>
|
||||
<div data-compare class="aspect-[4/3] cursor-ew-resize overflow-hidden bg-ink sm:aspect-[3/2]">
|
||||
@include('theme::partials.image', ['photo' => $second, 'sizes' => '(min-width: 1152px) 70rem, 100vw', 'class' => 'absolute inset-0 h-full w-full object-cover'])
|
||||
<div data-compare-first>
|
||||
@include('theme::partials.image', ['photo' => $first, 'sizes' => '(min-width: 1152px) 70rem, 100vw', 'class' => 'h-full w-full object-cover'])
|
||||
</div>
|
||||
<div data-compare-handle class="w-[3px] bg-surface shadow-[0_0_0_1px_rgb(19_41_75/0.35)]" aria-hidden="true">
|
||||
<span class="compare-knob"><x-heroicon-o-chevron-left class="size-5" /><x-heroicon-o-chevron-right class="-ml-1 size-5" /></span>
|
||||
</div>
|
||||
<input type="range" min="0" max="100" value="50" hidden data-compare-range class="sr-only" aria-label="Trennlinie zwischen {{ $firstLabel }} und {{ $secondLabel }} verschieben">
|
||||
</div>
|
||||
</div>
|
||||
<figcaption class="mt-3 flex items-baseline justify-between gap-6 font-display text-[1.5rem] leading-tight">
|
||||
<span class="flex items-center gap-2"><x-heroicon-o-arrow-long-left class="size-6 text-accent" aria-hidden="true" />{{ $firstLabel }}</span>
|
||||
<span class="hidden text-base text-muted sm:inline" aria-hidden="true">Linie ziehen zum Vergleichen</span>
|
||||
<span class="flex items-center gap-2">{{ $secondLabel }}<x-heroicon-o-arrow-long-right class="size-6 text-accent" aria-hidden="true" /></span>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</section>
|
||||
@endif
|
||||
@@ -7,7 +7,7 @@
|
||||
<ul class="grid auto-rows-[9.5rem] grid-cols-2 gap-3 sm:auto-rows-[12rem] sm:gap-4 lg:grid-cols-4">
|
||||
@foreach ($photos as $index => $photo)
|
||||
<li @class(['reveal', 'col-span-2 row-span-2' => $index === 0, 'lg:row-span-2' => $index === 5])>
|
||||
<a href="{{ $photo->url('lg') }}" data-lightbox data-alt="{{ $photo->alt_text }}" class="group relative block h-full overflow-hidden rounded">
|
||||
<a href="{{ $photo->url('lg') }}" data-lightbox data-alt="{{ $photo->alt_text }}" data-caption="{{ $photo->caption }}" class="group relative block h-full overflow-hidden rounded">
|
||||
@include('theme::partials.image', [
|
||||
'photo' => $photo,
|
||||
'sizes' => $index === 0 ? '(min-width: 1024px) 50vw, 100vw' : '(min-width: 1024px) 25vw, 50vw',
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
{{--
|
||||
Contract: see ostsee-licht/views/sections/tips.blade.php. Seebad: every tip is a picture postcard of the seaside
|
||||
resort – in front the photo with its white margin and the name, on the back the host's handwritten-looking
|
||||
tip on the left, stamp and "address lines" (way there, best time) on the right of the dividing line.
|
||||
--}}
|
||||
@if ($tips !== [])
|
||||
<section class="mx-auto max-w-7xl px-4 py-16 sm:px-8 sm:py-20" @if ($heading) aria-labelledby="{{ $sectionId }}-title" @else aria-label="Ausflugstipps" @endif>
|
||||
<div class="flex flex-wrap items-end gap-x-14 gap-y-4">
|
||||
<div class="min-w-0 flex-[1_1_26rem]">
|
||||
@if ($eyebrow)<p class="eyebrow">{{ $eyebrow }}</p>@endif
|
||||
@if ($heading)<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>@endif
|
||||
</div>
|
||||
@if ($text)<p class="min-w-0 max-w-[52ch] flex-[1_1_22rem] text-muted">{{ $text }}</p>@endif
|
||||
</div>
|
||||
|
||||
<ul class="mt-10 grid gap-x-8 gap-y-10 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@foreach ($tips as $tip)
|
||||
@php($backId = $sectionId.'-tip-'.$loop->index)
|
||||
<li data-flip class="postcard-tilt">
|
||||
<div data-flip-inner>
|
||||
<div data-flip-face="front" class="postcard flex flex-col p-3">
|
||||
@include('theme::partials.image', ['photo' => $tip['photo'], 'sizes' => '(min-width: 1024px) 30vw, (min-width: 640px) 45vw, 100vw', 'class' => 'aspect-[3/2] w-full object-cover'])
|
||||
<div class="flex flex-1 flex-wrap items-center justify-between gap-x-4 gap-y-3 px-1 pt-4 pb-1">
|
||||
<h3 class="font-display text-[1.75rem] leading-tight">{{ $tip['title'] }}</h3>
|
||||
<button type="button" hidden data-flip-toggle aria-expanded="false" aria-controls="{{ $backId }}" class="btn-outline min-h-11 shrink-0 px-4 py-2">
|
||||
<x-heroicon-o-arrow-path-rounded-square class="mr-2 size-5" aria-hidden="true" />Tipp lesen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-flip-face="back" id="{{ $backId }}" class="postcard grid grid-cols-[minmax(0,3fr)_minmax(0,2fr)] gap-x-5 p-5 sm:p-6">
|
||||
<div class="flex min-w-0 flex-col gap-3 border-r border-line pr-5">
|
||||
<p class="font-display text-[1.375rem] leading-snug italic">{{ $tip['tip'] }}</p>
|
||||
@if ($signature)<p class="mt-auto font-display text-[1.375rem] text-accent italic">{{ $signature }}</p>@endif
|
||||
</div>
|
||||
<div class="flex min-w-0 flex-col">
|
||||
<span class="stamp ml-auto" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'crest', 'class' => 'size-full'])</span>
|
||||
<p class="mt-4 font-display text-xl leading-tight break-words hyphens-auto">{{ $tip['title'] }}</p>
|
||||
<dl class="mt-2 text-base">
|
||||
@if ($tip['way'])
|
||||
<div class="border-b border-line py-1.5"><dt class="text-sm text-muted">Weg</dt><dd>{{ $tip['way'] }}</dd></div>
|
||||
@endif
|
||||
@if ($tip['bestTime'])
|
||||
<div class="border-b border-line py-1.5"><dt class="text-sm text-muted">Beste Zeit</dt><dd>{{ $tip['bestTime'] }}</dd></div>
|
||||
@endif
|
||||
</dl>
|
||||
<button type="button" hidden data-flip-toggle aria-expanded="false" aria-controls="{{ $backId }}" class="mt-auto inline-flex min-h-11 items-center gap-2 self-start pt-4 font-semibold text-accent hover:underline">
|
||||
<x-heroicon-o-arrow-uturn-left class="size-5" aria-hidden="true" />Zum Foto
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</section>
|
||||
@endif
|
||||
Reference in new issue
Block a user