Split homepage sections into components

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
JohannesandClaude Opus 5.5 committed 2026-11-26 08:21:45 +01:00
1 parent fc0603377c
commit c237dea65f
6 files changed
+211 -201

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
---
interface Props {
committee: any;
}
const { committee } = Astro.props;
---
{committee?.members?.length > 0 && (
<div class="text-center">
<p class="prose-measure opacity-90 mb-10">
{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.'}
</p>
<ul class="list-none p-0 m-0 flex flex-wrap justify-center gap-4">
{committee.members.map((member: any) => (
<li class="bg-white/10 rounded-lg px-6 py-4 min-w-[12rem]">
<span class="block text-xl text-white">{member.name}</span>
{member.role && <span class="block text-base opacity-80">{member.role}</span>}
</li>
))}
</ul>
</div>
)}
+30
View File
@@ -0,0 +1,30 @@
---
interface Props {
content: any;
}
const { content } = Astro.props;
---
<div class="bg-[#2b2b56] text-white relative overflow-hidden">
<div class="max-w-6xl mx-auto px-4 pt-10 pb-14 md:px-12 md:pt-20 md:pb-22 flex flex-col items-center gap-6 md:gap-12">
<h1 class="w-full">
<picture>
<!-- Phones: rearranged logo, the way stays one continuous line drawn by the pen -->
<source media="(max-width: 39.99rem)" srcset="/logo-ftz2028-mobile.svg" width="1195" height="915" />
<img
src="/logo-ftz2028.svg"
width="1100"
height="334"
alt={content.hero?.title || 'Freilichttheater Ziefen 2028 – Wyti Wäg mit Breitestei'}
class="block w-full h-auto mx-auto max-sm:max-w-[24rem]"
/>
</picture>
</h1>
{content.hero?.subtitle && (
<p class="max-w-2xl text-center text-lg md:text-xl leading-relaxed opacity-90">
{content.hero.subtitle}
</p>
)}
</div>
</div>
+55
View File
@@ -0,0 +1,55 @@
---
import { Download, FileText } from '@lucide/astro';
interface Props {
mitwirkung: any;
}
const { mitwirkung } = Astro.props;
---
{mitwirkung?.flyerUrl && (
<div class="mt-12 flex flex-col sm:flex-row items-center justify-center gap-4 text-center">
<a
href={`${mitwirkung.flyerUrl}?dl=Flyer-Mitwirken-Freilichttheater-Ziefen-2028.pdf`}
download
class="inline-flex items-center gap-3 py-4 px-8 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]"
>
<Download size={24} aria-hidden="true" />
<span>
Flyer herunterladen
<span class="block text-sm font-normal">
PDF{mitwirkung.flyerSize ? `, ${Math.round(mitwirkung.flyerSize / 1024)} KB` : ''}
</span>
</span>
</a>
<a
href={mitwirkung.flyerUrl}
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center gap-2 text-white underline underline-offset-4 hover:text-accent"
>
<FileText size={20} aria-hidden="true" />
Im Browser ansehen<span class="sr-only"> (öffnet in neuem Tab)</span>
</a>
</div>
)}
{mitwirkung?.director_name && (
<div class="mt-16 p-12 bg-white/10 rounded-lg text-center">
<h3 class="text-3xl text-white mb-4">Kontakt Regisseur:</h3>
<p><strong>{mitwirkung.director_name}</strong></p>
{mitwirkung.director_email && (
<p>
<span>E-Mail:</span>
<a href={`mailto:${mitwirkung.director_email}`} class="text-accent no-underline hover:underline">{mitwirkung.director_email}</a>
</p>
)}
{mitwirkung.director_phone && (
<p>
<span>Telefon:</span>
<a href={`tel:${mitwirkung.director_phone}`} class="text-accent no-underline hover:underline">{mitwirkung.director_phone}</a>
</p>
)}
</div>
)}
+42
View File
@@ -0,0 +1,42 @@
---
import { urlFor } from '../sanity/imageUrl';
interface Props {
organizations: any[];
}
const { organizations } = Astro.props;
---
{organizations && organizations.length > 0 && (
<div class="grid grid-cols-1 md:grid-cols-[repeat(auto-fit,minmax(250px,1fr))] gap-12 mt-16">
{organizations.map((org: any) => {
const cardContent = (
<Fragment>
{org.logo && (
<div class="mb-4 flex justify-center">
<img src={urlFor(org.logo)} alt={`${org.name} logo`} class="h-20 w-auto object-contain" />
</div>
)}
<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 ? (
<a
href={org.url}
target="_blank"
rel="noopener noreferrer"
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"
>
{cardContent}
</a>
) : (
<div class="bg-white/10 p-12 rounded-lg text-center transition-all duration-300 hover:-translate-y-1 hover:bg-white/15">
{cardContent}
</div>
);
})}
</div>
)}
+37
View File
@@ -0,0 +1,37 @@
---
import { MapPin } from '@lucide/astro';
interface Props {
events: any[];
}
const { events } = Astro.props;
---
{events && events.length > 0 && (
<div class="relative min-h-auto flex flex-col gap-16">
<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">
<path
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"
fill="none"
stroke="var(--color-accent)"
stroke-width="4"
stroke-dasharray="15,10"
opacity="0.7"
/>
</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'}`}>
<div class="hidden md:flex flex-col items-center in-w-30 max-w-60 md:min-w-auto md:self-start">
<MapPin class="text-accent" size={40} ></MapPin>
<div class="mt-6 text-lg font-bold text-accent text-center whitespace-nowrap md:text-base">{event.date}</div>
</div>
<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">
<div class="md:hidden text-lg font-bold text-accent text-center whitespace-nowrap md:text-base">{event.date}</div>
<h3 class="text-3xl mb-2 text-white md:text-2xl">{event.title}</h3>
<p class="event-desc m-0 text-white/90 leading-relaxed">{event.description}</p>
</div>
</div>
))}
</div>
)}
+23 -201
View File
@@ -3,11 +3,14 @@ import BaseLayout from '../layouts/BaseLayout.astro';
import AnchorNav from '../components/AnchorNav.astro'; import AnchorNav 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 Organizations from '../components/Organizations.astro';
import Committee from '../components/Committee.astro';
import MitwirkenExtras from '../components/MitwirkenExtras.astro';
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 { urlFor } from '../sanity/imageUrl';
import { theaterHomepageQuery } from '../sanity/queries'; import { theaterHomepageQuery } from '../sanity/queries';
import { MapPin, Download, FileText } from '@lucide/astro';
export const prerender = false export const prerender = false
@@ -15,229 +18,48 @@ const content: any = await fetchWithCache(theaterHomepageQuery) ?? {};
--- ---
<BaseLayout title={content.title || 'Freilichttheater Ziefen 2028'}> <BaseLayout title={content.title || 'Freilichttheater Ziefen 2028'}>
<!-- Anchor Navigation -->
<AnchorNav /> <AnchorNav />
<!-- Hero Section --> <Hero content={content} />
<div class="bg-[#2b2b56] text-white relative overflow-hidden">
<div class="max-w-6xl mx-auto px-4 pt-10 pb-14 md:px-12 md:pt-20 md:pb-22 flex flex-col items-center gap-6 md:gap-12">
<h1 class="w-full">
<picture>
<!-- Phones: rearranged logo, the way stays one continuous line drawn by the pen -->
<source media="(max-width: 39.99rem)" srcset="/logo-ftz2028-mobile.svg" width="1195" height="915" />
<img
src="/logo-ftz2028.svg"
width="1100"
height="334"
alt={content.hero?.title || 'Freilichttheater Ziefen 2028 – Wyti Wäg mit Breitestei'}
class="block w-full h-auto mx-auto max-sm:max-w-[24rem]"
/>
</picture>
</h1>
{content.hero?.subtitle && (
<p class="max-w-2xl text-center text-lg md:text-xl leading-relaxed opacity-90">
{content.hero.subtitle}
</p>
)}
</div>
</div>
<!-- Section 1: Das Projekt --> <TheaterSection id="projekt" title={content.projekt?.title || 'Das Projekt'} variant="light">
<TheaterSection
id="projekt"
title={content.projekt?.title || 'Das Projekt'}
variant="light"
>
<div class="prose-measure" set:html={renderPortableText(content.projekt?.content)} /> <div class="prose-measure" set:html={renderPortableText(content.projekt?.content)} />
</TheaterSection> </TheaterSection>
<!-- Section 2: Wer steckt dahinter --> <TheaterSection id="team" title={content.team?.title || 'Wer steckt dahinter'} variant="dark">
<TheaterSection
id="team"
title={content.team?.title || 'Wer steckt dahinter'}
variant="dark"
>
<div class="prose-measure" set:html={renderPortableText(content.team?.content)} /> <div class="prose-measure" set:html={renderPortableText(content.team?.content)} />
<Organizations organizations={content.team?.organizations || []} />
{content.team?.organizations && content.team.organizations.length > 0 && (
<div class="grid grid-cols-1 md:grid-cols-[repeat(auto-fit,minmax(250px,1fr))] gap-12 mt-16">
{content.team.organizations.map((org: any) => {
const cardContent = (
<Fragment>
{org.logo && (
<div class="mb-4 flex justify-center">
<img src={urlFor(org.logo)} alt={`${org.name} logo`} class="h-20 w-auto object-contain" />
</div>
)}
<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 ? (
<a
href={org.url}
target="_blank"
rel="noopener noreferrer"
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"
>
{cardContent}
</a>
) : (
<div class="bg-white/10 p-12 rounded-lg text-center transition-all duration-300 hover:-translate-y-1 hover:bg-white/15">
{cardContent}
</div>
);
})}
</div>
)}
{content.team?.committee?.members?.length > 0 && (
<div class="mt-20 text-center">
<h3 class="font-heading text-3xl md:text-4xl mb-4 text-white font-normal">
{content.team.committee.title || 'Organisationskomitee'}
</h3>
<p class="prose-measure opacity-90 mb-10">
{content.team.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.'}
</p>
<ul class="list-none p-0 m-0 flex flex-wrap justify-center gap-4">
{content.team.committee.members.map((member: any) => (
<li class="bg-white/10 rounded-lg px-6 py-4 min-w-[12rem]">
<span class="block text-xl text-white">{member.name}</span>
{member.role && <span class="block text-base opacity-80">{member.role}</span>}
</li>
))}
</ul>
</div>
)}
</TheaterSection> </TheaterSection>
<!-- Section 3: Das Stück --> {content.team?.committee?.members?.length > 0 && (
<TheaterSection <TheaterSection id="ok" title={content.team.committee.title || 'Organisationskomitee'} variant="light">
id="stueck" <Committee committee={content.team.committee} />
title={content.stueck?.title || 'Das Stück'} </TheaterSection>
variant="light" )}
>
<TheaterSection id="stueck" title={content.stueck?.title || 'Das Stück'} variant="light">
<div class="prose-measure" set:html={renderPortableText(content.stueck?.content)} /> <div class="prose-measure" set:html={renderPortableText(content.stueck?.content)} />
</TheaterSection> </TheaterSection>
<!-- Section 4: Mitwirken --> <TheaterSection id="mitwirkung" title={content.mitwirkung?.title || 'Mitwirken'} variant="dark">
<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} />
{content.mitwirkung?.flyerUrl && (
<div class="mt-12 flex flex-col sm:flex-row items-center justify-center gap-4 text-center">
<a
href={`${content.mitwirkung.flyerUrl}?dl=Flyer-Mitwirken-Freilichttheater-Ziefen-2028.pdf`}
download
class="inline-flex items-center gap-3 py-4 px-8 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]"
>
<Download size={24} aria-hidden="true" />
<span>
Flyer herunterladen
<span class="block text-sm font-normal">
PDF{content.mitwirkung.flyerSize ? `, ${Math.round(content.mitwirkung.flyerSize / 1024)} KB` : ''}
</span>
</span>
</a>
<a
href={content.mitwirkung.flyerUrl}
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center gap-2 text-white underline underline-offset-4 hover:text-accent"
>
<FileText size={20} aria-hidden="true" />
Im Browser ansehen<span class="sr-only"> (öffnet in neuem Tab)</span>
</a>
</div>
)}
{content.mitwirkung?.director_name && (
<div class="mt-16 p-12 bg-white/10 rounded-lg text-center">
<h3 class="text-3xl text-white mb-4">Kontakt Regisseur:</h3>
<p><strong>{content.mitwirkung.director_name}</strong></p>
{content.mitwirkung.director_email && (
<p>
<span>E-Mail:</span>
<a href={`mailto:${content.mitwirkung.director_email}`} class="text-accent no-underline hover:underline">{content.mitwirkung.director_email}</a>
</p>
)}
{content.mitwirkung.director_phone && (
<p>
<span>Telefon:</span>
<a href={`tel:${content.mitwirkung.director_phone}`} class="text-accent no-underline hover:underline">{content.mitwirkung.director_phone}</a>
</p>
)}
</div>
)}
</TheaterSection> </TheaterSection>
<!-- Section 5: Termine --> <TheaterSection id="termine" title={content.termine?.title || 'Termine'} variant="light">
<TheaterSection <Timeline events={content.termine?.events || []} />
id="termine"
title={content.termine?.title || 'Termine'}
variant="light"
>
{content.termine?.events && content.termine.events.length > 0 && (
<div class="relative min-h-auto flex flex-col gap-16">
<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">
<path
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"
fill="none"
stroke="var(--color-accent)"
stroke-width="4"
stroke-dasharray="15,10"
opacity="0.7"
/>
</svg>
{content.termine.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'}`}>
<div class="hidden md:flex flex-col items-center in-w-30 max-w-60 md:min-w-auto md:self-start">
<MapPin class="text-accent" size={40} ></MapPin>
<div class="mt-6 text-lg font-bold text-accent text-center whitespace-nowrap md:text-base">{event.date}</div>
</div>
<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">
<div class="md:hidden text-lg font-bold text-accent text-center whitespace-nowrap md:text-base">{event.date}</div>
<h3 class="text-3xl mb-2 text-white md:text-2xl">{event.title}</h3>
<p class="event-desc m-0 text-white/90 leading-relaxed">{event.description}</p>
</div>
</div>
))}
</div>
)}
</TheaterSection> </TheaterSection>
<!-- Section 6: Presse --> <TheaterSection id="presse" title={content.presse?.title || 'Presse'} variant="dark">
<TheaterSection
id="presse"
title={content.presse?.title || 'Presse'}
variant="dark"
>
<div class="prose-measure" set:html={renderPortableText(content.presse?.content)} /> <div class="prose-measure" set:html={renderPortableText(content.presse?.content)} />
</TheaterSection> </TheaterSection>
<!-- Section 7: Foto Galerie --> <TheaterSection id="gallery" title={content.gallery?.title || 'Foto Galerie'} variant="light">
<TheaterSection
id="gallery"
title={content.gallery?.title || 'Foto Galerie'}
variant="light"
>
<PhotoGallery images={content.gallery?.images || []} /> <PhotoGallery images={content.gallery?.images || []} />
</TheaterSection> </TheaterSection>
<!-- Section 8: Tickets --> <TheaterSection id="tickets" title={content.tickets?.title || 'Tickets'} variant="dark">
<TheaterSection
id="tickets"
title={content.tickets?.title || 'Tickets'}
variant="dark"
>
<div class="prose-measure" set:html={renderPortableText(content.tickets?.content)} /> <div class="prose-measure" set:html={renderPortableText(content.tickets?.content)} />
{content.tickets?.ticket_url && ( {content.tickets?.ticket_url && (
<div class="mt-[--spacing-lg] text-center"> <div class="mt-[--spacing-lg] 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">