import { useEffect, useRef } from 'react' import { motion } from 'framer-motion' import { useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' import gsap from 'gsap' import './Hero.css' function Hero() { const { t } = useTranslation() const imagesRef = useRef<(HTMLDivElement | null)[]>([]) useEffect(() => { imagesRef.current.forEach((img, index) => { if (img) { gsap.fromTo(img, { opacity: 0, scale: 0.5, rotation: index % 2 === 0 ? -180 : 180 }, { opacity: 1, scale: 1, rotation: 0, duration: 1.5, delay: 0.5 + index * 0.2, ease: 'elastic.out(1, 0.5)' } ) gsap.to(img, { y: index % 2 === 0 ? -15 : 15, duration: 2.5 + index * 0.5, repeat: -1, yoyo: true, ease: 'sine.inOut' }) } }) }, []) return (
{t('hero.tagline')}
{t('hero.taglineHighlight')}
{t('hero.subtitle')}
{t('hero.description')} {t('hero.disclaimer')} {t('hero.cta.upload')} {t('hero.cta.howItWorks')}
imagesRef.current[0] = el} whileHover={{ scale: 1.15, rotate: 5, zIndex: 10 }} transition={{ type: 'spring', stiffness: 300 }} > {t('hero.images.labReport')} imagesRef.current[1] = el} whileHover={{ scale: 1.15, rotate: -5, zIndex: 10 }} transition={{ type: 'spring', stiffness: 300 }} > {t('hero.images.dashboard')} imagesRef.current[2] = el} whileHover={{ scale: 1.15, rotate: 5, zIndex: 10 }} transition={{ type: 'spring', stiffness: 300 }} > {t('hero.images.smartwatch')} imagesRef.current[3] = el} whileHover={{ scale: 1.15, rotate: -5, zIndex: 10 }} transition={{ type: 'spring', stiffness: 300 }} > {t('hero.images.medicine')}
) } export default Hero