- Sites (Domain, Theme, Farben; mehrfähig für weitere Vermieter), Seiten aus Bausteinen mit Menüs, Erscheinungsbilder mit jährlichem Zeitplan, Priorität und signierter Vorschau - Theme-Kern (app/Themes): Manifest, Registry, Vererbung (Child-Themes), Token-Farben als CSS-Variablen, Bausteinkatalog als Registry (config/themes.php) - 15 Bausteine: Titelbereich mit Suche, Eckdaten, Text mit Bildern, Galerie, Ausstattung, Lage, Preise, Angebote, Kalender & Anfrage, Bewertungen, Gastgeber, FAQ, Abschluss, Kontakt, Fließtext - Theme Ostsee-Licht: Layout, Kopf/Fuß, Banner, mobile Buchungsleiste, Lightbox, selbst gehostete Schriften, Reduced Motion - Seiten Start, Wohnung, Kühlungsborn, Preise & Buchung, Kontakt, Impressum, Datenschutz; Sitemap, robots.txt, JSON-LD - Admin: Seiten-Baukasten, Erscheinungsbilder, Websites - Dokumentation docs/THEMES.md inkl. Übergabe für die Design-Sitzung Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.4 KiB
JavaScript
46 lines
1.4 KiB
JavaScript
/**
|
|
* 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;
|
|
}
|
|
|
|
const dialog = document.getElementById('lightbox');
|
|
if (!dialog || typeof dialog.showModal !== 'function') {
|
|
return;
|
|
}
|
|
|
|
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();
|
|
});
|
|
|
|
document.addEventListener('click', (event) => {
|
|
const dialog = event.target.closest('dialog#lightbox');
|
|
if (dialog && (event.target === dialog || event.target.closest('[data-close]'))) {
|
|
dialog.close();
|
|
}
|
|
});
|
|
|
|
// Availability search in the hero: forwards the dates to the booking page.
|
|
document.addEventListener('submit', (event) => {
|
|
const form = event.target.closest('form[data-availability-search]');
|
|
if (!form) {
|
|
return;
|
|
}
|
|
|
|
const arrival = form.querySelector('[name=anreise]').value;
|
|
const departure = form.querySelector('[name=abreise]').value;
|
|
if (!arrival || !departure) {
|
|
event.preventDefault();
|
|
form.querySelector('[name=anreise]').focus();
|
|
}
|
|
});
|