Rework homepage for recruiting, add Impressum page

- Hero call to action for the casting (Anmeldeschluss 31.1.2027), CMS-editable
- Reorder sections (Mitwirken second, Organisationskomitee as own section)
  and build the nav from visible sections; hide empty Stück/Galerie/Tickets
- Termine as one continuous "way" timeline with next-milestone highlight
- Compact supporter tiles and committee grid, fixed contact box
- Typography: script font only for section titles, 18px body text
- Self-host Kaushan Script (no Google Fonts), Open Graph/canonical meta
- Footer with contacts and supporters
- /impressum page driven by new optional Studio fields; only served once
  publisher and email are filled in (hosting defaults to Infomaniak)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
JohannesandClaude Opus 5.5 committed 2026-11-26 09:28:22 +01:00
1 parent c237dea65f
commit 50a68841ce
18 files changed
+860 -162

No files matched your search

+1
View File
@@ -12,6 +12,7 @@ const env = loadEnv(process.env.NODE_ENV ?? 'development', process.cwd(), '');
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'https://theater-jb.ch',
output: 'server', output: 'server',
integrations: [ integrations: [
sanity({ sanity({
+10
View File
@@ -9,6 +9,7 @@
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "dependencies": {
"@astrojs/node": "^11.1.14", "@astrojs/node": "^11.1.14",
"@fontsource/kaushan-script": "^5.3.0",
"@portabletext/to-html": "^6.0.0", "@portabletext/to-html": "^6.0.0",
"@sanity/client": "^8.16.0", "@sanity/client": "^8.16.0",
"@sanity/image-url": "^2.2.0", "@sanity/image-url": "^2.2.0",
@@ -4008,6 +4009,15 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@fontsource/kaushan-script": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@fontsource/kaushan-script/-/kaushan-script-5.3.0.tgz",
"integrity": "sha512-Kdcvr76wOGp2jgKkkmAOETmPcw/a34RU/qcGW2+gSKzkKyr03vEaLWSbSABoVKWuyuoqWoulcmC4571vq3BYvg==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
"node_modules/@img/colour": { "node_modules/@img/colour": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",
+1
View File
@@ -12,6 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/node": "^11.1.14", "@astrojs/node": "^11.1.14",
"@fontsource/kaushan-script": "^5.3.0",
"@portabletext/to-html": "^6.0.0", "@portabletext/to-html": "^6.0.0",
"@sanity/client": "^8.16.0", "@sanity/client": "^8.16.0",
"@sanity/image-url": "^2.2.0", "@sanity/image-url": "^2.2.0",
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

+46 -28
View File
@@ -1,16 +1,16 @@
--- ---
const navItems = [ export interface NavItem {
{ id: 'projekt', label: 'Das Projekt' }, id: string;
{ id: 'team', label: 'Wer steckt dahinter' }, label: string;
{ id: 'stueck', label: 'Das Stück' }, }
{ id: 'mitwirkung', label: 'Mitwirken' },
{ id: 'termine', label: 'Termine' },
{ id: 'presse', label: 'Presse' },
{ id: 'gallery', label: 'Galerie' },
{ id: 'tickets', label: 'Tickets' },
];
---
interface Props {
/** Sections actually rendered on the page, in page order. */
items: NavItem[];
}
const { items: navItems } = Astro.props;
---
<nav class="max-md:sticky anchor-nav bg-[#2b2b56] py-4 md:py-3 transition-all duration-300 z-[100] shadow-[0_2px_5px_rgba(0,0,0,0.1)] [&.sticky]:sticky [&.sticky]:top-0 [&.sticky]:shadow-[0_2px_10px_rgba(0,0,0,0.3)]" id="anchor-nav"> <nav class="max-md:sticky anchor-nav bg-[#2b2b56] py-4 md:py-3 transition-all duration-300 z-[100] shadow-[0_2px_5px_rgba(0,0,0,0.1)] [&.sticky]:sticky [&.sticky]:top-0 [&.sticky]:shadow-[0_2px_10px_rgba(0,0,0,0.3)]" id="anchor-nav">
<div class="max-w-[--max-width-container] mx-auto px-[--spacing-md]"> <div class="max-w-[--max-width-container] mx-auto px-[--spacing-md]">
@@ -31,7 +31,9 @@ const navItems = [
<!-- Mobile header row --> <!-- Mobile header row -->
<div class="flex md:hidden items-center justify-between px-2"> <div class="flex md:hidden items-center justify-between px-2">
<span class="text-white/60 text-xs font-medium tracking-widest uppercase">Theater Ziefen</span> <a href="#" class="text-white no-underline text-base font-bold leading-tight tracking-wide">
Freilichttheater Ziefen <span class="text-accent">2028</span>
</a>
<button <button
id="hamburger-btn" id="hamburger-btn"
class="text-white p-2 -mr-2 rounded hover:bg-white/20 transition-colors duration-200" class="text-white p-2 -mr-2 rounded hover:bg-white/20 transition-colors duration-200"
@@ -93,22 +95,38 @@ const navItems = [
}); });
}); });
// Highlight active section on scroll // Highlight active section on scroll: the active section is the last one whose
const observer = new IntersectionObserver((entries) => { // top has passed a line just below the nav. At the very bottom of the page the
entries.forEach(entry => { // last section wins, since it may be too short to ever reach that line.
if (entry.isIntersecting) { const sections = Array.from(document.querySelectorAll<HTMLElement>('.theater-section'));
const sectionId = entry.target.getAttribute('id'); const navLinks = Array.from(document.querySelectorAll<HTMLElement>('.nav-link'));
document.querySelectorAll('.nav-link').forEach(link => {
link.classList.remove('active');
if (link.getAttribute('data-section') === sectionId) {
link.classList.add('active');
}
});
}
});
}, { root: null, rootMargin: '-20% 0px -70% 0px', threshold: 0 });
document.querySelectorAll('.theater-section').forEach(section => observer.observe(section)); function setActive(id: string | null) {
navLinks.forEach(link => link.classList.toggle('active', link.dataset.section === id));
}
function updateActive() {
const atBottom = window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 4;
if (atBottom && sections.length) {
setActive(sections[sections.length - 1].id);
return;
}
const line = window.innerHeight * 0.25;
let current: string | null = null;
for (const section of sections) {
if (section.getBoundingClientRect().top <= line) current = section.id;
}
setActive(current);
}
let ticking = false;
window.addEventListener('scroll', () => {
if (ticking) return;
ticking = true;
requestAnimationFrame(() => { updateActive(); ticking = false; });
}, { passive: true });
window.addEventListener('resize', updateActive);
updateActive();
// Sticky nav on scroll // Sticky nav on scroll
const nav = document.querySelector('.anchor-nav'); const nav = document.querySelector('.anchor-nav');
@@ -129,7 +147,7 @@ const navItems = [
hamburgerIcon.classList.add('hidden'); hamburgerIcon.classList.add('hidden');
closeIcon.classList.remove('hidden'); closeIcon.classList.remove('hidden');
hamburgerBtn.setAttribute('aria-expanded', 'true'); hamburgerBtn.setAttribute('aria-expanded', 'true');
hamburgerBtn.setAttribute('aria-label', 'Menü schließen'); hamburgerBtn.setAttribute('aria-label', 'Menü schliessen');
} }
function closeMenu() { function closeMenu() {
+16 -6
View File
@@ -7,16 +7,26 @@ const { committee } = Astro.props;
--- ---
{committee?.members?.length > 0 && ( {committee?.members?.length > 0 && (
<div class="text-center"> <div>
<p class="prose-measure opacity-90 mb-10"> <p class="prose-measure mb-10 text-center opacity-90">
{committee.intro || {committee.intro ||
'Hinter dem Freilichttheater Ziefen 2028 steht ein Organisationskomitee aus Ziefen und Umgebung, das das Projekt mit viel Herzblut plant, koordiniert und auf die Bühne bringt.'} 'Hinter dem Freilichttheater Ziefen 2028 steht ein Organisationskomitee aus Ziefen und Umgebung, das das Projekt mit viel Herzblut plant, koordiniert und auf die Bühne bringt.'}
</p> </p>
<ul class="list-none p-0 m-0 flex flex-wrap justify-center gap-4"> {/* Keep the Sanity order: members are deliberately ordered by importance. */}
<ul
role="list"
class="mx-auto m-0 grid max-w-5xl list-none grid-cols-2 gap-2 p-0 sm:gap-3 md:grid-cols-3 lg:grid-cols-4"
>
{committee.members.map((member: any) => ( {committee.members.map((member: any) => (
<li class="bg-white/10 rounded-lg px-6 py-4 min-w-[12rem]"> <li class="m-0 flex flex-col justify-center rounded-lg bg-white/10 px-3 py-2.5 sm:px-4 sm:py-3">
<span class="block text-xl text-white">{member.name}</span> <span class="block text-[0.95rem] font-bold leading-snug text-white hyphens-auto break-words sm:text-base md:text-lg">
{member.role && <span class="block text-base opacity-80">{member.role}</span>} {member.name}
</span>
{member.role && (
<span class="mt-0.5 block text-sm leading-snug text-white/75 hyphens-auto break-words">
{member.role}
</span>
)}
</li> </li>
))} ))}
</ul> </ul>
+22
View File
@@ -4,6 +4,14 @@ interface Props {
} }
const { content } = Astro.props; const { content } = Astro.props;
// Recruiting call to action. CMS fields override these defaults.
const cta = content.hero?.cta ?? {};
const showCta = !cta.hidden;
const ctaText = cta.text || 'Wir suchen Schauspielerinnen, Schauspieler, Sängerinnen und Sänger – Anmeldeschluss 31. Januar 2027';
const ctaLabel = cta.buttonLabel || 'Jetzt mitwirken';
const ctaHref = cta.href || '#mitwirkung';
const ctaExternal = /^https?:\/\//.test(ctaHref);
--- ---
<div class="bg-[#2b2b56] text-white relative overflow-hidden"> <div class="bg-[#2b2b56] text-white relative overflow-hidden">
@@ -26,5 +34,19 @@ const { content } = Astro.props;
{content.hero.subtitle} {content.hero.subtitle}
</p> </p>
)} )}
{showCta && (
<div class="hero-cta flex flex-col items-center gap-5 text-center">
<p class="max-w-xl text-lg md:text-xl font-semibold leading-snug text-accent">
{ctaText}
</p>
<a
href={ctaHref}
{...(ctaExternal ? { target: '_blank', rel: 'noopener noreferrer' } : {})}
class="inline-block py-4 px-10 bg-accent text-secondary no-underline font-bold text-xl rounded-lg transition-all duration-300 shadow-[0_4px_10px_rgba(0,0,0,0.2)] hover:-translate-y-1 hover:shadow-[0_6px_15px_rgba(0,0,0,0.3)] hover:bg-[#fbfa9a] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-accent"
>
{ctaLabel}
</a>
</div>
)}
</div> </div>
</div> </div>
+40 -17
View File
@@ -1,15 +1,23 @@
--- ---
import { Download, FileText } from '@lucide/astro'; import { Download, FileText, Mail, Phone } from '@lucide/astro';
interface Props { interface Props {
mitwirkung: any; mitwirkung: any;
} }
const { mitwirkung } = Astro.props; const { mitwirkung } = Astro.props;
// tel: URIs must not contain spaces; keep the formatted number for display.
const phoneHref = mitwirkung?.director_phone
? `tel:${String(mitwirkung.director_phone).replace(/[^\d+]/g, '')}`
: '';
const contactLink =
'inline-flex min-h-11 max-w-full text-base sm:text-lg items-center gap-3 rounded-md px-3 -mx-3 text-accent no-underline hover:underline hover:bg-white/10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent';
--- ---
{mitwirkung?.flyerUrl && ( {mitwirkung?.flyerUrl && (
<div class="mt-12 flex flex-col sm:flex-row items-center justify-center gap-4 text-center"> <div class="mx-auto mt-10 flex max-w-[42rem] flex-col items-center justify-center gap-4 text-center sm:flex-row sm:gap-6">
<a <a
href={`${mitwirkung.flyerUrl}?dl=Flyer-Mitwirken-Freilichttheater-Ziefen-2028.pdf`} href={`${mitwirkung.flyerUrl}?dl=Flyer-Mitwirken-Freilichttheater-Ziefen-2028.pdf`}
download download
@@ -27,7 +35,7 @@ const { mitwirkung } = Astro.props;
href={mitwirkung.flyerUrl} href={mitwirkung.flyerUrl}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
class="inline-flex items-center gap-2 text-white underline underline-offset-4 hover:text-accent" class="inline-flex min-h-11 items-center gap-2 text-white underline underline-offset-4 hover:text-accent"
> >
<FileText size={20} aria-hidden="true" /> <FileText size={20} aria-hidden="true" />
Im Browser ansehen<span class="sr-only"> (öffnet in neuem Tab)</span> Im Browser ansehen<span class="sr-only"> (öffnet in neuem Tab)</span>
@@ -36,20 +44,35 @@ const { mitwirkung } = Astro.props;
)} )}
{mitwirkung?.director_name && ( {mitwirkung?.director_name && (
<div class="mt-16 p-12 bg-white/10 rounded-lg text-center"> <div class="mx-auto mt-12 max-w-[42rem] rounded-lg bg-white/10 p-6 sm:p-8">
<h3 class="text-3xl text-white mb-4">Kontakt Regisseur:</h3> <h3 class="m-0 font-body text-sm font-semibold uppercase tracking-[0.15em] text-white/75">Kontakt</h3>
<p><strong>{mitwirkung.director_name}</strong></p> <p class="m-0 mt-2 text-xl font-bold text-white sm:text-2xl">{mitwirkung.director_name}</p>
{mitwirkung.director_email && ( <p class="m-0 text-base text-white/75">Regie &amp; Autor</p>
<p> {(mitwirkung.director_email || mitwirkung.director_phone) && (
<span>E-Mail:</span> <dl class="m-0 mt-4 flex flex-col gap-1">
<a href={`mailto:${mitwirkung.director_email}`} class="text-accent no-underline hover:underline">{mitwirkung.director_email}</a> {mitwirkung.director_email && (
</p> <div>
)} <dt class="sr-only">E-Mail</dt>
{mitwirkung.director_phone && ( <dd class="m-0">
<p> <a href={`mailto:${mitwirkung.director_email}`} class={contactLink}>
<span>Telefon:</span> <Mail size={20} aria-hidden="true" class="shrink-0" />
<a href={`tel:${mitwirkung.director_phone}`} class="text-accent no-underline hover:underline">{mitwirkung.director_phone}</a> <span class="min-w-0 break-all sm:break-normal">{mitwirkung.director_email}</span>
</p> </a>
</dd>
</div>
)}
{mitwirkung.director_phone && (
<div>
<dt class="sr-only">Telefon</dt>
<dd class="m-0">
<a href={phoneHref} class={contactLink}>
<Phone size={20} aria-hidden="true" class="shrink-0" />
<span class="whitespace-nowrap">{mitwirkung.director_phone}</span>
</a>
</dd>
</div>
)}
</dl>
)} )}
</div> </div>
)} )}
+72 -27
View File
@@ -1,4 +1,5 @@
--- ---
import { ExternalLink } from '@lucide/astro';
import { urlFor } from '../sanity/imageUrl'; import { urlFor } from '../sanity/imageUrl';
interface Props { interface Props {
@@ -6,37 +7,81 @@ interface Props {
} }
const { organizations } = Astro.props; const { organizations } = Astro.props;
// Short, human-readable host ("ziefen.ch") shown under the name of link cards.
const hostOf = (url: string) => {
try {
return new URL(url).hostname.replace(/^www\./, '');
} catch {
return '';
}
};
// Logos render at most ~80px tall; request a 2x-height version from the CDN.
const logoSrc = (logo: any) => {
const src = urlFor(logo);
return src && !src.includes('?') ? `${src}?h=160&fit=max&auto=format` : src;
};
const tileBase =
'flex h-full flex-col items-center gap-3 rounded-lg bg-white/10 p-4 text-center text-white no-underline md:p-5';
--- ---
{organizations && organizations.length > 0 && ( {organizations && organizations.length > 0 && (
<div class="grid grid-cols-1 md:grid-cols-[repeat(auto-fit,minmax(250px,1fr))] gap-12 mt-16"> <div class="mx-auto mt-14 max-w-5xl md:mt-16">
{organizations.map((org: any) => { <p class="mb-5 text-center font-body text-sm font-semibold uppercase tracking-[0.15em] text-white/75">
const cardContent = ( Trägerschaft &amp; Unterstützung
<Fragment> </p>
{org.logo && ( <ul role="list" class="m-0 grid list-none grid-cols-2 gap-3 p-0 sm:gap-4 lg:grid-cols-4 lg:gap-6">
<div class="mb-4 flex justify-center"> {organizations.map((org: any) => {
<img src={urlFor(org.logo)} alt={`${org.name} logo`} class="h-20 w-auto object-contain" /> const role = typeof org.role === 'string' ? org.role.trim() : '';
const host = org.url ? hostOf(org.url) : '';
const cardContent = (
<Fragment>
{org.logo && (
<div class="flex h-20 w-full items-center justify-center rounded-md bg-white p-2 md:h-24 md:p-3">
<img
src={logoSrc(org.logo)}
alt=""
loading="lazy"
decoding="async"
class="max-h-full max-w-full object-contain"
/>
</div>
)}
<div class="flex flex-1 flex-col items-center justify-center gap-1">
<h3 class="m-0 font-body text-sm font-bold leading-snug text-white hyphens-auto break-words sm:text-base lg:text-lg">
{org.name}
</h3>
{role && <p class="org-role m-0 text-sm leading-snug opacity-85">{role}</p>}
{org.url && (
<span class="inline-flex items-center gap-1 text-xs text-white/70 group-hover:text-accent">
{host && <span>{host}</span>}
<ExternalLink size={14} aria-hidden="true" class="shrink-0" />
<span class="sr-only">(öffnet in neuem Tab)</span>
</span>
)}
</div> </div>
)} </Fragment>
<h3 class="text-3xl mb-2 text-white">{org.name}</h3> );
<p class="org-role m-0 opacity-90">{org.role}</p>
</Fragment>
);
return org.url ? ( return (
<a <li class="m-0">
href={org.url} {org.url ? (
target="_blank" <a
rel="noopener noreferrer" href={org.url}
class="block bg-white/10 p-12 rounded-lg text-center transition-all duration-300 hover:-translate-y-1 hover:bg-white/15 no-underline text-white hover:shadow-lg" target="_blank"
> rel="noopener noreferrer"
{cardContent} class={`group ${tileBase} transition duration-200 hover:-translate-y-1 hover:bg-white/15 hover:shadow-lg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent motion-reduce:transition-none motion-reduce:hover:translate-y-0`}
</a> >
) : ( {cardContent}
<div class="bg-white/10 p-12 rounded-lg text-center transition-all duration-300 hover:-translate-y-1 hover:bg-white/15"> </a>
{cardContent} ) : (
</div> <div class={tileBase}>{cardContent}</div>
); )}
})} </li>
);
})}
</ul>
</div> </div>
)} )}
+3 -3
View File
@@ -9,15 +9,15 @@ const { images } = Astro.props;
--- ---
{images && images.length > 0 ? ( {images && images.length > 0 ? (
<div class="grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] md:grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-[--spacing-md] md:gap-[--spacing-sm] mt-[--spacing-lg]"> <div class="grid grid-cols-[repeat(auto-fill,minmax(min(100%,300px),1fr))] md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-6 md:gap-4 mt-8">
{images.map((image) => ( {images.map((image) => (
<div class="relative overflow-hidden rounded-lg shadow-[0_4px_10px_rgba(0,0,0,0.2)] transition-all duration-300 aspect-[4/3] hover:-translate-y-1 hover:shadow-[0_8px_20px_rgba(0,0,0,0.3)] group"> <div class="relative overflow-hidden rounded-lg shadow-[0_4px_10px_rgba(0,0,0,0.2)] transition-all duration-300 aspect-[4/3] hover:-translate-y-1 hover:shadow-[0_8px_20px_rgba(0,0,0,0.3)] group">
<img src={urlFor(image)} alt="Theater photo" loading="lazy" class="w-full h-full object-cover transition-transform duration-300 group-hover:scale-105" /> <img src={urlFor(image)} alt={image?.alt || 'Foto Freilichttheater Ziefen'} loading="lazy" class="w-full h-full object-cover transition-transform duration-300 group-hover:scale-105" />
</div> </div>
))} ))}
</div> </div>
) : ( ) : (
<div class="text-center p-[--spacing-xl] bg-white/10 rounded-lg italic"> <div class="prose-measure text-center px-6 py-10 md:px-10 bg-white/10 rounded-lg italic">
<p class="m-0 text-lg">Fotos werden bald hinzugefügt. Besuchen Sie uns später wieder!</p> <p class="m-0 text-lg">Fotos werden bald hinzugefügt. Besuchen Sie uns später wieder!</p>
</div> </div>
)} )}
+2 -2
View File
@@ -10,10 +10,10 @@ const { id, title, variant = 'light' } = Astro.props;
<section class={`theater-section py-12 px-4 md:py-20 md:px-16 scroll-mt-[100px] ${variant === 'light' ? 'bg-[#3d3d6f]' : 'bg-primary'} text-white`} id={id}> <section class={`theater-section py-12 px-4 md:py-20 md:px-16 scroll-mt-[100px] ${variant === 'light' ? 'bg-[#3d3d6f]' : 'bg-primary'} text-white`} id={id}>
<div class="max-w-7xl mx-auto"> <div class="max-w-7xl mx-auto">
<h2 class="font-heading text-4xl md:text-6xl mb-8 text-center font-normal text-white [text-shadow:2px_2px_4px_rgba(0,0,0,0.3)]"> <h2 class="font-heading text-4xl md:text-6xl mb-8 text-center font-normal text-white">
{title} {title}
</h2> </h2>
<div class="section-content text-lg md:text-base leading-relaxed"> <div class="section-content text-lg leading-relaxed">
<slot /> <slot />
</div> </div>
</div> </div>
+274 -27
View File
@@ -1,37 +1,284 @@
--- ---
import { MapPin } from '@lucide/astro';
interface Props { interface Props {
events: any[]; events: any[];
} }
const { events } = Astro.props; const { events } = Astro.props;
// --- Best-effort parsing of free-text German dates ------------------------
// "31. Januar 2027" -> day, "Juni 2028" / "Ab November 2027" -> month,
// "Frühjahr 2027" -> season (Mar–May). Anything else -> null (never "past").
const MONTHS: Record<string, number> = {
januar: 1, jänner: 1, jaenner: 1, februar: 2, märz: 3, maerz: 3, april: 4,
mai: 5, juni: 6, juli: 7, august: 8, september: 9, oktober: 10,
november: 11, dezember: 12,
};
const SEASONS: Record<string, number> = {
frühjahr: 3, fruehjahr: 3, frühling: 3, fruehling: 3, sommer: 6, herbst: 9, winter: 12,
};
const pad = (n: number) => String(n).padStart(2, '0');
const lastDay = (y: number, m: number) => new Date(Date.UTC(y, m, 0)).getUTCDate();
const iso = (y: number, m: number, d: number) => `${y}-${pad(m)}-${pad(d)}`;
interface ParsedDate {
end: string; // last day the milestone covers, YYYY-MM-DD
datetime?: string; // machine-readable value for <time>, only when exact
}
function parseDate(raw: unknown): ParsedDate | null {
if (typeof raw !== 'string') return null;
const s = raw.toLowerCase().trim();
const isoMatch = s.match(/\b(\d{4})-(\d{2})-(\d{2})\b/);
const numMatch = s.match(/\b(\d{1,2})\.\s?(\d{1,2})\.\s?(\d{4})\b/);
if (isoMatch || numMatch) {
const [y, m, d] = isoMatch
? [+isoMatch[1], +isoMatch[2], +isoMatch[3]]
: [+numMatch![3], +numMatch![2], +numMatch![1]];
if (m < 1 || m > 12 || d < 1 || d > lastDay(y, m)) return null;
return { end: iso(y, m, d), datetime: iso(y, m, d) };
}
const year = Number(s.match(/\b(\d{4})\b/)?.[1]);
if (!year) return null;
const words = s.split(/[^a-zäöü]+/);
const month = words.map((w) => MONTHS[w]).find(Boolean);
if (month) {
const day = Number(s.match(/\b(\d{1,2})\.\s*[a-zäöü]/)?.[1]);
if (day >= 1 && day <= lastDay(year, month)) {
return { end: iso(year, month, day), datetime: iso(year, month, day) };
}
return { end: iso(year, month, lastDay(year, month)), datetime: `${year}-${pad(month)}` };
}
const season = words.map((w) => SEASONS[w]).find(Boolean);
if (season) {
// A season spans three months, e.g. Frühjahr = March–May.
const endDate = new Date(Date.UTC(year, season - 1 + 3, 0));
return { end: iso(endDate.getUTCFullYear(), endDate.getUTCMonth() + 1, endDate.getUTCDate()) };
}
return null;
}
let today: string;
try {
today = new Intl.DateTimeFormat('en-CA', { timeZone: 'Europe/Zurich' }).format(new Date());
} catch {
today = new Date().toISOString().slice(0, 10);
}
const items = (Array.isArray(events) ? events : [])
.filter(Boolean)
.map((event: any) => {
const parsed = parseDate(event.date);
return { ...event, datetime: parsed?.datetime, past: parsed ? parsed.end < today : false };
});
const nextIndex = items.findIndex((item) => !item.past);
--- ---
{events && events.length > 0 && ( {items.length > 0 && (
<div class="relative min-h-auto flex flex-col gap-16"> <ol class="timeline relative mx-auto max-w-5xl list-none m-0 p-0 pt-10 md:pt-14" data-timeline>
<svg class="hidden md:flex absolute top-0 left-0 w-full h-full z-1 pointer-events-none" viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet"> <svg class="timeline-way pointer-events-none absolute inset-0 overflow-visible" aria-hidden="true" focusable="false">
<path <defs>
d="M 50,30 C 150,80 350,150 550,200 S 350,290 100,380 S 300,470 600,560 S 350,670 150,740 S 350,850 550,920" <linearGradient id="timeline-fade" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="0" y2="1">
fill="none" <stop offset="0" stop-color="#fff" stop-opacity="0" />
stroke="var(--color-accent)" <stop offset="1" stop-color="#fff" stop-opacity="0.7" data-fade-end />
stroke-width="4" </linearGradient>
stroke-dasharray="15,10" <linearGradient id="timeline-fade-accent" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="0" y2="1">
opacity="0.7" <stop offset="0" stop-color="var(--color-accent)" stop-opacity="0" />
/> <stop offset="1" stop-color="var(--color-accent)" stop-opacity="1" data-fade-end />
</linearGradient>
</defs>
<path data-way="all" fill="none" stroke="url(#timeline-fade)" stroke-width="2" stroke-linecap="round" />
<path data-way="walked" fill="none" stroke="url(#timeline-fade-accent)" stroke-width="2.5" stroke-linecap="round" />
</svg> </svg>
{events.map((event: any, index: number) => (
<div class={`relative z-2 flex items-center gap-12 text-left ${(index + 1) % 2 === 0 ? 'md:flex-row-reverse md:text-right md:right-0' : 'md:left-0'}`}> {items.map((item: any, index: number) => {
<div class="hidden md:flex flex-col items-center in-w-30 max-w-60 md:min-w-auto md:self-start"> const isNext = index === nextIndex;
<MapPin class="text-accent" size={40} ></MapPin> const contentLeft = index % 2 === 1; // desktop: alternate sides of the way
<div class="mt-6 text-lg font-bold text-accent text-center whitespace-nowrap md:text-base">{event.date}</div> const state = item.past ? 'past' : isNext ? 'next' : 'upcoming';
</div> const dateSide = contentLeft
<div class="flex-1 bg-white/10 p-12 rounded-xl backdrop-blur-[10px] border-2 border-white/20 transition-all duration-300 hover:-translate-y-1 hover:bg-white/15 hover:shadow-[0_8px_20px_rgba(0,0,0,0.3)] max-w-full md:max-w-2xl"> ? 'md:col-start-3 md:justify-self-start md:ml-2'
<div class="md:hidden text-lg font-bold text-accent text-center whitespace-nowrap md:text-base">{event.date}</div> : 'md:col-start-1 md:justify-self-end md:mr-2';
<h3 class="text-3xl mb-2 text-white md:text-2xl">{event.title}</h3> return (
<p class="event-desc m-0 text-white/90 leading-relaxed">{event.description}</p> <li
</div> class:list={[
</div> 'relative z-1 grid grid-cols-[2rem_1fr] gap-x-4 pb-10 last:pb-0',
))} 'md:grid-cols-[1fr_6rem_1fr] md:gap-x-0 md:pb-16',
</div> ]}
data-state={state}
aria-current={isNext ? 'step' : undefined}
>
<span
data-marker
class:list={[
'col-start-1 row-start-1 self-center justify-self-center rounded-full md:col-start-2',
state === 'past' && 'size-2.5 bg-[#9494b0]',
state === 'upcoming' && 'size-3.5 border-2 border-white/85 bg-(--tl-bg)',
state === 'next' && 'size-5 bg-accent shadow-[0_0_0_6px_rgb(249_248_113/0.18),0_0_18px_rgb(249_248_113/0.45)]',
]}
/>
{/* Mobile: date + label share one line. Desktop: the wrapper dissolves and the
date sits level with the marker, the label tucked underneath. */}
<div class="col-start-2 row-start-1 flex flex-wrap items-center gap-x-3 gap-y-1 md:contents">
{item.datetime ? (
<time datetime={item.datetime} class:list={['tl-date md:row-start-1 md:self-center', dateSide]}>{item.date}</time>
) : (
<span class:list={['tl-date md:row-start-1 md:self-center', dateSide]}>{item.date}</span>
)}
{isNext && (
<span
class:list={[
'rounded-full bg-accent px-2.5 py-0.5 text-xs font-bold uppercase tracking-wider text-primary',
'md:row-start-2 md:mt-1.5 md:self-start',
dateSide,
]}
>
Nächster Termin
</span>
)}
{item.past && <span class="sr-only">(vorbei)</span>}
</div>
<h3
class:list={[
'col-start-2 row-start-2 m-0 mt-1 font-bold leading-snug md:row-start-1 md:mt-0',
contentLeft ? 'md:col-start-1 md:pr-2 md:text-right' : 'md:col-start-3 md:pl-2',
state === 'next' ? 'text-2xl md:text-3xl' : 'text-xl md:text-2xl',
]}
>
{item.title}
</h3>
{item.description && (
<p
class:list={[
'col-start-2 row-start-3 m-0 mt-1.5 leading-relaxed text-white/80 md:row-start-2 md:mt-2 md:max-w-md',
contentLeft ? 'md:col-start-1 md:ml-auto md:pr-2 md:text-right' : 'md:col-start-3 md:pl-2',
]}
>
{item.description}
</p>
)}
</li>
);
})}
</ol>
)} )}
<style>
.timeline {
/* Marker fill must match the section background so the way "enters" open rings. */
--tl-bg: #3d3d6f;
}
/* No-JS fallback: a straight way through the marker column. Replaced by the SVG once drawn. */
.timeline::before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 1rem;
width: 2px;
margin-left: -1px;
background: linear-gradient(to bottom, transparent, rgb(255 255 255 / 0.7) 2.5rem);
}
@media (width >= 50rem) {
.timeline::before {
left: 50%;
}
}
.timeline[data-drawn]::before {
display: none;
}
.tl-date {
font-size: 0.875rem;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
color: rgb(255 255 255 / 0.75);
}
li[data-state='next'] .tl-date {
font-size: 1rem;
color: var(--color-accent);
}
li[data-state='past'] {
color: rgb(255 255 255 / 0.5);
}
li[data-state='past'] .tl-date,
li[data-state='past'] p {
color: rgb(255 255 255 / 0.4);
}
</style>
<script>
// Draws "the way": one continuous, gently winding line through the centre of every marker.
// Positions are measured, so it stays exact for any content length and viewport.
function draw(list: HTMLElement) {
const svg = list.querySelector<SVGSVGElement>('svg.timeline-way');
const markers = [...list.querySelectorAll<HTMLElement>('[data-marker]')];
if (!svg || markers.length === 0) return;
const box = list.getBoundingClientRect();
const width = box.width;
const height = box.height;
if (!width || !height) return;
const pts = markers.map((m) => {
const r = m.getBoundingClientRect();
return { x: r.left + r.width / 2 - box.left, y: r.top + r.height / 2 - box.top };
});
const nextIdx = markers.findIndex((m) => m.closest('li')?.dataset.state === 'next');
const allPast = markers.every((m) => m.closest('li')?.dataset.state === 'past');
const desktop = window.matchMedia('(min-width: 50rem)').matches;
const amp = desktop ? 26 : 9; // how far the way swings between markers
const start = { x: pts[0].x, y: 0 };
// Each segment is a cubic curve; alternating the bulge side keeps the tangent
// continuous at every marker, so the line reads as one hand-drawn stroke.
const segment = (a: { x: number; y: number }, b: { x: number; y: number }, side: number) => {
const k = (b.y - a.y) * 0.4;
return `C ${a.x + side * amp} ${a.y + k} ${b.x + side * amp} ${b.y - k} ${b.x} ${b.y}`;
};
const segs: string[] = [segment(start, pts[0], -1)];
for (let i = 1; i < pts.length; i++) segs.push(segment(pts[i - 1], pts[i], i % 2 ? 1 : -1));
const head = `M ${start.x} ${start.y}`;
const walkedCount = allPast ? segs.length : nextIdx >= 0 ? nextIdx + 1 : 0;
svg.setAttribute('width', String(width));
svg.setAttribute('height', String(height));
svg.setAttribute('viewBox', `0 0 ${width} ${height}`);
svg.querySelectorAll('linearGradient').forEach((g) => {
g.setAttribute('y2', String(pts[0].y));
});
svg.querySelector('[data-way="all"]')?.setAttribute('d', `${head} ${segs.join(' ')}`);
svg
.querySelector('[data-way="walked"]')
?.setAttribute('d', walkedCount ? `${head} ${segs.slice(0, walkedCount).join(' ')}` : '');
list.setAttribute('data-drawn', '');
}
function init() {
document.querySelectorAll<HTMLElement>('[data-timeline]').forEach((list) => {
if (list.dataset.timelineInit) return;
list.dataset.timelineInit = '1';
let frame = 0;
const schedule = () => {
cancelAnimationFrame(frame);
frame = requestAnimationFrame(() => draw(list));
};
schedule();
new ResizeObserver(schedule).observe(list);
document.fonts?.ready.then(schedule);
});
}
init();
document.addEventListener('astro:page-load', init);
</script>
+92 -14
View File
@@ -1,36 +1,114 @@
--- ---
// Self-hosted Kaushan Script (no requests to Google, for revDSG/GDPR)
import '@fontsource/kaushan-script/400.css';
import '../styles/global.css'; import '../styles/global.css';
interface Props { interface FooterOrganization {
title: string; name?: string;
description?: string; url?: string;
} }
const { title, description = "Freilichttheater Ziefen 2028 – Wyti Wäg mit Breitestei. Uraufführung im Juni 2028 rund um Jonas Breitenstein (1828–1877)." } = Astro.props; interface Props {
title?: string;
description?: string;
/** Supporting organisations shown in the footer (name + optional link). */
organizations?: FooterOrganization[];
/** Show the "Impressum & Datenschutz" link (only once its details are complete). */
showImpressumLink?: boolean;
}
const BRAND = 'Freilichttheater Ziefen 2028 – Wyti Wäg mit Breitestei';
const {
title = BRAND,
description = "Freilichttheater Ziefen 2028 – Wyti Wäg mit Breitestei. Uraufführung im Juni 2028 rund um Jonas Breitenstein (1828–1877).",
organizations = [],
showImpressumLink = false,
} = Astro.props;
const site = Astro.site ?? Astro.url;
const canonicalUrl = new URL(Astro.url.pathname, site).href;
const ogImageUrl = new URL('/og-image.png', site).href;
const footerOrgs = organizations.filter((org) => org?.name);
--- ---
<!doctype html> <!doctype html>
<html lang="de"> <html lang="de-CH">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="description" content={description} />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<title>{title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={canonicalUrl} />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <meta property="og:type" content="website" />
<link href="https://fonts.googleapis.com/css2?family=Kaushan+Script&display=swap" rel="stylesheet"> <meta property="og:site_name" content="Freilichttheater Ziefen 2028" />
<title>{title} | Theater Ziefen</title> <meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={canonicalUrl} />
<meta property="og:image" content={ogImageUrl} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content={BRAND} />
<meta property="og:locale" content="de_CH" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={ogImageUrl} />
</head> </head>
<body> <body>
<main class="min-h-[calc(100vh-200px)] flex flex-col items-center *:w-full"> <main class="min-h-[calc(100vh-200px)] flex flex-col items-center *:w-full">
<slot /> <slot />
</main> </main>
<footer class="bg-[#2b2b56] text-white py-[--spacing-md] text-center mt-[--spacing-xl] border-t-2 border-white/10"> <footer class="bg-[#2b2b56] text-white/90 py-12 px-4 text-center border-t-2 border-white/10">
<div class="mx-auto px-[--spacing-md] md:px-[--spacing-md] px-[--spacing-sm]"> <div class="max-w-4xl mx-auto flex flex-col items-center gap-6">
<p>&copy; {new Date().getFullYear()} Freilichttheater Ziefen. Alle Rechte vorbehalten.</p> <p class="m-0 flex flex-wrap justify-center gap-x-2">
<p class="mt- text-accent font-semibold opacity-90">Uraufführung Juni 2028</p> <span class="font-bold text-white whitespace-nowrap">Freilichttheater Ziefen 2028</span>
<span class="opacity-50" aria-hidden="true">·</span>
<span class="text-accent font-semibold whitespace-nowrap">Uraufführung Juni 2028</span>
</p>
<nav aria-label="Kontakt">
<p class="m-0">
<span class="font-semibold text-white mr-1">Kontakt:</span>
<a href="/#mitwirkung" class="underline underline-offset-4 hover:text-accent">Mitwirken &amp; Regie</a>
<span class="mx-2 opacity-50" aria-hidden="true">·</span>
<a href="/#presse" class="underline underline-offset-4 hover:text-accent">Presse</a>
</p>
</nav>
{footerOrgs.length > 0 && (
<div>
<p class="m-0 mb-2 text-sm uppercase tracking-widest text-white/60">Getragen von</p>
<ul class="list-none m-0 p-0 flex flex-wrap justify-center gap-x-6 gap-y-2">
{footerOrgs.map((org) => (
<li>
{org.url ? (
<a href={org.url} target="_blank" rel="noopener noreferrer" class="underline underline-offset-4 decoration-white/40 hover:text-accent hover:decoration-accent">
{org.name}<span class="sr-only"> (öffnet in neuem Tab)</span>
</a>
) : (
<span>{org.name}</span>
)}
</li>
))}
</ul>
</div>
)}
<p class="m-0 text-sm text-white/60 flex flex-wrap justify-center gap-x-2">
<span>&copy; {new Date().getFullYear()} Freilichttheater Ziefen</span>
{showImpressumLink && (
<Fragment>
<span aria-hidden="true">·</span>
<a href="/impressum" class="underline underline-offset-4 decoration-white/40 hover:text-accent hover:decoration-accent">Impressum &amp; Datenschutz</a>
</Fragment>
)}
</p>
</div> </div>
</footer> </footer>
</body> </body>
+147
View File
@@ -0,0 +1,147 @@
---
import BaseLayout from '../layouts/BaseLayout.astro';
import TheaterSection from '../components/TheaterSection.astro';
import { ArrowLeft } from '@lucide/astro';
import { fetchWithCache } from '../sanity/client';
import { theaterHomepageQuery } from '../sanity/queries';
import { isImpressumComplete } from '../sanity/impressum';
export const prerender = false;
const content: any = (await fetchWithCache(theaterHomepageQuery)) ?? {};
const imp = content.impressum ?? {};
const complete = isImpressumComplete(imp);
// Studio field overrides; the site is hosted at Infomaniak.
const hosting = imp.hosting?.trim() || 'Infomaniak Network SA, Genf, mit Servern in der Schweiz';
// Never publish a half-finished legal notice. In dev, show a preview that
// marks the missing Studio fields instead.
if (!complete && !import.meta.env.DEV) {
return new Response('Nicht gefunden', { status: 404 });
}
const webmaster = (content.team?.committee?.members ?? []).find((m: any) =>
/webmaster/i.test(m?.role ?? ''),
)?.name;
const updated = imp.updated
? new Intl.DateTimeFormat('de-CH', { day: 'numeric', month: 'long', year: 'numeric' }).format(new Date(imp.updated))
: null;
---
<BaseLayout
title="Impressum & Datenschutz – Freilichttheater Ziefen 2028"
description="Impressum und Datenschutzerklärung der Website des Freilichttheaters Ziefen 2028."
organizations={content.team?.organizations || []}
showImpressumLink={complete}
>
<header class="bg-[#2b2b56] py-4 px-4 shadow-[0_2px_5px_rgba(0,0,0,0.1)]">
<div class="max-w-[42rem] mx-auto flex items-center justify-between gap-4">
<a href="/" class="inline-flex items-center gap-2 min-h-11 text-white no-underline hover:text-accent">
<ArrowLeft size={20} aria-hidden="true" />
Zur Startseite
</a>
<span class="font-bold text-white">Freilichttheater Ziefen <span class="text-accent">2028</span></span>
</div>
</header>
{!complete && (
<p class="m-0 bg-accent text-secondary text-center font-semibold py-3 px-4">
Vorschau (nur lokal sichtbar): Diese Seite ist live erst erreichbar, wenn im Studio unter «Impressum &amp; Datenschutz»
die Herausgeberin und die E-Mail ausgefüllt sind.
</p>
)}
<TheaterSection id="impressum" title="Impressum" variant="light">
<div class="prose-measure">
<h3>Verantwortlich für den Inhalt</h3>
<p>
{imp.publisher ? <strong>{imp.publisher}</strong> : <mark>[fehlt: Herausgeberin]</mark>}
<br />
{imp.address
? imp.address.split('\n').map((line: string, i: number) => <Fragment>{i > 0 && <br />}{line}</Fragment>)
: <mark>[fehlt: Postadresse]</mark>}
</p>
{imp.representative && <p>Vertreten durch: {imp.representative}</p>}
<p>
E-Mail:{' '}
{imp.email
? <a href={`mailto:${imp.email}`} class="text-accent">{imp.email}</a>
: <mark>[fehlt: E-Mail]</mark>}
</p>
{imp.uid && <p>{imp.uid}</p>}
{webmaster && (
<Fragment>
<h3>Webmaster</h3>
<p>{webmaster}</p>
</Fragment>
)}
<h3>Bilder und Logos</h3>
<p>
Logos und Wappen werden mit freundlicher Genehmigung der jeweiligen Organisationen verwendet.
{imp.imageCredits && <Fragment><br />{imp.imageCredits}</Fragment>}
</p>
<h3>Externe Links</h3>
<p>Für die Inhalte verlinkter externer Websites sind ausschliesslich deren Betreiber verantwortlich.</p>
</div>
</TheaterSection>
<TheaterSection id="datenschutz" title="Datenschutz" variant="dark">
<div class="prose-measure">
<p>
Wir nehmen den Schutz Ihrer Personendaten ernst und bearbeiten sie gemäss dem Schweizer
Datenschutzgesetz (DSG).
</p>
<h3>Verantwortliche Stelle</h3>
<p>
{imp.publisher || <mark>[fehlt: Herausgeberin]</mark>}, Kontakt für Datenschutzfragen:{' '}
{imp.email ? <a href={`mailto:${imp.email}`} class="text-accent">{imp.email}</a> : <mark>[fehlt: E-Mail]</mark>}
</p>
<h3>Besuch der Website</h3>
<p>
Beim Aufruf dieser Website verarbeitet unser Hosting-Anbieter
({hosting}) technisch
notwendige Daten wie IP-Adresse, Datum und Uhrzeit des Zugriffs, aufgerufene Seite und Browsertyp. Diese
Daten dienen ausschliesslich dem sicheren Betrieb der Website und werden nicht länger als dafür nötig
aufbewahrt.
</p>
<h3>Inhalte, Bilder und Dokumente</h3>
<p>
Texte, Bilder und Dokumente (z. B. der Flyer) verwalten wir mit dem Content-Management-System Sanity
(sanity.io). Bilder und Dokumente lädt Ihr Browser direkt von Servern von Sanity. Dabei wird Ihre
IP-Adresse an Sanity übermittelt. Diese Server können sich ausserhalb der Schweiz befinden, auch in den USA.
</p>
<h3>Schriften</h3>
<p>
Die verwendeten Schriften sind auf unserem eigenen Server gespeichert. Es wird keine Verbindung zu Google
oder anderen Schriftanbietern hergestellt.
</p>
<h3>Keine Analyse, keine Cookies</h3>
<p>Wir setzen keine Analyse- oder Tracking-Tools und keine Cookies ein.</p>
<h3>Kontaktaufnahme</h3>
<p>
Wenn Sie uns per E-Mail oder Telefon kontaktieren, verwenden wir Ihre Angaben nur, um Ihre Anfrage zu
beantworten und die Mitwirkung am Theaterprojekt zu organisieren (z. B. das Casting). Wir geben sie nicht
an Dritte weiter und löschen sie, sobald sie dafür nicht mehr benötigt werden.
</p>
<h3>Ihre Rechte</h3>
<p>
Sie können jederzeit Auskunft über Ihre bei uns gespeicherten Personendaten verlangen und deren
Berichtigung oder Löschung beantragen. Wenden Sie sich dazu an{' '}
{imp.email ? <a href={`mailto:${imp.email}`} class="text-accent">{imp.email}</a> : <mark>[fehlt: E-Mail]</mark>}.
</p>
{updated && <p class="text-white/70 text-base">Stand: {updated}</p>}
</div>
</TheaterSection>
</BaseLayout>
+65 -31
View File
@@ -1,6 +1,6 @@
--- ---
import BaseLayout from '../layouts/BaseLayout.astro'; import BaseLayout from '../layouts/BaseLayout.astro';
import AnchorNav from '../components/AnchorNav.astro'; import AnchorNav, { type NavItem } from '../components/AnchorNav.astro';
import TheaterSection from '../components/TheaterSection.astro'; import TheaterSection from '../components/TheaterSection.astro';
import PhotoGallery from '../components/PhotoGallery.astro'; import PhotoGallery from '../components/PhotoGallery.astro';
import Hero from '../components/Hero.astro'; import Hero from '../components/Hero.astro';
@@ -11,61 +11,95 @@ import Timeline from '../components/Timeline.astro';
import { fetchWithCache } from '../sanity/client'; import { fetchWithCache } from '../sanity/client';
import { renderPortableText } from '../sanity/portableText'; import { renderPortableText } from '../sanity/portableText';
import { theaterHomepageQuery } from '../sanity/queries'; import { theaterHomepageQuery } from '../sanity/queries';
import { isImpressumComplete } from '../sanity/impressum';
export const prerender = false export const prerender = false
const content: any = await fetchWithCache(theaterHomepageQuery) ?? {}; const content: any = await fetchWithCache(theaterHomepageQuery) ?? {};
/** True when a Portable Text array has any visible text or an image. */
function hasPortableContent(blocks: any[] | undefined): boolean {
return (blocks ?? []).some((block) =>
block?._type === 'image'
? Boolean(block.asset)
: (block?.children ?? []).some((child: any) => child?.text?.trim()),
);
}
// Page order (requested by the director). `show` hides empty sections from
// both the page and the nav; colours alternate over the visible sections only.
const sections: (NavItem & { show: boolean })[] = [
{ id: 'projekt', label: 'Das Projekt', show: true },
{ id: 'mitwirkung', label: 'Mitwirken', show: true },
{ id: 'termine', label: 'Termine', show: true },
{ id: 'team', label: 'Wer steckt dahinter', show: true },
{ id: 'ok', label: 'Organisationskomitee', show: content.team?.committee?.members?.length > 0 },
{ id: 'stueck', label: 'Das Stück', show: hasPortableContent(content.stueck?.content) },
{ id: 'presse', label: 'Presse', show: true },
{ id: 'gallery', label: 'Galerie', show: content.gallery?.images?.length > 0 },
{ id: 'tickets', label: 'Tickets', show: Boolean(content.tickets?.ticket_url) },
];
const visible = sections.filter((s) => s.show);
const navItems: NavItem[] = visible.map(({ id, label }) => ({ id, label }));
const shown = (id: string) => visible.some((s) => s.id === id);
const variant = (id: string): 'light' | 'dark' =>
visible.findIndex((s) => s.id === id) % 2 === 0 ? 'light' : 'dark';
--- ---
<BaseLayout title={content.title || 'Freilichttheater Ziefen 2028'}> <BaseLayout organizations={content.team?.organizations || []} showImpressumLink={isImpressumComplete(content.impressum)}>
<AnchorNav /> <AnchorNav items={navItems} />
<Hero content={content} /> <Hero content={content} />
<TheaterSection id="projekt" title={content.projekt?.title || 'Das Projekt'} variant="light"> <TheaterSection id="projekt" title={content.projekt?.title || 'Das Projekt'} variant={variant('projekt')}>
<div class="prose-measure" set:html={renderPortableText(content.projekt?.content)} /> <div class="prose-measure" set:html={renderPortableText(content.projekt?.content)} />
</TheaterSection> </TheaterSection>
<TheaterSection id="team" title={content.team?.title || 'Wer steckt dahinter'} variant="dark"> <TheaterSection id="mitwirkung" title={content.mitwirkung?.title || 'Mitwirken'} variant={variant('mitwirkung')}>
<div class="prose-measure" set:html={renderPortableText(content.team?.content)} />
<Organizations organizations={content.team?.organizations || []} />
</TheaterSection>
{content.team?.committee?.members?.length > 0 && (
<TheaterSection id="ok" title={content.team.committee.title || 'Organisationskomitee'} variant="light">
<Committee committee={content.team.committee} />
</TheaterSection>
)}
<TheaterSection id="stueck" title={content.stueck?.title || 'Das Stück'} variant="light">
<div class="prose-measure" set:html={renderPortableText(content.stueck?.content)} />
</TheaterSection>
<TheaterSection id="mitwirkung" title={content.mitwirkung?.title || 'Mitwirken'} variant="dark">
<div class="prose-measure" set:html={renderPortableText(content.mitwirkung?.content)} /> <div class="prose-measure" set:html={renderPortableText(content.mitwirkung?.content)} />
<MitwirkenExtras mitwirkung={content.mitwirkung} /> <MitwirkenExtras mitwirkung={content.mitwirkung} />
</TheaterSection> </TheaterSection>
<TheaterSection id="termine" title={content.termine?.title || 'Termine'} variant="light"> <TheaterSection id="termine" title={content.termine?.title || 'Termine'} variant={variant('termine')}>
<Timeline events={content.termine?.events || []} /> <Timeline events={content.termine?.events || []} />
</TheaterSection> </TheaterSection>
<TheaterSection id="presse" title={content.presse?.title || 'Presse'} variant="dark"> <TheaterSection id="team" title={content.team?.title || 'Wer steckt dahinter'} variant={variant('team')}>
<div class="prose-measure" set:html={renderPortableText(content.team?.content)} />
<Organizations organizations={content.team?.organizations || []} />
</TheaterSection>
{shown('ok') && (
<TheaterSection id="ok" title={content.team.committee.title || 'Organisationskomitee'} variant={variant('ok')}>
<Committee committee={content.team.committee} />
</TheaterSection>
)}
{shown('stueck') && (
<TheaterSection id="stueck" title={content.stueck?.title || 'Das Stück'} variant={variant('stueck')}>
<div class="prose-measure" set:html={renderPortableText(content.stueck?.content)} />
</TheaterSection>
)}
<TheaterSection id="presse" title={content.presse?.title || 'Presse'} variant={variant('presse')}>
<div class="prose-measure" set:html={renderPortableText(content.presse?.content)} /> <div class="prose-measure" set:html={renderPortableText(content.presse?.content)} />
</TheaterSection> </TheaterSection>
<TheaterSection id="gallery" title={content.gallery?.title || 'Foto Galerie'} variant="light"> {shown('gallery') && (
<PhotoGallery images={content.gallery?.images || []} /> <TheaterSection id="gallery" title={content.gallery?.title || 'Fotogalerie'} variant={variant('gallery')}>
</TheaterSection> <PhotoGallery images={content.gallery?.images || []} />
</TheaterSection>
)}
<TheaterSection id="tickets" title={content.tickets?.title || 'Tickets'} variant="dark"> {shown('tickets') && (
<div class="prose-measure" set:html={renderPortableText(content.tickets?.content)} /> <TheaterSection id="tickets" title={content.tickets?.title || 'Tickets'} variant={variant('tickets')}>
{content.tickets?.ticket_url && ( <div class="prose-measure" set:html={renderPortableText(content.tickets?.content)} />
<div class="mt-[--spacing-lg] text-center"> <div class="mt-8 text-center">
<a href={content.tickets.ticket_url} class="inline-block py-4 px-10 bg-accent text-secondary no-underline font-bold text-xl rounded-lg transition-all duration-300 shadow-[0_4px_10px_rgba(0,0,0,0.2)] hover:-translate-y-1 hover:shadow-[0_6px_15px_rgba(0,0,0,0.3)] hover:bg-[#fbfa9a]" target="_blank" rel="noopener noreferrer"> <a href={content.tickets.ticket_url} class="inline-block py-4 px-10 bg-accent text-secondary no-underline font-bold text-xl rounded-lg transition-all duration-300 shadow-[0_4px_10px_rgba(0,0,0,0.2)] hover:-translate-y-1 hover:shadow-[0_6px_15px_rgba(0,0,0,0.3)] hover:bg-[#fbfa9a]" target="_blank" rel="noopener noreferrer">
Tickets kaufen Tickets kaufen
</a> </a>
</div> </div>
)} </TheaterSection>
</TheaterSection> )}
</BaseLayout> </BaseLayout>
+8
View File
@@ -0,0 +1,8 @@
/**
* The Impressum page and its footer link only go live once the legally
* essential details are filled in the Studio, so a half-finished legal
* notice is never published.
*/
export function isImpressumComplete(impressum: any): boolean {
return Boolean(impressum?.publisher?.trim() && impressum?.email?.trim());
}
+46 -1
View File
@@ -20,6 +20,19 @@ export const theaterHomepageSchema = defineType({
fields: [ fields: [
defineField({ name: 'title', title: 'Title', type: 'string', validation: (r) => r.required() }), defineField({ name: 'title', title: 'Title', type: 'string', validation: (r) => r.required() }),
defineField({ name: 'subtitle', title: 'Subtitle', type: 'text' }), defineField({ name: 'subtitle', title: 'Subtitle', type: 'text' }),
defineField({
name: 'cta',
title: 'Call to Action',
description: 'Aufruf unter dem Untertitel. Leere Felder verwenden den Standardtext (Mitwirken, Anmeldeschluss 31. Januar 2027).',
type: 'object',
options: { collapsible: true },
fields: [
defineField({ name: 'text', title: 'Text', type: 'string' }),
defineField({ name: 'buttonLabel', title: 'Button Label', type: 'string' }),
defineField({ name: 'href', title: 'Button Link', description: 'z.B. #mitwirkung oder eine URL', type: 'string' }),
defineField({ name: 'hidden', title: 'Aufruf ausblenden', type: 'boolean', initialValue: false }),
],
}),
], ],
}), }),
@@ -164,7 +177,14 @@ export const theaterHomepageSchema = defineType({
name: 'images', name: 'images',
title: 'Gallery Images', title: 'Gallery Images',
type: 'array', type: 'array',
of: [{ type: 'image' }], of: [
defineArrayMember({
type: 'image',
fields: [
defineField({ name: 'alt', title: 'Alternativtext', description: 'Kurze Bildbeschreibung für Screenreader', type: 'string' }),
],
}),
],
}), }),
], ],
}), }),
@@ -180,5 +200,30 @@ export const theaterHomepageSchema = defineType({
defineField({ name: 'ticket_url', title: 'Ticket Purchase URL', type: 'url' }), defineField({ name: 'ticket_url', title: 'Ticket Purchase URL', type: 'url' }),
], ],
}), }),
// Impressum & Datenschutz (/impressum)
defineField({
name: 'impressum',
title: 'Impressum & Datenschutz',
description:
'Angaben für die Seite /impressum. Die Seite und der Link im Footer erscheinen erst, wenn «Herausgeberin» und «E-Mail» ausgefüllt sind.',
type: 'object',
options: { collapsible: true, collapsed: true },
fields: [
defineField({
name: 'publisher',
title: 'Herausgeberin / verantwortliche Stelle',
description: 'z. B. «Verein Jonas Breitenstein» oder «OK Freilichttheater Ziefen 2028»',
type: 'string',
}),
defineField({ name: 'address', title: 'Postadresse', type: 'text', rows: 3 }),
defineField({ name: 'email', title: 'E-Mail (auch für Datenschutzanfragen)', type: 'string' }),
defineField({ name: 'representative', title: 'Vertreten durch', description: 'Vertretungsberechtigte Person(en), z. B. Präsidium', type: 'string' }),
defineField({ name: 'uid', title: 'UID / Handelsregister (falls vorhanden)', type: 'string' }),
defineField({ name: 'hosting', title: 'Hosting-Anbieter und Serverstandort', description: 'Leer lassen für den Standard «Infomaniak Network SA, Genf, mit Servern in der Schweiz»', type: 'string' }),
defineField({ name: 'imageCredits', title: 'Bildnachweise', type: 'text', rows: 3 }),
defineField({ name: 'updated', title: 'Stand', type: 'date' }),
],
}),
], ],
}) })
+15 -6
View File
@@ -34,12 +34,18 @@
background-color: #2b2b56; background-color: #2b2b56;
} }
h1, h2, h3, h4, h5, h6 { /* Kaushan Script is reserved for the logo and h2 section titles.
Sub-headings (h3–h6, card titles) use the body font, bold. */
h1, h2 {
font-family: var(--font-heading); font-family: var(--font-heading);
font-weight: 400; font-weight: 400;
} }
/* Language-specific content visibility */ h3, h4, h5, h6 {
font-family: var(--font-body);
font-weight: 700;
line-height: 1.3;
}
/* Section content styling */ /* Section content styling */
.section-content p { .section-content p {
@@ -47,13 +53,16 @@
} }
.section-content h3 { .section-content h3 {
font-size: 1.8rem; font-size: 1.375rem;
margin: 1.5rem 0 1rem; letter-spacing: 0.005em;
margin: 2rem 0 0.75rem;
}
.section-content h3:first-child {
margin-top: 0;
} }
.section-content h4 { .section-content h4 {
font-family: var(--font-body);
font-weight: 700;
font-size: 1.15rem; font-size: 1.15rem;
margin: 1.5rem 0 0.5rem; margin: 1.5rem 0 0.5rem;
} }