feat(i18n): Complete localization of marketing frontend with react-i18next, prefixed URLs, JSON migrations, and automation
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
import React from 'react';
|
||||
import { Head, Link, useForm } from '@inertiajs/react';
|
||||
import { Head, Link, useForm, usePage } from '@inertiajs/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import MarketingLayout from '@/layouts/marketing/MarketingLayout';
|
||||
import { Package } from '@/types'; // Annahme: Typ für Package
|
||||
|
||||
interface Package {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
price: number;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
packages: Package[];
|
||||
}
|
||||
|
||||
const Home: React.FC<Props> = ({ packages }) => {
|
||||
const { t } = useTranslation('marketing');
|
||||
const { data, setData, post, processing, errors, reset } = useForm({
|
||||
name: '',
|
||||
email: '',
|
||||
@@ -21,237 +29,203 @@ const Home: React.FC<Props> = ({ packages }) => {
|
||||
});
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
if (Object.keys(errors).length > 0) {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
}
|
||||
}, [errors]);
|
||||
|
||||
return (
|
||||
<MarketingLayout title="Home - Fotospiel">
|
||||
<Head title="Fotospiel - Event-Fotos einfach und sicher mit QR-Codes" />
|
||||
<MarketingLayout title={t('home.title')}>
|
||||
<Head title={t('home.hero_title')} />
|
||||
|
||||
{/* Hero Section */}
|
||||
<section id="hero" className="bg-aurora-enhanced text-white py-20 px-4">
|
||||
<section id="hero" className="bg-aurora-enhanced text-gray-900 dark:text-gray-100 py-20 px-4">
|
||||
<div className="container mx-auto flex flex-col md:flex-row items-center gap-8 max-w-6xl">
|
||||
<div className="md:w-1/2 text-center md:text-left">
|
||||
<h1 className="text-4xl md:text-6xl font-bold mb-4 font-display">Fotospiel</h1>
|
||||
<p className="text-xl md:text-2xl mb-8 font-sans-marketing">Sammle Gastfotos für Events mit QR-Codes. Unsere sichere PWA-Plattform für Gäste und Organisatoren – einfach, mobil und datenschutzkonform. Besser als Konkurrenz, geliebt von Tausenden.</p>
|
||||
<Link href="/packages" className="bg-white text-[#FFB6C1] px-8 py-4 rounded-full font-semibold text-lg hover:bg-gray-100 transition font-sans-marketing">
|
||||
Jetzt starten – Kostenlos
|
||||
<h1 className="text-4xl md:text-6xl font-bold mb-4 font-display">{t('home.hero_title')}</h1>
|
||||
<p className="text-xl md:text-2xl mb-8 font-sans-marketing">{t('home.hero_description')}</p>
|
||||
<Link
|
||||
href="/packages"
|
||||
className="bg-white dark:bg-gray-800 text-[#FFB6C1] px-8 py-4 rounded-full font-bold hover:bg-gray-100 dark:hover:bg-gray-700 transition duration-300 inline-block"
|
||||
>
|
||||
{t('home.cta_explore')}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="md:w-1/2">
|
||||
<img
|
||||
src="https://images.unsplash.com/photo-1511285560929-80b456fea0bc?w=600&h=400&fit=crop"
|
||||
alt="Event-Fotos mit QR"
|
||||
className="rounded-lg shadow-lg w-full"
|
||||
style={{ filter: 'drop-shadow(0 10px 8px rgba(0,0,0,0.1))' }}
|
||||
src="/images/hero-image.jpg"
|
||||
alt={t('home.hero_image_alt')}
|
||||
className="w-full h-auto rounded-lg shadow-lg"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* How it works Section */}
|
||||
<section id="how-it-works" className="py-20 px-4 bg-gray-50">
|
||||
<div className="container mx-auto">
|
||||
<h2 className="text-3xl font-bold text-center mb-12 font-display">So funktioniert es – in 4 einfachen Schritten mit QR-Codes</h2>
|
||||
<div className="grid md:grid-cols-4 gap-8">
|
||||
{/* How it Works Section */}
|
||||
<section className="py-20 px-4 bg-gray-50 dark:bg-gray-900">
|
||||
<div className="container mx-auto max-w-6xl">
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center mb-12 font-display">{t('home.how_title')}</h2>
|
||||
<div className="grid md:grid-cols-3 gap-8">
|
||||
<div className="text-center">
|
||||
<img
|
||||
src="https://images.unsplash.com/photo-1558618047-3c8d6b4d3b0a?w=300&h=200&fit=crop"
|
||||
alt="QR-Code generieren"
|
||||
className="w-12 h-12 mx-auto mb-4 rounded-full"
|
||||
/>
|
||||
<h3 className="font-semibold mb-2 font-sans-marketing">Event erstellen & QR generieren</h3>
|
||||
<p className="text-gray-600 font-serif-custom">Als Organisator: Registrieren, Event anlegen, QR-Code erstellen und drucken/teilen.</p>
|
||||
<div className="w-16 h-16 bg-[#FFB6C1] rounded-full flex items-center justify-center mx-auto mb-4">
|
||||
<span className="text-2xl">1</span>
|
||||
</div>
|
||||
<h3 className="text-xl font-semibold mb-2">{t('home.step1_title')}</h3>
|
||||
<p>{t('home.step1_desc')}</p>
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<img
|
||||
src="https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?w=300&h=200&fit=crop"
|
||||
alt="Fotos hochladen"
|
||||
className="w-12 h-12 mx-auto mb-4 rounded-full"
|
||||
/>
|
||||
<h3 className="font-semibold mb-2 font-sans-marketing">Fotos hochladen via QR</h3>
|
||||
<p className="text-gray-600 font-serif-custom">Gäste: QR scannen, PWA öffnen, Fotos via Kamera oder Galerie teilen.</p>
|
||||
<div className="w-16 h-16 bg-[#FFB6C1] rounded-full flex items-center justify-center mx-auto mb-4">
|
||||
<span className="text-2xl">2</span>
|
||||
</div>
|
||||
<h3 className="text-xl font-semibold mb-2">{t('home.step2_title')}</h3>
|
||||
<p>{t('home.step2_desc')}</p>
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<img
|
||||
src="https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=300&h=200&fit=crop"
|
||||
alt="Freigaben & Likes"
|
||||
className="w-12 h-12 mx-auto mb-4 rounded-full"
|
||||
/>
|
||||
<h3 className="font-semibold mb-2 font-sans-marketing">Freigaben & Likes</h3>
|
||||
<p className="text-gray-600 font-serif-custom">Emotions auswählen, Fotos liken, Galerie browsen – alles anonym.</p>
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<img
|
||||
src="https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?w=300&h=200&fit=crop"
|
||||
alt="Download & Teilen"
|
||||
className="w-12 h-12 mx-auto mb-4 rounded-full"
|
||||
/>
|
||||
<h3 className="font-semibold mb-2 font-sans-marketing">Download & Teilen</h3>
|
||||
<p className="text-gray-600 font-serif-custom">Freigegebene Fotos herunterladen, Event abschließen und QR archivieren.</p>
|
||||
<div className="w-16 h-16 bg-[#FFB6C1] rounded-full flex items-center justify-center mx-auto mb-4">
|
||||
<span className="text-2xl">3</span>
|
||||
</div>
|
||||
<h3 className="text-xl font-semibold mb-2">{t('home.step3_title')}</h3>
|
||||
<p>{t('home.step3_desc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Features Section */}
|
||||
<section id="features" className="py-20 px-4 bg-white">
|
||||
<div className="container mx-auto">
|
||||
<h2 className="text-3xl font-bold text-center mb-12 font-display">Warum Fotospiel mit QR?</h2>
|
||||
<div className="grid md:grid-cols-3 gap-8">
|
||||
<div className="text-center p-6">
|
||||
<img
|
||||
src="https://images.unsplash.com/photo-1560472354-b33ff0c44a43?w=400&h=250&fit=crop"
|
||||
alt="Sichere QR-Uploads"
|
||||
className="w-16 h-16 mx-auto mb-4 rounded-full"
|
||||
/>
|
||||
<h3 className="text-xl font-semibold mb-2 font-display">Sichere QR-Uploads</h3>
|
||||
<p className="text-gray-600 font-serif-custom">GDPR-konform, anonyme Sessions, QR-basierte Zugriffe ohne PII-Speicherung.</p>
|
||||
<section className="py-20 px-4 dark:bg-gray-700">
|
||||
<div className="container mx-auto max-w-6xl">
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center mb-12 font-display">{t('home.features_title')}</h2>
|
||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
<div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md">
|
||||
<h3 className="text-xl font-semibold mb-2">{t('home.feature1_title')}</h3>
|
||||
<p>{t('home.feature1_desc')}</p>
|
||||
</div>
|
||||
<div className="text-center p-6">
|
||||
<img
|
||||
src="https://images.unsplash.com/photo-1517336714731-489689fd1ca8?w=400&h=250&fit=crop"
|
||||
alt="Mobile PWA & QR"
|
||||
className="w-16 h-16 mx-auto mb-4 rounded-full"
|
||||
/>
|
||||
<h3 className="text-xl font-semibold mb-2 font-display">Mobile PWA & QR</h3>
|
||||
<p className="text-gray-600 font-serif-custom">Offline-fähig, App-ähnlich für iOS/Android, QR-Scan für schnellen Einstieg.</p>
|
||||
<div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md">
|
||||
<h3 className="text-xl font-semibold mb-2">{t('home.feature2_title')}</h3>
|
||||
<p>{t('home.feature2_desc')}</p>
|
||||
</div>
|
||||
<div className="text-center p-6">
|
||||
<img
|
||||
src="https://images.unsplash.com/photo-1554224155-6726b3ff858f?w=400&h=250&fit=crop"
|
||||
alt="Schnell & Einfach"
|
||||
className="w-16 h-16 mx-auto mb-4 rounded-full"
|
||||
/>
|
||||
<h3 className="text-xl font-semibold mb-2 font-display">Schnell & Einfach mit QR</h3>
|
||||
<p className="text-gray-600 font-serif-custom">Automatische Thumbnails, Echtzeit-Updates, QR-Sharing für Gäste.</p>
|
||||
<div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md">
|
||||
<h3 className="text-xl font-semibold mb-2">{t('home.feature3_title')}</h3>
|
||||
<p>{t('home.feature3_desc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Packages Teaser Section */}
|
||||
<section id="pricing" className="py-20 px-4 bg-gray-50">
|
||||
<div className="container mx-auto">
|
||||
<h2 className="text-3xl font-bold text-center mb-12 font-display">Unsere Packages</h2>
|
||||
<p className="text-center text-lg text-gray-600 mb-8 font-sans-marketing">Wählen Sie das passende Paket für Ihr Event – von kostenlos bis premium.</p>
|
||||
{/* Packages Teaser */}
|
||||
<section className="py-20 px-4 bg-gray-50 dark:bg-gray-900">
|
||||
<div className="container mx-auto max-w-6xl">
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center mb-12 font-display">{t('home.packages_title')}</h2>
|
||||
<div className="grid md:grid-cols-2 gap-8 mb-8">
|
||||
{packages.slice(0, 2).map((pkg) => (
|
||||
<div key={pkg.id} className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md text-center">
|
||||
<h3 className="text-2xl font-bold mb-2">{pkg.name}</h3>
|
||||
<p className="text-gray-600 dark:text-gray-300 mb-4">{pkg.description}</p>
|
||||
<p className="text-3xl font-bold text-[#FFB6C1]">{pkg.price} {t('home.currency.euro')}</p>
|
||||
<Link href={`/packages/${pkg.id}`} className="mt-4 inline-block bg-[#FFB6C1] text-white px-6 py-2 rounded-full hover:bg-pink-600">
|
||||
{t('home.view_details')}
|
||||
</Link>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<Link href="/packages" className="bg-[#FFB6C1] text-white px-8 py-4 rounded-full font-semibold text-lg hover:bg-[#FF69B4] transition font-sans-marketing">
|
||||
Alle Packages ansehen
|
||||
<Link href="/packages" className="bg-[#FFB6C1] text-white px-8 py-4 rounded-full font-bold hover:bg-pink-600 transition">
|
||||
{t('home.all_packages')}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Contact Section */}
|
||||
<section id="contact" className="py-20 px-4 bg-white">
|
||||
<div className="container mx-auto max-w-2xl">
|
||||
<h2 className="text-3xl font-bold text-center mb-12 font-display">Kontakt</h2>
|
||||
<form key={`home-form-${Object.keys(errors).length}`} onSubmit={handleSubmit} className="space-y-4">
|
||||
<section id="contact" className="py-20 px-4 dark:bg-gray-700">
|
||||
<div className="container mx-auto max-w-4xl">
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center mb-12 font-display">{t('home.contact_title')}</h2>
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<div>
|
||||
<label htmlFor="name" className="block text-sm font-medium mb-2 font-sans-marketing">Name</label>
|
||||
<label htmlFor="name" className="block text-sm font-medium mb-2">
|
||||
{t('home.name_label')}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="name"
|
||||
value={data.name}
|
||||
onChange={(e) => setData('name', e.target.value)}
|
||||
required
|
||||
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-[#FFB6C1]"
|
||||
className="w-full p-3 border rounded-lg"
|
||||
/>
|
||||
{errors.name && <p key={`error-name`} className="text-red-500 text-sm mt-1 font-serif-custom">{errors.name}</p>}
|
||||
{errors.name && <p className="text-red-500 text-sm">{errors.name}</p>}
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="email" className="block text-sm font-medium mb-2 font-sans-marketing">E-Mail</label>
|
||||
<label htmlFor="email" className="block text-sm font-medium mb-2">
|
||||
{t('home.email_label')}
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
id="email"
|
||||
value={data.email}
|
||||
onChange={(e) => setData('email', e.target.value)}
|
||||
required
|
||||
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-[#FFB6C1]"
|
||||
className="w-full p-3 border rounded-lg"
|
||||
/>
|
||||
{errors.email && <p key={`error-email`} className="text-red-500 text-sm mt-1 font-serif-custom">{errors.email}</p>}
|
||||
{errors.email && <p className="text-red-500 text-sm">{errors.email}</p>}
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="message" className="block text-sm font-medium mb-2 font-sans-marketing">Nachricht</label>
|
||||
<label htmlFor="message" className="block text-sm font-medium mb-2">
|
||||
{t('home.message_label')}
|
||||
</label>
|
||||
<textarea
|
||||
id="message"
|
||||
rows={4}
|
||||
value={data.message}
|
||||
onChange={(e) => setData('message', e.target.value)}
|
||||
rows={4}
|
||||
required
|
||||
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-[#FFB6C1]"
|
||||
></textarea>
|
||||
{errors.message && <p key={`error-message`} className="text-red-500 text-sm mt-1 font-serif-custom">{errors.message}</p>}
|
||||
className="w-full p-3 border rounded-lg"
|
||||
/>
|
||||
{errors.message && <p className="text-red-500 text-sm">{errors.message}</p>}
|
||||
</div>
|
||||
<button type="submit" disabled={processing} className="w-full bg-[#FFB6C1] text-white py-3 rounded-md font-semibold hover:bg-[#FF69B4] transition disabled:opacity-50 font-sans-marketing">
|
||||
{processing ? 'Sendet...' : 'Senden'}
|
||||
<button
|
||||
type="submit"
|
||||
disabled={processing}
|
||||
className="bg-[#FFB6C1] text-white px-8 py-3 rounded-full font-bold hover:bg-pink-600 transition disabled:opacity-50"
|
||||
>
|
||||
{processing ? t('home.sending') : t('home.send')}
|
||||
</button>
|
||||
</form>
|
||||
{Object.keys(errors).length === 0 && data.message && !processing && (
|
||||
<p className="mt-4 text-green-600 text-center font-serif-custom">Nachricht gesendet!</p>
|
||||
)}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (Object.keys(errors).length > 0) {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
}
|
||||
}, [errors]);
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Testimonials Section */}
|
||||
<section className="py-20 px-4 bg-gray-50">
|
||||
<div className="container mx-auto">
|
||||
<h2 className="text-3xl font-bold text-center mb-12 font-display">Was unsere Kunden sagen</h2>
|
||||
<div className="grid md:grid-cols-2 gap-8 max-w-4xl mx-auto">
|
||||
<div className="bg-white p-6 rounded-lg">
|
||||
<p className="mb-4 font-serif-custom">"Perfekt für unsere Hochzeit! QR-Sharing war super einfach."</p>
|
||||
<p className="font-semibold font-sans-marketing">- Anna & Max</p>
|
||||
<section className="py-20 px-4 bg-gray-50 dark:bg-gray-900">
|
||||
<div className="container mx-auto max-w-6xl">
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center mb-12 font-display">{t('home.testimonials_title')}</h2>
|
||||
<div className="grid md:grid-cols-3 gap-8">
|
||||
<div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md">
|
||||
<p className="italic mb-4">"{t('home.testimonial1')}"</p>
|
||||
<p className="font-semibold">- Anna M.</p>
|
||||
</div>
|
||||
<div className="bg-white p-6 rounded-lg">
|
||||
<p className="mb-4 font-serif-custom">"Großes Firmenevent – alle Fotos zentral via QR."</p>
|
||||
<p className="font-semibold font-sans-marketing">- Team XYZ GmbH</p>
|
||||
<div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md">
|
||||
<p className="italic mb-4">"{t('home.testimonial2')}"</p>
|
||||
<p className="font-semibold">- Max S.</p>
|
||||
</div>
|
||||
<div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md">
|
||||
<p className="italic mb-4">"{t('home.testimonial3')}"</p>
|
||||
<p className="font-semibold">- Lisa K.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* FAQ Section */}
|
||||
<section className="py-20 px-4 bg-white">
|
||||
<div className="container mx-auto max-w-3xl">
|
||||
<h2 className="text-3xl font-bold text-center mb-12 font-display">Häufige Fragen</h2>
|
||||
<div className="space-y-4">
|
||||
<div className="bg-gray-50 p-4 rounded-lg">
|
||||
<h3 className="font-semibold font-display">Ist es kostenlos?</h3>
|
||||
<p className="font-serif-custom">Ja, der Basic-Tarif ist kostenlos für 1 Event mit QR. Upgrades ab 99€.</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 p-4 rounded-lg">
|
||||
<h3 className="font-semibold font-display">Datenschutz?</h3>
|
||||
<p className="font-serif-custom">100% GDPR-konform. Keine personenbezogenen Daten gespeichert. QR-Zugriffe anonym. Siehe <Link href="/datenschutz" className="text-[#FFB6C1]">Datenschutzerklärung</Link>.</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 p-4 rounded-lg">
|
||||
<h3 className="font-semibold font-display">Wie funktioniert QR-Sharing?</h3>
|
||||
<p className="font-serif-custom">Generiere QR im Dashboard, teile es – Gäste scannen, laden Fotos hoch in der PWA.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Packages Section (aus aktuellem TSX, angepasst) */}
|
||||
<section className="py-20 px-4 bg-white">
|
||||
<section className="py-20 px-4 dark:bg-gray-700">
|
||||
<div className="container mx-auto max-w-4xl">
|
||||
<h2 className="text-3xl font-bold text-center mb-12 font-display">Unsere Pakete</h2>
|
||||
<div className="grid md:grid-cols-3 gap-8">
|
||||
{packages.map((pkg) => (
|
||||
<div key={pkg.id} className="bg-gray-50 p-6 rounded-lg text-center">
|
||||
<h3 className="text-xl font-semibold mb-2 font-sans-marketing">{pkg.name}</h3>
|
||||
<p className="text-gray-600 mb-4 font-serif-custom">{pkg.description}</p>
|
||||
<p className="text-2xl font-bold text-[#FFB6C1] mb-4 font-display">€{pkg.price}</p>
|
||||
<Link
|
||||
href={`/marketing/buy/${pkg.id}`}
|
||||
className="bg-[#FFB6C1] text-white px-6 py-2 rounded-full font-semibold hover:bg-[#FF69B4] transition font-sans-marketing"
|
||||
>
|
||||
Kaufen
|
||||
</Link>
|
||||
</div>
|
||||
))}
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-center mb-12 font-display">{t('home.faq_title')}</h2>
|
||||
<div className="space-y-4">
|
||||
<div className="bg-gray-50 dark:bg-gray-800 p-4 rounded-lg">
|
||||
<h3 className="font-semibold">{t('home.faq1_q')}</h3>
|
||||
<p>{t('home.faq1_a')}</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 dark:bg-gray-800 p-4 rounded-lg">
|
||||
<h3 className="font-semibold">{t('home.faq2_q')}</h3>
|
||||
<p>{t('home.faq2_a')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user