'use client'; import { useRef, useState, useEffect } from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { motion, useInView, useScroll, useTransform } from 'framer-motion'; import { Ship, Shield, Zap, BarChart3, Package, Clock, CheckCircle2, ArrowRight, Search, Anchor, Container, FileText, LayoutDashboard, Bell, BookOpen, Users, Check, X, } from 'lucide-react'; import { useAuth } from '@/lib/context/auth-context'; import { LandingHeader, LandingFooter } from '@/components/layout'; function AnimatedCounter({ end, suffix = '', prefix = '', decimals = 0, isActive, duration = 2, }: { end: number; suffix?: string; prefix?: string; decimals?: number; isActive: boolean; duration?: number; }) { const [count, setCount] = useState(0); useEffect(() => { if (!isActive) return; let startTime: number | undefined; const animate = (timestamp: number) => { if (!startTime) startTime = timestamp; const progress = Math.min((timestamp - startTime) / (duration * 1000), 1); const eased = 1 - Math.pow(1 - progress, 3); setCount(eased * end); if (progress < 1) requestAnimationFrame(animate); else setCount(end); }; requestAnimationFrame(animate); }, [end, duration, isActive]); const display = decimals > 0 ? count.toFixed(decimals) : Math.floor(count).toString(); return <>{prefix}{display}{suffix}; } export default function LandingPage() { const { user, isAuthenticated } = useAuth(); const heroRef = useRef(null); const featuresRef = useRef(null); const statsRef = useRef(null); const toolsRef = useRef(null); const pricingRef = useRef(null); const testimonialsRef = useRef(null); const ctaRef = useRef(null); const howRef = useRef(null); const isHeroInView = useInView(heroRef, { once: true }); const isFeaturesInView = useInView(featuresRef, { once: true }); const isStatsInView = useInView(statsRef, { once: true, amount: 0.3 }); const isToolsInView = useInView(toolsRef, { once: true }); const isPricingInView = useInView(pricingRef, { once: true }); const isTestimonialsInView = useInView(testimonialsRef, { once: true }); const isCtaInView = useInView(ctaRef, { once: true }); const isHowInView = useInView(howRef, { once: true, amount: 0.2 }); const [billingYearly, setBillingYearly] = useState(false); const { scrollYProgress } = useScroll(); const backgroundY = useTransform(scrollYProgress, [0, 1], ['0%', '50%']); const features = [ { icon: BarChart3, title: 'Tableau de bord', description: 'Suivez tous vos KPIs en temps réel : bookings, volumes, revenus et alertes personnalisées.', color: 'from-blue-500 to-cyan-500', link: '/dashboard', }, { icon: Package, title: 'Gestion des Réservations', description: 'Créez, gérez et suivez vos réservations maritimes LCL/FCL avec un historique complet.', color: 'from-purple-500 to-pink-500', link: '/dashboard/bookings', }, { icon: FileText, title: 'Documents Maritimes', description: 'Centralisez tous vos documents : B/L, factures, certificats et documents douaniers.', color: 'from-orange-500 to-red-500', link: '/dashboard/documents', }, { icon: Search, title: 'Suivi des expéditions', description: 'Suivez vos conteneurs en temps réel auprès de 10+ transporteurs majeurs (Maersk, MSC, CMA CGM...).', color: 'from-green-500 to-emerald-500', link: '/dashboard/track-trace', }, { icon: BookOpen, title: 'Wiki Maritime', description: 'Base de connaissances complète : Incoterms, documents, procédures douanières et plus encore.', color: 'from-yellow-500 to-orange-500', link: '/dashboard/wiki', }, { icon: Bell, title: 'Notifications Temps Réel', description: 'Restez informé avec des alertes instantanées sur vos bookings, documents et mises à jour.', color: 'from-indigo-500 to-purple-500', link: '/dashboard', }, ]; const tools = [ { icon: LayoutDashboard, title: 'Tableau de bord', description: 'Vue d\'ensemble de votre activité maritime', link: '/dashboard', }, { icon: Package, title: 'Mes Réservations', description: 'Gérez toutes vos réservations en un seul endroit', link: '/dashboard/bookings', }, { icon: FileText, title: 'Documents', description: 'Accédez à tous vos documents maritimes', link: '/dashboard/documents', }, { icon: Search, title: 'Suivi des expéditions', description: 'Suivez vos conteneurs en temps réel', link: '/dashboard/track-trace', }, { icon: BookOpen, title: 'Wiki Maritime', description: 'Base de connaissances du fret maritime', link: '/dashboard/wiki', }, { icon: Users, title: 'Mon Profil', description: 'Gérez vos informations personnelles', link: '/dashboard/profile', }, ]; const stats = [ { end: 50, prefix: '', suffix: '+', decimals: 0, label: 'Compagnies Maritimes', icon: Ship }, { end: 10, prefix: '', suffix: 'K+', decimals: 0, label: 'Ports Mondiaux', icon: Anchor }, { end: 2, prefix: '<', suffix: 's', decimals: 0, label: 'Temps de Réponse', icon: Zap }, { end: 99.5, prefix: '', suffix: '%', decimals: 1, label: 'Disponibilité', icon: CheckCircle2 }, ]; const pricingPlans = [ { key: 'bronze', name: 'Bronze', badge: null, monthlyPrice: 0, yearlyPrice: 0, yearlyMonthly: 0, description: 'Pour découvrir la plateforme', users: '1 utilisateur', shipments: '12 expéditions / an', commission: '5%', support: 'Aucun support', features: [ { text: 'Réservations maritimes LCL', included: true }, { text: 'Track & Trace conteneurs', included: true }, { text: 'Tableau de bord', included: false }, { text: 'Wiki maritime', included: false }, { text: 'Gestion des utilisateurs', included: false }, { text: 'Export CSV', included: false }, { text: 'Accès API', included: false }, { text: 'KAM dédié', included: false }, ], cta: 'Commencer gratuitement', ctaLink: '/register', highlighted: false, accentColor: 'from-amber-600 to-yellow-500', textAccent: 'text-amber-700', badgeBg: 'bg-amber-100 text-amber-800', }, { key: 'silver', name: 'Silver', badge: 'Populaire', monthlyPrice: 249, yearlyPrice: 2739, yearlyMonthly: 228, description: 'Pour les transitaires en croissance', users: 'Jusqu\'à 5 utilisateurs', shipments: 'Expéditions illimitées', commission: '3%', support: 'Support par email', features: [ { text: 'Réservations maritimes LCL', included: true }, { text: 'Track & Trace conteneurs', included: true }, { text: 'Tableau de bord avancé', included: true }, { text: 'Wiki maritime complet', included: true }, { text: 'Gestion des utilisateurs', included: true }, { text: 'Export CSV', included: true }, { text: 'Accès API', included: false }, { text: 'KAM dédié', included: false }, ], cta: 'Essai gratuit 14 jours', ctaLink: '/register', highlighted: true, accentColor: 'from-slate-400 to-slate-500', textAccent: 'text-slate-600', badgeBg: 'bg-slate-100 text-slate-700', }, { key: 'gold', name: 'Gold', badge: null, monthlyPrice: 899, yearlyPrice: 9889, yearlyMonthly: 824, description: 'Pour les équipes exigeantes', users: 'Jusqu\'à 20 utilisateurs', shipments: 'Expéditions illimitées', commission: '2%', support: 'Assistance commerciale directe', features: [ { text: 'Réservations maritimes LCL', included: true }, { text: 'Track & Trace conteneurs', included: true }, { text: 'Tableau de bord avancé', included: true }, { text: 'Wiki maritime complet', included: true }, { text: 'Gestion des utilisateurs', included: true }, { text: 'Export CSV', included: true }, { text: 'Accès API complet', included: true }, { text: 'KAM dédié', included: false }, ], cta: 'Essai gratuit 14 jours', ctaLink: '/register', highlighted: false, accentColor: 'from-yellow-400 to-amber-400', textAccent: 'text-amber-600', badgeBg: 'bg-yellow-50 text-amber-700', }, { key: 'platinium', name: 'Platinium', badge: 'Sur mesure', monthlyPrice: null, yearlyPrice: null, yearlyMonthly: null, description: 'Pour les grandes entreprises', users: 'Utilisateurs illimités', shipments: 'Expéditions illimitées', commission: '1%', support: 'Key Account Manager dédié', features: [ { text: 'Réservations maritimes LCL', included: true }, { text: 'Track & Trace conteneurs', included: true }, { text: 'Tableau de bord avancé', included: true }, { text: 'Wiki maritime complet', included: true }, { text: 'Gestion des utilisateurs', included: true }, { text: 'Export CSV', included: true }, { text: 'Accès API complet', included: true }, { text: 'KAM dédié + Interface personnalisée', included: true }, ], cta: 'Nous contacter', ctaLink: '/contact', highlighted: false, accentColor: 'from-brand-navy to-brand-turquoise', textAccent: 'text-brand-turquoise', badgeBg: 'bg-brand-navy/10 text-brand-navy', }, ]; const testimonials = [ { quote: 'Xpeditis a révolutionné notre façon de gérer le fret maritime. Les tarifs sont compétitifs et la plateforme est intuitive.', author: 'Marie Dubois', role: 'Directrice Logistique', company: 'LogiFrance', }, { quote: 'Le gain de temps est considérable. Ce qui nous prenait des heures se fait maintenant en quelques minutes.', author: 'Thomas Martin', role: 'Responsable Transport', company: 'EuroShipping', }, { quote: "L'interface est claire, les données sont précises et le support client est réactif. Un vrai partenaire de confiance.", author: 'Sophie Bernard', role: 'CEO', company: 'MariTime Solutions', }, ]; const containerVariants = { hidden: { opacity: 0, y: 50 }, visible: { opacity: 1, y: 0, transition: { duration: 0.6, staggerChildren: 0.1, }, }, }; const itemVariants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0, transition: { duration: 0.5 }, }, }; return (
{/* Hero Section */}
{/* Background Video */}
{/* Stats Section */}
{stats.map((stat, index) => { const IconComponent = stat.icon; return (
{stat.label}
); })}
{/* Features Section */}

Pourquoi choisir Xpeditis ?

Une plateforme complète pour gérer tous vos besoins en fret maritime

{features.map((feature, index) => { const IconComponent = feature.icon; return ( {/* Gradient accent bar on top — always visible, intensifies on hover */}

{feature.title}

{feature.description}

{/* CTA always visible */}
Découvrir
); })}
{/* Tools & Calculators Section */}

Outils & Calculateurs

Des outils puissants pour optimiser vos opérations maritimes

{tools.map((tool, index) => { const IconComponent = tool.icon; return (

{tool.title}

{tool.description}

); })}
{/* Partner Logos Section */}

En partenariat avec les plus grandes compagnies maritimes

Accédez aux tarifs de 50+ transporteurs mondiaux

{[ 'ECU Line 2.png', 'ICL 1.png', 'NVO Consolidation 1.png', 'TCC LOG 1.png', 'VANGUARD 1.png', 'image 1.png', ].map((logo, index) => ( {`Partner ))}
{/* Pricing Section */}
{/* Header */} Tarifs

Des plans adaptés à votre activité

De l'accès découverte au partenariat sur mesure — évoluez à tout moment.

{/* Billing Toggle */} Mensuel Annuel {billingYearly && ( 1 mois offert )} {/* Plans Grid */} {pricingPlans.map((plan, index) => ( {/* Top gradient bar */}
{/* Popular badge */} {plan.badge && plan.key === 'silver' && (
{plan.badge}
)} {plan.badge && plan.key === 'platinium' && (
{plan.badge}
)}
{/* Plan name */}
{plan.name}

{plan.description}

{/* Price */}
{plan.monthlyPrice === null ? (
Sur mesure

Tarification personnalisée

) : plan.monthlyPrice === 0 ? (
Gratuit

Pour toujours

) : (
{billingYearly ? plan.yearlyMonthly : plan.monthlyPrice}€ /mois
{billingYearly ? (

Facturé {plan.yearlyPrice?.toLocaleString('fr-FR')}€/an

) : (

Économisez 1 mois avec l'annuel

)}
)}
{/* Key stats */}
{plan.users}
{plan.shipments}
Commission {plan.commission}
{/* Features */}
    {plan.features.map((feature, featureIndex) => (
  • {feature.included ? ( ) : ( )} {feature.text}
  • ))}
{/* CTA */} {plan.cta}
))} {/* Bottom note */}

Plans Silver et Gold : essai gratuit 14 jours inclus · Aucune carte bancaire requise

Des questions ?{' '} Contactez notre équipe commerciale

{/* How It Works Section */}

Comment ça marche ?

Réservez votre fret maritime en 4 étapes simples

{/* Steps grid with animated connecting line */}
{/* Animated progress line — desktop only */}
{[ { step: '01', title: 'Recherchez', description: "Entrez vos ports de départ et d'arrivée", icon: Search, }, { step: '02', title: 'Comparez', description: 'Analysez les tarifs de 50+ compagnies', icon: BarChart3, }, { step: '03', title: 'Réservez', description: 'Confirmez votre réservation en un clic', icon: CheckCircle2, }, { step: '04', title: 'Suivez', description: 'Suivez votre envoi en temps réel', icon: Container, }, ].map((step, index) => { const IconComponent = step.icon; return ( {/* Clean number circle — no icon overlay */}
{step.step}
{/* Icon badge — separate from the number */}

{step.title}

{step.description}

); })}
{/* CTA after last step */} Essayer maintenant

Inscription gratuite · Aucune carte bancaire requise

{/* Testimonials Section */}

Ils nous font confiance

Découvrez les témoignages de nos clients satisfaits

{testimonials.map((testimonial, index) => (
{[...Array(5)].map((_, i) => ( ))}

"{testimonial.quote}"

{testimonial.author}
{testimonial.role} - {testimonial.company}
))}
{/* CTA Section */}

Prêt à simplifier votre fret maritime ?

Rejoignez des centaines de transitaires qui font confiance à Xpeditis pour leurs expéditions maritimes.

{isAuthenticated && user ? ( Accéder au tableau de bord ) : ( <> Créer un compte gratuit Se connecter )}
Sans carte bancaire
Configuration en 2 min
Données sécurisées
); }