Changing from WP to React | 1
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
@@ -0,0 +1,47 @@
|
||||
# 🇺🇦 Coeur UA PAM — Application Web de l’Association
|
||||
|
||||
**Coeur UA PAM** est la plateforme web moderne de l’association _Cœur UA Pont-à-Mousson_. Cette nouvelle version migre de WordPress vers une architecture **React** pour offrir une expérience plus fluide, rapide et sécurisée.
|
||||
|
||||
👉 Site officiel : [coeur-ua-pam.fr](https://coeur-ua-pam.fr)
|
||||
|
||||
---
|
||||
|
||||
## ✨ Fonctionnalités
|
||||
|
||||
- ⚡ **Performance optimisée** : Navigation instantanée grâce au typage Single Page Application (SPA).
|
||||
- 📱 **Mobile First** : Interface entièrement responsive et pensée pour l'accessibilité.
|
||||
- 🎨 **UI Moderne** : Composants sur mesure pour la mise en avant des actions humanitaires.
|
||||
- 🌍 **Culture & Solidarité** : Espace dédié à l'histoire et aux ressources ukrainiennes.
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ Stack technique
|
||||
|
||||
- **Framework** : [React.js](https://reactjs.org/)
|
||||
- **Outil de build** : [Vite.js](https://vitejs.dev/) (pour la rapidité de développement)
|
||||
- **Styling** : [Tailwind CSS](https://tailwindcss.com/) (recommandé pour remplacer Elementor)
|
||||
- **Routage** : React Router
|
||||
- **Déploiement** : Vercel / Netlify (conseillé)
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Installation & Développement
|
||||
|
||||
**Cloner le projet** :
|
||||
|
||||
```bash
|
||||
git clone https://github.com/xEsiah/CoeurUAPam.git
|
||||
cd CoeurUAPam
|
||||
```
|
||||
|
||||
**Installer les dépendances** :
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
**Lancer le serveur de développement** :
|
||||
|
||||
```
|
||||
npm run dev
|
||||
```
|
||||
@@ -0,0 +1,23 @@
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
js.configs.recommended,
|
||||
tseslint.configs.recommended,
|
||||
reactHooks.configs.flat.recommended,
|
||||
reactRefresh.configs.vite,
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
])
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Coeur UA PàM</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+4046
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "coeur-ua-react",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gsap/react": "^2.1.2",
|
||||
"@tailwindcss/postcss": "^4.2.1",
|
||||
"gsap": "^3.14.2",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router-dom": "^7.13.1",
|
||||
"router": "^2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/react": "^19.2.7",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^5.1.1",
|
||||
"autoprefixer": "^10.4.24",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-react-refresh": "^0.4.24",
|
||||
"globals": "^16.5.0",
|
||||
"postcss": "^8.5.6",
|
||||
"tailwindcss": "^4.2.1",
|
||||
"typescript": "~5.9.3",
|
||||
"typescript-eslint": "^8.48.0",
|
||||
"vite": "^7.3.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
plugins: {
|
||||
"@tailwindcss/postcss": {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
+42
@@ -0,0 +1,42 @@
|
||||
#root {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 6em;
|
||||
padding: 1.5em;
|
||||
will-change: filter;
|
||||
transition: filter 300ms;
|
||||
}
|
||||
.logo:hover {
|
||||
filter: drop-shadow(0 0 2em #646cffaa);
|
||||
}
|
||||
.logo.react:hover {
|
||||
filter: drop-shadow(0 0 2em #61dafbaa);
|
||||
}
|
||||
|
||||
@keyframes logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
a:nth-of-type(2) .logo {
|
||||
animation: logo-spin infinite 20s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
.read-the-docs {
|
||||
color: #888;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
||||
import { MainLayout } from "./layouts/MainLayout";
|
||||
import About from "./pages/About";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="/" element={<MainLayout />}>
|
||||
<Route index element={<About />} />
|
||||
<Route path="a-propos" element={<About />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -0,0 +1,80 @@
|
||||
import { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
export const Navbar = () => {
|
||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<nav className="bg-primary text-white shadow-lg z-50 relative font-semibold">
|
||||
<div className="max-w-7xl mx-auto px-6 flex justify-between items-center h-20">
|
||||
{/* LOGO */}
|
||||
<Link to="/" className="flex items-center gap-3 group">
|
||||
<div className="w-12 h-12 bg-white rounded-full flex items-center justify-center text-primary font-bold text-2xl group-hover:scale-110 transition-transform">
|
||||
UA
|
||||
</div>
|
||||
<span className="uppercase tracking-widest text-lg">
|
||||
Coeur UA PAM
|
||||
</span>
|
||||
</Link>
|
||||
|
||||
{/* MENU */}
|
||||
<ul className="hidden md:flex items-center space-x-10">
|
||||
{/* Dropdown Evenements */}
|
||||
<li
|
||||
className="relative h-20 flex items-center cursor-pointer"
|
||||
onMouseEnter={() => setIsDropdownOpen(true)}
|
||||
onMouseLeave={() => setIsDropdownOpen(false)}
|
||||
>
|
||||
<span className="hover:text-hover-nav transition-colors uppercase">
|
||||
Événements
|
||||
</span>
|
||||
|
||||
{isDropdownOpen && (
|
||||
<ul className="absolute top-20 left-0 w-64 bg-primary border-t-2 border-hover-nav shadow-2xl py-2 animate-in fade-in slide-in-from-top-2">
|
||||
<li>
|
||||
<Link
|
||||
to="/evenements/octobre-rose"
|
||||
className="block px-6 py-3 hover:bg-blue-accent hover:text-hover-nav transition-colors"
|
||||
>
|
||||
Octobre Rose
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link
|
||||
to="/evenements/noel"
|
||||
className="block px-6 py-3 hover:bg-blue-accent hover:text-hover-nav transition-colors"
|
||||
>
|
||||
Noël des Ukrainiens
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
)}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<Link
|
||||
to="/historique"
|
||||
className="hover:text-hover-nav transition-colors uppercase"
|
||||
>
|
||||
Historique
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<Link
|
||||
to="/a-propos"
|
||||
className="text-hover-nav border-b-2 border-hover-nav pb-1 uppercase"
|
||||
>
|
||||
À propos
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{/* BOUTON DON (Action) */}
|
||||
<button className="bg-heading hover:bg-heading-accent text-white px-6 py-2 rounded-sm transition-all shadow-md uppercase text-sm">
|
||||
Soutenir
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,124 @@
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import gsap from "gsap";
|
||||
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
||||
import { useGSAP } from "@gsap/react";
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger);
|
||||
|
||||
interface SplitTextProps {
|
||||
text: string;
|
||||
className?: string;
|
||||
delay?: number;
|
||||
duration?: number;
|
||||
ease?: string;
|
||||
// On retire splitType s'il n'est pas utilisé pour éviter le warning "unused"
|
||||
from?: gsap.TweenVars;
|
||||
to?: gsap.TweenVars;
|
||||
threshold?: number;
|
||||
rootMargin?: string;
|
||||
textAlign?: "left" | "center" | "right" | "justify";
|
||||
tag?: keyof React.JSX.IntrinsicElements; // Correction du namespace
|
||||
onLetterAnimationComplete?: () => void;
|
||||
}
|
||||
|
||||
const SplitText: React.FC<SplitTextProps> = ({
|
||||
text,
|
||||
className = "",
|
||||
delay = 50,
|
||||
duration = 0.5,
|
||||
ease = "back.out",
|
||||
from = { opacity: 0, y: 40 },
|
||||
to = { opacity: 1, y: 0 },
|
||||
threshold = 0.1,
|
||||
rootMargin = "0px",
|
||||
textAlign = "left",
|
||||
tag = "p",
|
||||
onLetterAnimationComplete,
|
||||
}) => {
|
||||
// On remplace 'any' par un type générique d'élément HTML
|
||||
const ref = useRef<HTMLElement>(null);
|
||||
const animationCompletedRef = useRef(false);
|
||||
const onCompleteRef = useRef(onLetterAnimationComplete);
|
||||
const [fontsLoaded, setFontsLoaded] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
onCompleteRef.current = onLetterAnimationComplete;
|
||||
}, [onLetterAnimationComplete]);
|
||||
|
||||
useEffect(() => {
|
||||
let isMounted = true;
|
||||
|
||||
const handleLoad = () => {
|
||||
if (isMounted) setFontsLoaded(true);
|
||||
};
|
||||
|
||||
if (document.fonts.status === "loaded") {
|
||||
Promise.resolve().then(handleLoad);
|
||||
} else {
|
||||
document.fonts.ready.then(handleLoad);
|
||||
}
|
||||
|
||||
return () => {
|
||||
isMounted = false;
|
||||
};
|
||||
}, []);
|
||||
|
||||
useGSAP(
|
||||
() => {
|
||||
if (!ref.current || !text || !fontsLoaded) return;
|
||||
if (animationCompletedRef.current) return;
|
||||
|
||||
const el = ref.current;
|
||||
|
||||
const startPct = (1 - threshold) * 100;
|
||||
const marginMatch = /^(-?\d+(?:\.\d+)?)(px|em|rem|%)?$/.exec(rootMargin);
|
||||
const marginValue = marginMatch ? parseFloat(marginMatch[1]) : 0;
|
||||
const marginUnit = marginMatch ? marginMatch[2] || "px" : "px";
|
||||
const sign =
|
||||
marginValue === 0
|
||||
? ""
|
||||
: marginValue < 0
|
||||
? `-=${Math.abs(marginValue)}${marginUnit}`
|
||||
: `+=${marginValue}${marginUnit}`;
|
||||
const start = `top ${startPct}%${sign}`;
|
||||
|
||||
gsap.fromTo(
|
||||
el,
|
||||
{ ...from },
|
||||
{
|
||||
...to,
|
||||
duration,
|
||||
ease,
|
||||
stagger: delay / 1000,
|
||||
scrollTrigger: {
|
||||
trigger: el,
|
||||
start,
|
||||
once: true,
|
||||
},
|
||||
onComplete: () => {
|
||||
animationCompletedRef.current = true;
|
||||
onCompleteRef.current?.();
|
||||
},
|
||||
},
|
||||
);
|
||||
},
|
||||
{ dependencies: [text, fontsLoaded, delay, duration, ease], scope: ref },
|
||||
);
|
||||
|
||||
const style: React.CSSProperties = {
|
||||
textAlign,
|
||||
wordWrap: "break-word",
|
||||
willChange: "transform, opacity",
|
||||
};
|
||||
|
||||
// Correction du type 'any' pour le Tag dynamique
|
||||
const TagName = tag as React.ElementType;
|
||||
|
||||
return (
|
||||
<TagName ref={ref} style={style} className={`inline-block ${className}`}>
|
||||
{text}
|
||||
</TagName>
|
||||
);
|
||||
};
|
||||
|
||||
export default SplitText;
|
||||
@@ -0,0 +1,11 @@
|
||||
export const SidePattern = () => (
|
||||
<aside className="side-pattern-container">
|
||||
<div className="side-pattern-image">
|
||||
<div className="h-full w-full bg-linear-to-b from-heading/20 via-transparent to-heading/20 flex flex-col items-center py-8">
|
||||
<span className="text-heading text-sm font-bold vertical-text uppercase tracking-widest opacity-50">
|
||||
Solidarité • Ukraine • Pont-à-Mousson
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
@@ -0,0 +1,40 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@theme {
|
||||
--color-primary: #1a247f;
|
||||
--color-blue-accent: #0e1449;
|
||||
--color-site-text: #242424;
|
||||
--color-heading: #470b15;
|
||||
--color-heading-accent: #751424;
|
||||
--color-bg-1: #f7f0e5;
|
||||
--color-bg-2: #f1e6d3;
|
||||
--color-hover-nav: #dfbe85;
|
||||
--color-bg-carousel: #d3c1a5;
|
||||
}
|
||||
|
||||
/* On définit nos composants sans @apply sur des classes custom */
|
||||
@layer components {
|
||||
.side-pattern-container {
|
||||
@apply w-20 md:w-32 bg-white relative overflow-hidden border-l border-gray-200 shadow-inner shrink-0;
|
||||
}
|
||||
|
||||
/* On met le background-image directement ici sans passer par une autre classe */
|
||||
.side-pattern-image {
|
||||
@apply absolute inset-0 opacity-90;
|
||||
background-image: url("/bandeau.jpg");
|
||||
background-repeat: repeat-y;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.vertical-text {
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: mixed;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-bg-1 text-site-text;
|
||||
margin: 0;
|
||||
font-family:
|
||||
"Montserrat", sans-serif; /* Pense à l'importer dans index.html */
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Outlet } from "react-router-dom";
|
||||
import { Navbar } from "../components/Navbar";
|
||||
import { SidePattern } from "../components/SidePattern";
|
||||
|
||||
export const MainLayout = () => {
|
||||
return (
|
||||
<div className="flex flex-col min-h-screen">
|
||||
<Navbar />
|
||||
<div className="flex flex-1">
|
||||
<main className="flex-1 p-8 md:p-16 bg-bg-1 overflow-y-auto">
|
||||
<Outlet />
|
||||
</main>
|
||||
<SidePattern />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
import App from './App.tsx'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
const About = () => {
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-5xl font-bold text-heading mb-6">À propos</h1>
|
||||
<p>Contenu de l'association...</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default About;
|
||||
@@ -0,0 +1,8 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"types": ["vite/client"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./tsconfig.app.json" },
|
||||
{ "path": "./tsconfig.node.json" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
"target": "ES2023",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
})
|
||||
Reference in New Issue
Block a user