import { useLayoutEffect, useRef, useState, useCallback } from "react"; import AnimatedContent from "../components/AnimatedContent"; import SEO from "../components/SEO"; // --- INTERFACES TYPESCRIPT --- interface EventIntro { type: "intro"; year: string; title: string; bg: string; text: string; } interface EventImage { type: "image"; src: string; alt: string; imageTitle?: string; imageDesc?: string; } type HistoryItem = EventIntro | EventImage; interface Category { id: string; title: string; description: string; themeColor: string; history: HistoryItem[]; } interface YearGroup { year: string; title: string; bg: string; text: string; images: EventImage[]; } // ============================================================================ // SOUS-COMPOSANT : Gère l'effet "Scroll Vertical -> Glissement Horizontal" // ============================================================================ const CategoryHorizontalScroll = ({ category }: { category: Category }) => { const containerRef = useRef(null); const trackRef = useRef(null); const [progress, setProgress] = useState(0); const [maxTranslate, setMaxTranslate] = useState(0); // 1. On regroupe les images par année const groupedHistory: YearGroup[] = []; let currentYear: YearGroup | null = null; category.history.forEach((item: HistoryItem) => { if (item.type === "intro") { const newYearGroup: YearGroup = { year: item.year, title: item.title, bg: item.bg, text: item.text, images: [], }; groupedHistory.push(newYearGroup); currentYear = newYearGroup; } else if (item.type === "image" && currentYear) { currentYear.images.push(item); } }); // 2. Logique de calcul du scroll const handleScroll = useCallback(() => { if (!containerRef.current) return; const rect = containerRef.current.getBoundingClientRect(); const windowHeight = window.innerHeight; const maxScroll = rect.height - windowHeight; const currentScroll = -rect.top; let p = currentScroll / maxScroll; p = Math.max(0, Math.min(1, p)); setProgress(p); }, []); useLayoutEffect(() => { const updateMeasurements = () => { if (trackRef.current) { const max = trackRef.current.scrollWidth - window.innerWidth + 80; setMaxTranslate(max > 0 ? max : 0); } }; updateMeasurements(); window.addEventListener("resize", updateMeasurements); window.addEventListener("scroll", handleScroll, { passive: true }); handleScroll(); return () => { window.removeEventListener("resize", updateMeasurements); window.removeEventListener("scroll", handleScroll); }; }, [handleScroll]); const containerHeight = `${(groupedHistory.length + 1) * 80}vh`; return (

{category.title}

{category.description}

{groupedHistory.map((yearGroup, index) => (

{yearGroup.year}

{yearGroup.title}

{yearGroup.images.map((img, idx) => { const total = yearGroup.images.length; let spanClass = "col-span-1 row-span-1"; if (total === 1) { spanClass = "col-span-2 md:col-span-3 row-span-2"; } else if (total === 2) { spanClass = idx === 0 ? "col-span-2 md:col-span-2" : "col-span-2 md:col-span-1"; } else if (total >= 3) { if (idx === 0) { spanClass = "col-span-2 row-span-2"; } else { let mobileSpan = "col-span-1"; let desktopSpan = "md:col-span-1"; if (idx === total - 1) { if (total % 2 === 0) mobileSpan = "col-span-2"; if ((total - 3) % 3 === 1) desktopSpan = "md:col-span-3"; if ((total - 3) % 3 === 2) desktopSpan = "md:col-span-2"; } spanClass = `${mobileSpan} ${desktopSpan} row-span-1`; } } const isVideo = img.src?.toLowerCase().endsWith(".mp4") || img.src?.toLowerCase().endsWith(".webm"); return (
{isVideo ? (
); })}
))}
); }; // ============================================================================ // PAGE PRINCIPALE : Rend toutes les catégories // ============================================================================ export default function Events() { const eventCategories: Category[] = [ // --------------------------------------------------------- // 1. OCTOBRE ROSE // --------------------------------------------------------- { id: "octobre-rose", title: "Octobre Rose", description: "Cœur UA PAM s'engage activement dans la lutte contre le cancer du sein. Une cause qui nous tient à cœur et pour laquelle nous marchons et courons ensemble chaque année.", themeColor: "text-[#dd3775]", history: [ { type: "intro", year: "2022", title: "Nos premiers pas en Rose", bg: "bg-[#751424]", text: "text-white", }, { type: "image", src: "/evenements/octobre-rose/2022octobre-rose-1.webp", alt: "Première participation Octobre rose 2022 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2022octobre-rose-2.webp", alt: "Première participation Octobre rose 2022 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2022octobre-rose-3.webp", alt: "Première participation Octobre rose 2022 à PàM - Coeur UA PAM", }, { type: "intro", year: "2023", title: "", bg: "bg-[#dd3775]", text: "text-white", }, { type: "image", src: "/evenements/octobre-rose/2023octobre-rose-1.webp", alt: "Octobre rose 2023 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2023octobre-rose-2.webp", alt: "Octobre rose 2023 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2023octobre-rose-3.webp", alt: "Octobre rose 2023 à PàM - Coeur UA PAM", }, { type: "intro", year: "2024", title: "", bg: "bg-[#751424]", text: "text-white", }, { type: "image", src: "/evenements/octobre-rose/2024octobre-rose-1.webp", alt: "Octobre rose 2024 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2024octobre-rose-2.webp", alt: "Octobre rose 2024 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2024octobre-rose-3.webp", alt: "NOctobre rose 2024 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2024octobre-rose-4.webp", alt: "Octobre rose 2024 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2024octobre-rose-5.webp", alt: "Octobre rose 2024 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2024octobre-rose-6.webp", alt: "Octobre rose 2024 à PàM - Coeur UA PAM", }, { type: "intro", year: "2025", title: "Toujours présent !", bg: "bg-[#dd3775]", text: "text-white", }, { type: "image", src: "/evenements/octobre-rose/2025octobre-rose-1.webp", alt: "Octobre rose 2025 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2025octobre-rose-2.webp", alt: "Octobre rose 2025 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2025octobre-rose-3.webp", alt: "Octobre rose 2025 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2025octobre-rose-4.webp", alt: "Octobre rose 2025 à PàM - Coeur UA PAM", }, { type: "image", src: "/evenements/octobre-rose/2025octobre-rose-5.webp", alt: "Octobre rose 2025 PàM - Coeur UA à PàM - Coeur UA PAM", }, ], }, // --------------------------------------------------------- // 2. REPAS DE NOËL // --------------------------------------------------------- { id: "repas-noel", title: "Repas de Noël", description: "Chaque année, nous organisons un grand repas traditionnel pour rassembler la communauté ukrainienne et nos soutiens locaux autour de plats typiques.", themeColor: "text-[#1a247f]", history: [ { type: "intro", year: "2022", title: "Notre premier rassemblement", bg: "bg-[#f7f0e5]", text: "text-[#1a247f]", }, { type: "image", src: "/evenements/noel-ukrainiens/2022noel-ukrainien-1.webp", alt: "Premier repas de Noël des ukrainiens à PàM 2022 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2022noel-ukrainien-2.webp", alt: "Premier repas de Noël des ukrainiens à PàM 2022 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2022noel-ukrainien-3.webp", alt: "Premier repas de Noël des ukrainiens à PàM 2022 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2022noel-ukrainien-4.webp", alt: "Premier repas de Noël des ukrainiens à PàM 2022 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2022noel-ukrainien-5.webp", alt: "Premier repas de Noël des ukrainiens à PàM 2022 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2022noel-ukrainien-6.webp", alt: "Premier repas de Noël des ukrainiens à PàM 2022 - Coeur UA PAM", }, { type: "intro", year: "2023", title: "Partage et Découvertes", bg: "bg-[#1a247f]", text: "text-white", }, { type: "image", src: "/evenements/noel-ukrainiens/2023noel-ukrainien-1.webp", alt: "Repas de Noël des ukrainiens à PàM 2023 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2023noel-ukrainien-2.webp", alt: "Repas de Noël des ukrainiens à PàM 2023 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2023noel-ukrainien-3.webp", alt: "Repas de Noël des ukrainiens à PàM 2023 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2023noel-ukrainien-4.webp", alt: "Repas de Noël des ukrainiens à PàM 2023 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2023noel-ukrainien-5.webp", alt: "Repas de Noël des ukrainiens à PàM 2023 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2023noel-ukrainien-6.webp", alt: "Repas de Noël des ukrainiens à PàM 2023 - Coeur UA PAM", }, { type: "intro", year: "2024", title: "Un Noël de Solidarité", bg: "bg-[#f7f0e5]", text: "text-[#1a247f]", }, { type: "image", src: "/evenements/noel-ukrainiens/2024noel-ukrainien-1.mp4", alt: "epas de Noël des ukrainiens à PàM 2024 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2024noel-ukrainien-1.webp", alt: "Repas de Noël des ukrainiens à PàM 2024 - Coeur UA PAM", }, { type: "intro", year: "2025", title: "La tradition perdure", bg: "bg-[#1a247f]", text: "text-white", }, { type: "image", src: "/evenements/noel-ukrainiens/2025noel-ukrainien-1.mp4", alt: "Repas de Noël des ukrainiens à PàM 2025 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2025noel-ukrainien-1.webp", alt: "Repas de Noël des ukrainiens à PàM 2025 - Coeur UA PAM", }, { type: "image", src: "/evenements/noel-ukrainiens/2025noel-ukrainien-2.webp", alt: "Repas de Noël des ukrainiens à PàM 2025 - Coeur UA PAM", }, ], }, // // --------------------------------------------------------- // // 3. COMMÉMORATIONS // // --------------------------------------------------------- { id: "commemorations", title: "Anniversaire du conflit", description: "Le devoir de mémoire est essentiel. Nous nous rassemblons pour honorer les victimes du conflit et rappeler notre soutien indéfectible à l'Ukraine.", themeColor: "text-gray-800", history: [ { type: "intro", year: "2023", title: "", bg: "bg-gray-800", text: "text-white", }, { type: "image", src: "/evenements/commemoration/2023commemoration-1.mp4", alt: "Commemoration début du conflit - 2023", }, { type: "intro", year: "2024", title: "2 ans de résilience", bg: "bg-gray-200", text: "text-gray-900", }, { type: "image", src: "/evenements/commemoration/2024commemoration-1.webp", alt: "Rassemblement sur la place", }, { type: "intro", year: "2025", title: "", bg: "bg-gray-800", text: "text-white", }, { type: "image", src: "/evenements/commemoration/2025commemoration-1.webp", alt: "Commemoration début du conflit - 2025", }, { type: "image", src: "/evenements/commemoration/2025commemoration-4.webp", alt: "Commemoration début du conflit - 2025", }, { type: "image", src: "/evenements/commemoration/2025commemoration-3.webp", alt: "Commemoration début du conflit - 2025", }, { type: "image", src: "/evenements/commemoration/2025commemoration-2.webp", alt: "Commemoration début du conflit - 2025", }, { type: "intro", year: "2026", title: "", bg: "bg-gray-800", text: "text-white", }, { type: "image", src: "/evenements/commemoration/2026commemoration-1.webp", alt: "Commemoration début du conflit - 2026", }, { type: "image", src: "/evenements/commemoration/2026commemoration-1.webp", alt: "Commemoration début du conflit - 2026", }, { type: "image", src: "/evenements/commemoration/2026commemoration-3.webp", alt: "Commemoration début du conflit - 2026", }, { type: "image", src: "/evenements/commemoration/2026commemoration-4.webp", alt: "Commemoration début du conflit - 2026", }, { type: "image", src: "/evenements/commemoration/2026commemoration-2.webp", alt: "Commemoration début du conflit - 2026", }, ], }, // // --------------------------------------------------------- // // 4. MARCHÉ DE NOËL // // --------------------------------------------------------- { id: "marche-noel", title: "Marchés de Noël", description: "Retrouvez-nous sur nos stands lors des marchés de Noël locaux pour découvrir l'artisanat ukrainien, parfait pour des cadeaux originaux et solidaires.", themeColor: "text-[#dfbe85]", history: [ { type: "intro", year: "2025", title: "Premier marché de Noël", bg: "bg-white", text: "text-[#1a247f]", }, { type: "image", src: "/evenements/marche-noel/2025marche-noel-1.webp", alt: "Premier marché de Noël de Coeur-UA-PAM en 2025", }, ], }, // // --------------------------------------------------------- // // 5. AUTRES ÉVÉNEMENTS // // --------------------------------------------------------- // { // id: "autres-evenements", // title: "Autres Événements", // description: // "Concerts, courses relais, ateliers créatifs... L'association se mobilise sur tous les fronts pour faire rayonner la culture ukrainienne.", // themeColor: "text-primary", // history: [ // { // type: "intro", // year: "2022", // title: "Les débuts de l'entraide", // bg: "bg-white", // text: "text-primary", // }, // { // type: "image", // src: "/evenements/autres-2022-1.webp", // alt: "Collecte de dons", // }, // { // type: "intro", // year: "2023", // title: "De nouvelles initiatives", // bg: "bg-[#1a247f]", // text: "text-white", // }, // { // type: "image", // src: "/evenements/autres-2023-1.webp", // alt: "Exposition photo", // imageTitle: "Exposition 'Regards d'Ukraine'", // imageDesc: "Une semaine d'exposition à la mairie.", // }, // { // type: "intro", // year: "2024", // title: "Défis et Culture", // bg: "bg-white", // text: "text-primary", // }, // { // type: "image", // src: "/evenements/autres-2024-1.webp", // alt: "Course relais", // imageTitle: "Course Relais Solidaire", // imageDesc: "Nos membres ont couru 50km pour lever des fonds.", // }, // { // type: "image", // src: "/evenements/autres-2024-2.webp", // alt: "Atelier Pysanky", // }, // { // type: "intro", // year: "2025", // title: "Toujours en action", // bg: "bg-[#1a247f]", // text: "text-white", // }, // { // type: "image", // src: "/evenements/autres-2025-1.webp", // alt: "Concert caritatif", // imageTitle: "Concert pour la Paix", // imageDesc: "La chorale a réuni plus de 200 spectateurs.", // }, // ], // }, ]; return (
Historique Association
Nos événements

Nos événements.

Revivez l'histoire de nos mobilisations en images, année après année.

{/* DÉFILEMENT DES CATÉGORIES ACTIVÉ */}
{eventCategories.map((category) => ( ))}
); }