Files
lambada-fiesta-live/src/components/HeroSection.tsx
T
Antoni Nuñez Romeu 1d63506722
CI/CD Deploy / test (push) Successful in 1m7s
CI/CD Deploy / build-push (push) Successful in 1m36s
CI/CD Deploy / deploy (push) Successful in 24s
Event finished
2026-09-09 08:00:49 +02:00

85 lines
3.0 KiB
TypeScript

import { motion } from "framer-motion";
import { useTranslation } from "react-i18next";
import heroBg from "@/assets/hero-bg.jpg";
/** Calcula diferencia entre ahora y la fecha del evento */
export const getTimeLeft = (target: string) => {
const diff = new Date(target).getTime() - Date.now();
if (diff <= 0) return { days: 0, hours: 0, minutes: 0, seconds: 0 };
return {
days: Math.floor(diff / (1000 * 60 * 60 * 24)),
hours: Math.floor((diff / (1000 * 60 * 60)) % 24),
minutes: Math.floor((diff / (1000 * 60)) % 60),
seconds: Math.floor((diff / 1000) % 60),
};
};
const HeroSection = () => {
const { t } = useTranslation();
return (
<section
className="relative min-h-[calc(100vh+50px)] flex items-center justify-center overflow-hidden z-20 pb-[50px]"
style={{ clipPath: "polygon(0 0, 100% 0, 100% calc(100% - 50px), 50% 100%, 0 calc(100% - 50px))" }}
>
{/* Background image */}
<div
className="absolute inset-0 bg-cover bg-center"
style={{ backgroundImage: `url(${heroBg})` }}
/>
{/* Overlay */}
<div className="absolute inset-0 bg-gradient-to-b from-foreground/70 via-foreground/50 to-foreground/80" />
<div className="relative z-10 text-center px-4 max-w-4xl mx-auto">
<motion.p
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.2 }}
className="text-primary font-body text-sm uppercase tracking-[0.3em] mb-4"
>
{t('hero.dates')} · {t('hero.location')}
</motion.p>
<motion.h1
initial={{ opacity: 0, y: 30 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.4 }}
className="font-hero text-4xl md:text-7xl lg:text-8xl font-bold text-primary-foreground mb-4 leading-tight"
>
{t('hero.title')}
</motion.h1>
<motion.p
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.6 }}
className="text-primary-foreground/80 font-body text-lg md:text-xl mb-10"
>
{t('hero.subtitle')}
</motion.p>
{/* Event finished banner — countdown and program links disabled */}
<motion.div
initial={{ opacity: 0, scale: 0.9 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ delay: 0.8 }}
className="flex justify-center mb-10"
>
<div className="text-center">
<div className="bg-primary-foreground/10 backdrop-blur-sm border border-primary-foreground/20 rounded-lg px-6 py-4 min-w-[180px]">
<span className="block text-2xl md:text-4xl font-hero font-bold text-primary-foreground">
{t('hero.eventFinished')}
</span>
<span className="block mt-2 text-base md:text-lg font-body text-primary-foreground/90">
{t('hero.thankYou')}
</span>
</div>
</div>
</motion.div>
</div>
</section>
);
};
export default HeroSection;