import ResourceExchangeVisualization from '@/components/landing/ResourceExchangeVisualization.tsx'; import Badge from '@/components/ui/Badge.tsx'; import Button from '@/components/ui/Button.tsx'; import { Container, Grid } from '@/components/ui/layout'; import { useTranslation } from '@/hooks/useI18n.tsx'; import { motion } from 'framer-motion'; import React, { useMemo } from 'react'; // Generate random values once at module level to avoid calling Math.random during render const PARTICLE_RANDOM_VALUES = Array.from({ length: 80 }, () => Math.random()); interface HeroProps { onNavigateToMap: () => void; onAddOrganizationClick: () => void; addOrgButtonRef: React.Ref; } const Particles = React.memo(() => { const particles = useMemo(() => { return Array.from({ length: 20 }, (_, i) => ({ id: i, left: PARTICLE_RANDOM_VALUES[i * 4] * 100, top: PARTICLE_RANDOM_VALUES[i * 4 + 1] * 100, duration: PARTICLE_RANDOM_VALUES[i * 4 + 2] * 10 + 10, delay: PARTICLE_RANDOM_VALUES[i * 4 + 3] * 10, })); }, []); return (
{particles.map((particle) => ( ))}
); }); Particles.displayName = 'Particles'; const Hero = ({ onNavigateToMap, onAddOrganizationClick, addOrgButtonRef }: HeroProps) => { const { t } = useTranslation(); return (
{/* Animated background pattern */} {/* Abstract backlight effect */}
{/* Green backlight orb - behind "Connect Your Business" (left/top) */} {/* Blue backlight orb - behind "Grow Together" (right/bottom) */}
{/* Gradient overlay - positioned after backlight */}
{/* Floating particles effect */}
{/* Animated badge */}
{t('hero.kicker')}
{/* Main heading with creative 3D effects and color variations */} {(() => { const title = t('hero.title'); // Split title by period to separate "Connect Your Business" and "Grow Together" const parts = title.split('.').filter((p) => p.trim()); return parts.map((part, partIndex) => { const words = part.trim().split(' '); const isFirstPart = partIndex === 0; return ( {words.map((word, wordIndex) => ( {/* 3D shadow layers with color - positioned behind */} {/* Main text - solid and visible with colored shadow */} {word} {/* Animated glow effect */} ))} ); }); })()} {t('hero.subtitle')} {/* Action buttons */}
{/* Modern sector visualization */}
); }; export default React.memo(Hero);