diff --git a/package-lock.json b/package-lock.json index a7267fa..0c8692a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@gsap/react": "^2.1.2", "@tailwindcss/postcss": "^4.2.1", + "framer-motion": "^12.34.3", "gsap": "^3.14.2", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -2749,6 +2750,33 @@ "url": "https://github.com/sponsors/rawify" } }, + "node_modules/framer-motion": { + "version": "12.34.3", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.34.3.tgz", + "integrity": "sha512-v81ecyZKYO/DfpTwHivqkxSUBzvceOpoI+wLfgCgoUIKxlFKEXdg0oR9imxwXumT4SFy8vRk9xzJ5l3/Du/55Q==", + "license": "MIT", + "dependencies": { + "motion-dom": "^12.34.3", + "motion-utils": "^12.29.2", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -3316,6 +3344,21 @@ "node": "*" } }, + "node_modules/motion-dom": { + "version": "12.34.3", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.34.3.tgz", + "integrity": "sha512-sYgFe+pR9aIM7o4fhs2aXtOI+oqlUd33N9Yoxcgo1Fv7M20sRkHtCmzE/VRNIcq7uNJ+qio+Xubt1FXH3pQ+eQ==", + "license": "MIT", + "dependencies": { + "motion-utils": "^12.29.2" + } + }, + "node_modules/motion-utils": { + "version": "12.29.2", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.29.2.tgz", + "integrity": "sha512-G3kc34H2cX2gI63RqU+cZq+zWRRPSsNIOjpdl9TN4AQwC4sgwYPl/Q/Obf/d53nOm569T0fYK+tcoSV50BWx8A==", + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -3799,6 +3842,12 @@ "typescript": ">=4.8.4" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 5bf1605..5b6b3ff 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@gsap/react": "^2.1.2", "@tailwindcss/postcss": "^4.2.1", + "framer-motion": "^12.34.3", "gsap": "^3.14.2", "react": "^19.2.0", "react-dom": "^19.2.0", diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..0f88b68 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,14 @@ + + RewriteEngine On + RewriteBase / + + # Empêcher les boucles infinies sur index.html + RewriteRule ^index\.html$ - [L] + + # Si le fichier ou le dossier n'existe pas physiquement + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + + # On redirige vers index.html (sans le slash devant index pour plus de compatibilité) + RewriteRule . index.html [L] + \ No newline at end of file diff --git a/public/hero-section/historique.jpg b/public/hero-section/historique.jpg new file mode 100644 index 0000000..5b2dff2 Binary files /dev/null and b/public/hero-section/historique.jpg differ diff --git a/public/historique/arrivee.jpg b/public/historique/arrivee.jpg new file mode 100644 index 0000000..62e7887 Binary files /dev/null and b/public/historique/arrivee.jpg differ diff --git a/public/historique/champs-ukraine.jpg b/public/historique/champs-ukraine.jpg new file mode 100644 index 0000000..31e89bf Binary files /dev/null and b/public/historique/champs-ukraine.jpg differ diff --git a/public/historique/dernier-evenement.jpg b/public/historique/dernier-evenement.jpg new file mode 100644 index 0000000..0a14916 Binary files /dev/null and b/public/historique/dernier-evenement.jpg differ diff --git a/public/historique/pam-aerien.jpg b/public/historique/pam-aerien.jpg new file mode 100644 index 0000000..548ee21 Binary files /dev/null and b/public/historique/pam-aerien.jpg differ diff --git a/public/historique/premier-evenement.jpg b/public/historique/premier-evenement.jpg new file mode 100644 index 0000000..78cb232 Binary files /dev/null and b/public/historique/premier-evenement.jpg differ diff --git a/public/historique/signature-statuts.jpg b/public/historique/signature-statuts.jpg new file mode 100644 index 0000000..5783395 Binary files /dev/null and b/public/historique/signature-statuts.jpg differ diff --git a/src/App.tsx b/src/App.tsx index d9647d6..8883b9f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,7 +13,7 @@ function App() { } /> } /> } /> - } /> + } /> diff --git a/src/components/FacebookCarousel.tsx b/src/components/FacebookCarousel.tsx new file mode 100644 index 0000000..92296d9 --- /dev/null +++ b/src/components/FacebookCarousel.tsx @@ -0,0 +1,136 @@ +import { useState } from "react"; +import { motion, AnimatePresence } from "framer-motion"; + +// Modèle de données pour un post Facebook +interface FacebookPost { + id: number; + date: string; + content: string; + imageSrc: string; + link: string; +} + +// Fausses données (en attendant la connexion API ou le widget) +const mockPosts: FacebookPost[] = [ + { + id: 1, + date: "Il y a 2 jours", + content: + "Un immense merci aux bénévoles présents ce matin pour la préparation des 50 nouveaux colis à destination de l'Ukraine ! 🌻📦", + imageSrc: "/historique/pam-aerien.jpg", // Mets une vraie image de test + link: "https://www.facebook.com", + }, + { + id: 2, + date: "La semaine dernière", + content: + "Retour en images sur notre superbe atelier de peinture traditionnelle de Pâques (Pysanka). Merci aux enfants pour leur créativité ! 🎨", + imageSrc: "/historique/premier-evenement.jpg", + link: "https://www.facebook.com", + }, + { + id: 3, + date: "Il y a 2 semaines", + content: + "Le camion est bien arrivé ! La génératrice a pu être livrée à l'hôpital de Kharkiv. Merci à tous nos donateurs. 💙💛", + imageSrc: "/historique/dernier-evenement.jpg", + link: "https://www.facebook.com", + }, +]; + +export default function FacebookCarousel() { + const [currentIndex, setCurrentIndex] = useState(0); + + const nextPost = () => { + setCurrentIndex((prev) => (prev === mockPosts.length - 1 ? 0 : prev + 1)); + }; + + const prevPost = () => { + setCurrentIndex((prev) => (prev === 0 ? mockPosts.length - 1 : prev - 1)); + }; + + return ( +
+ {/* En-tête du Carrousel */} +
+
+

+ Actualités +

+

+ Suivez nos dernières actions en direct sur Facebook. +

+
+ + {/* Flèches de navigation */} +
+ + +
+
+ + {/* Zone du Carrousel */} +
+ + + {/* Image du Post */} +
+ Illustration du post +
+ + {/* Contenu du Post */} +
+
+
+ f +
+
+

Cœur UA PAM

+ + {mockPosts[currentIndex].date} + +
+
+ +

+ "{mockPosts[currentIndex].content}" +

+ + + Voir sur Facebook + +
+
+
+
+
+ ); +} diff --git a/src/components/Stepper.tsx b/src/components/Stepper.tsx new file mode 100644 index 0000000..a2012d6 --- /dev/null +++ b/src/components/Stepper.tsx @@ -0,0 +1,351 @@ +import React, { useState, Children, useRef, useLayoutEffect } from "react"; +import type { HTMLAttributes, ReactNode } from "react"; +import { motion, AnimatePresence } from "framer-motion"; +import type { Variants } from "framer-motion"; + +export interface StepperProps extends HTMLAttributes { + children: ReactNode; + initialStep?: number; + onStepChange?: (step: number) => void; + onFinalStepCompleted?: () => void; + stepCircleContainerClassName?: string; + stepContainerClassName?: string; + contentClassName?: string; + footerClassName?: string; + backButtonProps?: React.ButtonHTMLAttributes; + nextButtonProps?: React.ButtonHTMLAttributes; + backButtonText?: string; + nextButtonText?: string; + disableStepIndicators?: boolean; + renderStepIndicator?: (props: { + step: number; + currentStep: number; + onStepClick: (clicked: number) => void; + }) => ReactNode; +} + +export default function Stepper({ + children, + initialStep = 1, + onStepChange = () => {}, + onFinalStepCompleted = () => {}, + stepCircleContainerClassName = "", + stepContainerClassName = "", + contentClassName = "", + footerClassName = "", + backButtonProps = {}, + nextButtonProps = {}, + backButtonText = "Retour", + nextButtonText = "Suivant", + disableStepIndicators = false, + renderStepIndicator, + ...rest +}: StepperProps) { + const [currentStep, setCurrentStep] = useState(initialStep); + const [direction, setDirection] = useState(0); + const stepsArray = Children.toArray(children); + const totalSteps = stepsArray.length; + const isCompleted = currentStep > totalSteps; + const isLastStep = currentStep === totalSteps; + + const updateStep = (newStep: number) => { + setCurrentStep(newStep); + if (newStep > totalSteps) { + onFinalStepCompleted(); + } else { + onStepChange(newStep); + } + }; + + const handleBack = () => { + if (currentStep > 1) { + setDirection(-1); + updateStep(currentStep - 1); + } + }; + + const handleNext = () => { + if (!isLastStep) { + setDirection(1); + updateStep(currentStep + 1); + } + }; + + const handleComplete = () => { + setDirection(1); + updateStep(totalSteps + 1); + }; + + return ( +
+
+
+ {stepsArray.map((_, index) => { + const stepNumber = index + 1; + const isNotLastStep = index < totalSteps - 1; + return ( + + {renderStepIndicator ? ( + renderStepIndicator({ + step: stepNumber, + currentStep, + onStepClick: (clicked: number) => { + setDirection(clicked > currentStep ? 1 : -1); + updateStep(clicked); + }, + }) + ) : ( + { + setDirection(clicked > currentStep ? 1 : -1); + updateStep(clicked); + }} + /> + )} + {isNotLastStep && ( + stepNumber} /> + )} + + ); + })} +
+ + + {stepsArray[currentStep - 1]} + + + {!isCompleted && ( +
+
+ {currentStep !== 1 && ( + + )} + +
+
+ )} +
+
+ ); +} + +// Interfaces manquantes ajoutées pour remplacer les "any" +interface StepContentWrapperProps { + isCompleted: boolean; + currentStep: number; + direction: number; + children: ReactNode; + className?: string; +} + +function StepContentWrapper({ + isCompleted, + currentStep, + direction, + children, + className = "", +}: StepContentWrapperProps) { + const [parentHeight, setParentHeight] = useState(0); + return ( + + + {!isCompleted && ( + setParentHeight(h)} + > + {children} + + )} + + + ); +} + +interface SlideTransitionProps { + children: ReactNode; + direction: number; + onHeightReady: (height: number) => void; +} + +function SlideTransition({ + children, + direction, + onHeightReady, +}: SlideTransitionProps) { + const containerRef = useRef(null); + useLayoutEffect(() => { + if (containerRef.current) { + onHeightReady(containerRef.current.offsetHeight); + } + }, [children, onHeightReady]); + return ( + + {children} + + ); +} + +const stepVariants: Variants = { + enter: (dir: number) => ({ x: dir >= 0 ? "100%" : "-100%", opacity: 0 }), + center: { x: "0%", opacity: 1 }, + exit: (dir: number) => ({ x: dir >= 0 ? "-50%" : "50%", opacity: 0 }), +}; + +export function Step({ children }: { children: ReactNode }) { + return
{children}
; +} + +interface StepIndicatorProps { + step: number; + currentStep: number; + onClickStep: (clicked: number) => void; + disableStepIndicators?: boolean; +} + +function StepIndicator({ + step, + currentStep, + onClickStep, + disableStepIndicators = false, +}: StepIndicatorProps) { + const status = + currentStep === step + ? "active" + : currentStep < step + ? "inactive" + : "complete"; + const handleClick = () => { + if (step !== currentStep && !disableStepIndicators) onClickStep(step); + }; + + return ( + + + {status === "complete" ? ( + + ) : status === "active" ? ( +
+ ) : ( + {step} + )} + + + ); +} + +interface StepConnectorProps { + isComplete: boolean; +} + +function StepConnector({ isComplete }: StepConnectorProps) { + const lineVariants: Variants = { + incomplete: { width: 0, backgroundColor: "transparent" }, + complete: { width: "100%", backgroundColor: "#1a247f" }, + }; + + return ( +
+ +
+ ); +} + +type CheckIconProps = React.SVGProps; + +function CheckIcon(props: CheckIconProps) { + return ( + + + + ); +} diff --git a/src/layouts/MainLayout.tsx b/src/layouts/MainLayout.tsx index 9c79175..affda91 100644 --- a/src/layouts/MainLayout.tsx +++ b/src/layouts/MainLayout.tsx @@ -5,16 +5,16 @@ import logo from "/logo.png"; export const MainLayout = () => { const location = useLocation(); - // On simplifie la palette pour le PillNav const themeColors = { primary: "#1a247f", // Bleu profond accent: "#f7f0e5", // Beige - white: "#ffffff", // Blanc + white: "#ffffff", red: "#751424", }; return (
+ {/* NAVIGATION */}
{ logoAlt="Coeur UA PAM Logo" items={[ { label: "Accueil", href: "/" }, - { label: "À Propos", href: "/a-propos" }, - { label: "Historique", href: "/historique" }, + { label: "L'Association", href: "/a-propos" }, + { label: "Notre histoire", href: "/notre-histoire" }, { label: "Événements", href: "/evenements" }, ]} activeHref={location.pathname} - // LOGIQUE DES COULEURS RÉPARÉE : - baseColor={themeColors.accent} // Fond de la barre : BEIGE - pillColor={themeColors.accent} // Fond des boutons normaux : BEIGE - pillTextColor={themeColors.primary} // Texte normal : Bleu sur BEIGE - hoveredPillTextColor={themeColors.white} // Texte survolé : Blanc sur Bleu + baseColor={themeColors.accent} + pillColor={themeColors.accent} + pillTextColor={themeColors.primary} + hoveredPillTextColor={themeColors.white} ease="power2.out" initialLoadAnimation={true} /> - {/* Bouton SOUTENIR */} {
+ {/* CONTENU PRINCIPAL */}
-
+
+ + {/* FOOTER */} +
); }; diff --git a/src/pages/Historic.tsx b/src/pages/Historic.tsx index 06c6b57..402e696 100644 --- a/src/pages/Historic.tsx +++ b/src/pages/Historic.tsx @@ -1,9 +1,182 @@ +import { useState } from "react"; +import AnimatedContent from "../components/AnimatedContent"; +import Stepper, { Step } from "../components/Stepper"; +// import FacebookCarousel from "../components/FacebookCarousel"; + +const StepWithBackground = ({ + date, + title, + text, + imageSrc, + children, +}: { + date: string; + title: string; + text: string; + imageSrc: string; + children?: React.ReactNode; +}) => ( +
+
+
+
+ + {date} + +

+ {title} +

+ {children &&
{children}
} +

+ {text} +

+
+
+); + const Historic = () => { + const [isTimelineCompleted, setIsTimelineCompleted] = useState(false); + return ( -
-

Historique

-

Contenu de l'association...

+
+ {/* ======================= + SECTION HERO + ========================*/} + +
+ Historique Association +
+ +
+ + Notre histoire + +

+ D'une urgence
à une association unie +

+

+ Découvrez comment Cœur UA PAM est née d'un élan de solidarité + spontané pour devenir un véritable pont culturel et humanitaire. +

+
+
+
+ + {/* ======================= + SECTION STEPPER + ========================*/} + + {!isTimelineCompleted ? ( + setIsTimelineCompleted(true)} + backButtonText="Précédent" + nextButtonText="Continuer l'histoire" + contentClassName="!px-0 md:!px-0" + stepContainerClassName="!pb-4" + > + {/* ETAPE 1 */} + + + + + {/* ETAPE 2 */} + + + + + {/* ETAPE 3 */} + + +
+

+ "Il nous fallait un cadre légal pour agir plus fort et plus + loin." +

+
+
+
+ + {/* ETAPE 4 */} + + + +
+ ) : ( + /* MESSAGE DE FIN (Remplace le Stepper une fois terminé) */ +
+
+
+ +
+

+ L'histoire continue avec vous +

+

+ Chaque jour, de nouvelles pages s'écrivent grâce à nos bénévoles + et nos donateurs. +

+ +
+ + + Soutenir nos actions + +
+
+
+ )} +
+ + {/* +
+ +
+
*/}
); }; + export default Historic; diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 0ff116d..c53cd95 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -36,7 +36,7 @@ const Home = () => { Nos Événements { {/* --- BENTO GRID NAVIGATION --- */} - {/* Une grille moderne pour présenter les sections clés */}
- {/* CARTE 1 : Historique (Prend 1 colonne) */}