Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 12s
Build & Deploy / 🧪 QA (push) Successful in 4m40s
Build & Deploy / 🏗️ Build (push) Failing after 31s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Smoke Test (push) Has been skipped
Build & Deploy / ⚡ Lighthouse (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
100 lines
4.4 KiB
TypeScript
100 lines
4.4 KiB
TypeScript
'use client';
|
|
|
|
import Scribble from '@/components/Scribble';
|
|
import { Button, Container, Heading, Section } from '@/components/ui';
|
|
import { useTranslations, useLocale } from 'next-intl';
|
|
import dynamic from 'next/dynamic';
|
|
import { useAnalytics } from '../analytics/useAnalytics';
|
|
import { AnalyticsEvents } from '../analytics/analytics-events';
|
|
const HeroIllustration = dynamic(() => import('./HeroIllustration'), { ssr: false });
|
|
|
|
export default function Hero() {
|
|
const t = useTranslations('Home.hero');
|
|
const locale = useLocale();
|
|
const { trackEvent } = useAnalytics();
|
|
|
|
return (
|
|
<Section className="relative min-h-[85vh] md:h-[90vh] flex flex-col items-center justify-center overflow-hidden bg-primary py-12 md:py-0 lg:py-0">
|
|
<Container className="relative z-10 text-center md:text-left text-white w-full order-2 md:order-none">
|
|
<div className="max-w-5xl mx-auto md:mx-0">
|
|
<div>
|
|
<Heading
|
|
level={1}
|
|
className="text-center md:text-left mb-6 md:mb-8 md:max-w-none text-white text-4xl sm:text-5xl md:text-7xl font-extrabold [text-shadow:_-2px_-2px_0_#002b49,_2px_-2px_0_#002b49,_-2px_2px_0_#002b49,_2px_2px_0_#002b49,_-2px_0_0_#002b49,_2px_0_0_#002b49,_0_-2px_0_#002b49,_0_2px_0_#002b49]"
|
|
>
|
|
{t.rich('title', {
|
|
green: (chunks) => (
|
|
<span className="relative inline-block">
|
|
<span className="relative z-10 text-accent italic inline-block">{chunks}</span>
|
|
<div
|
|
className="w-[140%] h-[140%] -top-[20%] -left-[20%] text-accent/30 hidden md:block absolute -z-10 animate-in fade-in zoom-in-0 duration-1000 ease-out fill-mode-both"
|
|
style={{ animationDelay: '500ms' }}
|
|
>
|
|
<Scribble variant="circle" />
|
|
</div>
|
|
</span>
|
|
),
|
|
})}
|
|
</Heading>
|
|
</div>
|
|
<div>
|
|
<p className="text-lg md:text-xl text-white leading-relaxed max-w-2xl mb-10 md:mb-12">
|
|
{t('subtitle')}
|
|
</p>
|
|
</div>
|
|
<div className="flex flex-col sm:flex-row justify-center md:justify-start gap-4 md:gap-6">
|
|
<div>
|
|
<Button
|
|
href="/contact"
|
|
variant="accent"
|
|
size="lg"
|
|
className="group w-full sm:w-auto h-14 md:h-16 px-8 md:px-10 text-base md:text-lg hover:scale-105 transition-transform"
|
|
onClick={() =>
|
|
trackEvent(AnalyticsEvents.BUTTON_CLICK, {
|
|
label: t('cta'),
|
|
location: 'home_hero_primary',
|
|
})
|
|
}
|
|
>
|
|
{t('cta')}
|
|
<span className="transition-transform group-hover/btn:translate-x-1 ml-2">
|
|
→
|
|
</span>
|
|
</Button>
|
|
</div>
|
|
<div>
|
|
<Button
|
|
href={`/${locale}/${locale === 'de' ? 'produkte' : 'products'}`}
|
|
variant="white"
|
|
size="lg"
|
|
className="group w-full sm:w-auto h-14 md:h-16 px-8 md:px-10 text-base md:text-lg md:bg-white md:text-primary md:hover:bg-neutral-light md:border-none hover:scale-105 transition-transform"
|
|
onClick={() =>
|
|
trackEvent(AnalyticsEvents.BUTTON_CLICK, {
|
|
label: t('exploreProducts'),
|
|
location: 'home_hero_secondary',
|
|
})
|
|
}
|
|
>
|
|
{t('exploreProducts')}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Container>
|
|
|
|
<div className="relative md:absolute inset-0 z-0 w-full h-[40vh] md:h-full order-1 md:order-none mb-[-80px] md:mb-0 mt-[80px] md:mt-0 overflow-visible pointer-events-none animate-in fade-in zoom-in-95 duration-1000 ease-out fill-mode-both">
|
|
<HeroIllustration />
|
|
</div>
|
|
|
|
<div
|
|
className="absolute bottom-6 md:bottom-10 left-1/2 -translate-x-1/2 hidden sm:block animate-in fade-in slide-in-from-bottom-4 duration-1000 ease-out fill-mode-both"
|
|
style={{ animationDelay: '2000ms' }}
|
|
>
|
|
<div className="w-6 h-10 border-2 border-white/30 rounded-full flex justify-center p-1">
|
|
<div className="w-1 h-2 bg-white rounded-full animate-bounce" />
|
|
</div>
|
|
</div>
|
|
</Section>
|
|
);
|
|
}
|