151 lines
8.7 KiB
TypeScript
151 lines
8.7 KiB
TypeScript
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
|
|
import { Badge } from '@/components/ui/badge';
|
|
import { Button } from '@/components/ui/button';
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
import { useLocalizedRoutes } from '@/hooks/useLocalizedRoutes';
|
|
import MarketingLayout from '@/layouts/mainWebsite';
|
|
import { Head, Link } from '@inertiajs/react';
|
|
import { CheckCircle2, Sparkles } from 'lucide-react';
|
|
import React from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
type DemoFeature = { title: string; description: string };
|
|
|
|
interface DemoPageProps {
|
|
demoToken?: string | null;
|
|
}
|
|
|
|
const DemoPage: React.FC<DemoPageProps> = ({ demoToken }) => {
|
|
const { t } = useTranslation('marketing');
|
|
const { localizedPath } = useLocalizedRoutes();
|
|
const embedUrl = demoToken ? `/e/${demoToken}` : '/e/demo?demo=1';
|
|
|
|
const demo = t('demo_page', { returnObjects: true }) as {
|
|
title: string;
|
|
subtitle: string;
|
|
primaryCta: string;
|
|
secondaryCta: string;
|
|
iframeNote: string;
|
|
openFull: string;
|
|
features: DemoFeature[];
|
|
};
|
|
|
|
return (
|
|
<MarketingLayout title={demo.title}>
|
|
<Head title={demo.title} />
|
|
|
|
<section className="relative overflow-hidden bg-gradient-to-br from-pink-100 via-white to-white px-4 py-16 dark:from-pink-950/40 dark:via-gray-950 dark:to-gray-950">
|
|
<div className="absolute -top-32 right-20 hidden h-72 w-72 rounded-full bg-pink-200/50 blur-3xl lg:block dark:bg-pink-900/30" />
|
|
<div className="relative z-10 container mx-auto flex max-w-5xl flex-col gap-10 lg:flex-row lg:items-center">
|
|
<div className="flex-1 space-y-6">
|
|
<Badge variant="outline" className="border-pink-400 text-pink-600 dark:border-pink-500 dark:text-pink-300">
|
|
Demo Live
|
|
</Badge>
|
|
<h1 className="text-4xl font-bold tracking-tight text-gray-900 md:text-5xl dark:text-gray-50">{demo.title}</h1>
|
|
<p className="max-w-xl text-lg text-gray-600 dark:text-gray-300">{demo.subtitle}</p>
|
|
<div className="flex flex-wrap items-center gap-3">
|
|
<Button asChild size="lg" className="bg-pink-500 hover:bg-pink-600">
|
|
<Link href={localizedPath('/packages')}>{demo.primaryCta}</Link>
|
|
</Button>
|
|
<Button asChild size="lg" variant="ghost" className="text-pink-600 hover:text-pink-700 dark:text-pink-300">
|
|
<Link href={localizedPath('/so-funktionierts')}>{demo.secondaryCta}</Link>
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
<div className="flex-1">
|
|
{embedUrl ? (
|
|
<>
|
|
<div className="relative mx-auto w-full max-w-[320px] rounded-[2.5rem] border border-gray-200 bg-gray-900 p-4 shadow-2xl md:max-w-[360px] dark:border-gray-700">
|
|
<div
|
|
className="absolute top-2 left-1/2 h-1.5 w-16 -translate-x-1/2 rounded-full bg-gray-300 dark:bg-gray-600"
|
|
aria-hidden
|
|
/>
|
|
<iframe
|
|
title="Fotospiel App Demo"
|
|
src={embedUrl}
|
|
className="aspect-[9/16] w-full rounded-[1.75rem] border-0 bg-white shadow-inner dark:bg-gray-950"
|
|
loading="lazy"
|
|
sandbox="allow-scripts allow-same-origin allow-forms"
|
|
/>
|
|
</div>
|
|
<div className="mt-4 flex flex-col items-center gap-1 text-center">
|
|
<p className="text-sm text-gray-600 dark:text-gray-300">{demo.iframeNote}</p>
|
|
<Button asChild variant="link" className="text-pink-600 hover:text-pink-700 dark:text-pink-300">
|
|
<Link href={embedUrl} target="_blank" rel="noopener">
|
|
{demo.openFull}
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
</>
|
|
) : (
|
|
<Alert className="border-pink-200 bg-white shadow-lg dark:border-pink-900/50 dark:bg-gray-950">
|
|
<AlertTitle className="text-gray-900 dark:text-gray-100">
|
|
{t('labels.demoUnavailable', 'Demo-Link aktuell nicht verfügbar')}
|
|
</AlertTitle>
|
|
<AlertDescription className="mt-2 text-sm text-gray-600 dark:text-gray-300">
|
|
{t(
|
|
'labels.demoUnavailableCopy',
|
|
'Führe die Demo-Seeds aus oder kontaktiere uns, damit wir dir sofort einen neuen Zugangscode hinterlegen können.',
|
|
)}
|
|
</AlertDescription>
|
|
<div className="mt-4 flex flex-wrap gap-3">
|
|
<Button asChild size="sm" className="bg-pink-500 hover:bg-pink-600">
|
|
<Link href={localizedPath('/packages')}>{demo.primaryCta}</Link>
|
|
</Button>
|
|
<Button
|
|
asChild
|
|
size="sm"
|
|
variant="outline"
|
|
className="text-pink-600 hover:text-pink-700 dark:border-pink-900/40 dark:text-pink-300"
|
|
>
|
|
<Link href={localizedPath('/kontakt')}>{t('nav.contact', 'Kontakt')}</Link>
|
|
</Button>
|
|
</div>
|
|
</Alert>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section className="container mx-auto px-4 pb-16">
|
|
<div className="mx-auto max-w-5xl">
|
|
<div className="grid gap-6 md:grid-cols-3">
|
|
{demo.features.map((feature) => (
|
|
<Card key={feature.title} className="border-gray-100 shadow-sm dark:border-gray-800">
|
|
<CardHeader>
|
|
<CardTitle className="flex items-center gap-2 text-lg">
|
|
<Sparkles className="h-5 w-5 text-pink-500" aria-hidden />
|
|
{feature.title}
|
|
</CardTitle>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<CardDescription className="text-sm text-gray-600 dark:text-gray-300">{feature.description}</CardDescription>
|
|
</CardContent>
|
|
</Card>
|
|
))}
|
|
</div>
|
|
|
|
<Alert className="mt-10 border-pink-200 bg-white shadow-lg dark:border-pink-900/50 dark:bg-gray-950">
|
|
<AlertTitle className="flex items-center gap-2 text-gray-900 dark:text-gray-100">
|
|
<CheckCircle2 className="h-5 w-5 text-pink-500" aria-hidden />
|
|
{t('marketing.labels.readyToLaunch', 'Bereit für dein Event?')}
|
|
</AlertTitle>
|
|
<AlertDescription className="mt-3 flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
|
|
<span className="text-sm text-gray-600 dark:text-gray-300">
|
|
{t('marketing.labels.readyToLaunchCopy', 'Registriere dich kostenlos und lege noch heute dein erstes Event an.')}
|
|
</span>
|
|
<Button asChild className="bg-pink-500 hover:bg-pink-600">
|
|
<Link href={localizedPath('/register')}>{demo.primaryCta}</Link>
|
|
</Button>
|
|
</AlertDescription>
|
|
</Alert>
|
|
</div>
|
|
</section>
|
|
</MarketingLayout>
|
|
);
|
|
};
|
|
|
|
DemoPage.layout = (page: React.ReactNode) => page;
|
|
|
|
export default DemoPage;
|