feat: redesign events gallery and polish site UX
PR — Ouverture automatique / create-pr (push) Successful in 3s
PR — Ouverture automatique / create-pr (push) Successful in 3s
- Events: render each year as a horizontal band of media at native ratio with a chapter card, lightbox (keyboard nav + close), and a progress bar. - Add a route transition overlay that preloads the destination hero image and shows a typed "Unis par le cœur" loading bar; hide the header while active and sync page entrance animations until the transition ends. - Add proper favicon set (favicon.ico, Apple touch icon, Android/PWA icon) and web manifest; fix the icon MIME type. - Mobile menu: replace hover-only feedback with an :active tap state (color + scale), remove sticky hover. - Privacy policy: document server-side relay of Meta content, add hosting/logs and GDPR rights sections.
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
name: PR — Ouverture automatique
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
create-pr:
|
||||
runs-on: coeur-ua-pam
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Ouvrir (ou vérifier) la pull request
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
API: ${{ github.server_url }}/api/v1
|
||||
REPO: ${{ github.repository }}
|
||||
BRANCH: ${{ github.ref_name }}
|
||||
run: |
|
||||
set -eu
|
||||
if [ "$BRANCH" = "main" ]; then
|
||||
echo "main est la base : aucune PR à ouvrir."
|
||||
exit 0
|
||||
fi
|
||||
title=$(git log -1 --pretty=%s)
|
||||
body=$(git log -1 --pretty=%b)
|
||||
[ -n "$body" ] || body="PR automatique de $BRANCH vers main."
|
||||
|
||||
open=$(curl -fsS -H "Authorization: token $GITEA_TOKEN" \
|
||||
"$API/repos/$REPO/pulls?state=open&limit=50" \
|
||||
| python3 -c 'import json,os,sys; b=os.environ["BRANCH"]; print(sum(1 for p in json.load(sys.stdin) if p.get("head", {}).get("ref") == b))')
|
||||
if [ "$open" -gt 0 ]; then
|
||||
echo "Une PR est déjà ouverte pour $BRANCH."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
python3 - "$BRANCH" "$title" "$body" <<'PY' | curl -fsS -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data-binary @- \
|
||||
"$API/repos/$REPO/pulls"
|
||||
import json, sys
|
||||
branch, title, body = sys.argv[1], sys.argv[2], sys.argv[3]
|
||||
print(json.dumps({"base": "main", "head": branch, "title": title, "body": body}))
|
||||
PY
|
||||
echo "PR créée."
|
||||
+4
-1
@@ -2,7 +2,10 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
||||
<link rel="icon" href="/favicon.ico" sizes="any" />
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Coeur UA PAM - Unis par le coeur</title>
|
||||
<link
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "Cœur UA PAM",
|
||||
"short_name": "Cœur UA PAM",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/logo.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#1a247f",
|
||||
"background_color": "#f7f0e5",
|
||||
"display": "standalone"
|
||||
}
|
||||
@@ -6,11 +6,13 @@ import Events from "./pages/Events";
|
||||
import Historic from "./pages/Historic";
|
||||
import Privacy from "./pages/Privacy";
|
||||
import ScrollToTop from "./components/ScrollToTop";
|
||||
import PageTransition from "./components/PageTransition";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<ScrollToTop />
|
||||
<PageTransition />
|
||||
<Routes>
|
||||
<Route path="/" element={<MainLayout />}>
|
||||
<Route path="/" element={<Home />} />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useRef, useEffect } from "react";
|
||||
import { gsap } from "gsap";
|
||||
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
||||
import { runAfterTransition } from "../lib/transition";
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger);
|
||||
|
||||
@@ -96,15 +97,20 @@ const AnimatedContent: React.FC<AnimatedContentProps> = ({
|
||||
ease,
|
||||
});
|
||||
|
||||
let stopWaiting = () => {};
|
||||
|
||||
const st = ScrollTrigger.create({
|
||||
trigger: el,
|
||||
scroller: scrollerTarget || window,
|
||||
start: `top ${startPct}%`,
|
||||
once: true,
|
||||
onEnter: () => tl.play(),
|
||||
onEnter: () => {
|
||||
stopWaiting = runAfterTransition(() => tl.play());
|
||||
},
|
||||
});
|
||||
|
||||
return () => {
|
||||
stopWaiting();
|
||||
st.kill();
|
||||
tl.kill();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
import { useLayoutEffect, useRef } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import logo from "/logo.png";
|
||||
import { markTransitionStart, markTransitionEnd } from "../lib/transition";
|
||||
|
||||
const HERO_IMAGES: Record<string, string> = {
|
||||
"/": "/hero-section/accueil.webp",
|
||||
"/a-propos": "/hero-section/a-propos.webp",
|
||||
"/notre-histoire": "/hero-section/historique.webp",
|
||||
"/evenements": "/hero-section/evenements.webp",
|
||||
};
|
||||
|
||||
const FADE_IN_MS = 220;
|
||||
const BAR_MS = 750;
|
||||
const MIN_VISIBLE_MS = 750;
|
||||
const MAX_WAIT_MS = 2500;
|
||||
|
||||
const PageTransition = () => {
|
||||
const { pathname } = useLocation();
|
||||
const overlayRef = useRef<HTMLDivElement>(null);
|
||||
const fillRef = useRef<HTMLDivElement>(null);
|
||||
const textRef = useRef<HTMLSpanElement>(null);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const overlay = overlayRef.current;
|
||||
const fill = fillRef.current;
|
||||
const text = textRef.current;
|
||||
if (!overlay || !fill || !text) return;
|
||||
|
||||
markTransitionStart();
|
||||
document.documentElement.classList.add("is-transitioning");
|
||||
|
||||
overlay.style.transition = "none";
|
||||
overlay.style.opacity = "0";
|
||||
overlay.style.visibility = "visible";
|
||||
overlay.style.pointerEvents = "auto";
|
||||
fill.style.transition = "none";
|
||||
fill.style.width = "0%";
|
||||
text.style.transition = "none";
|
||||
text.style.clipPath = "inset(0 100% 0 0)";
|
||||
void overlay.offsetWidth;
|
||||
overlay.style.transition = `opacity ${FADE_IN_MS}ms ease-in-out`;
|
||||
overlay.style.opacity = "1";
|
||||
fill.style.transition = `width ${BAR_MS}ms ease-out`;
|
||||
fill.style.width = "100%";
|
||||
text.style.transition = `clip-path ${BAR_MS}ms ease-out`;
|
||||
text.style.clipPath = "inset(0 0% 0 0)";
|
||||
|
||||
const startedAt = performance.now();
|
||||
let done = false;
|
||||
|
||||
const reveal = () => {
|
||||
if (done) return;
|
||||
done = true;
|
||||
markTransitionEnd();
|
||||
document.documentElement.classList.remove("is-transitioning");
|
||||
overlay.style.transition = "none";
|
||||
overlay.style.opacity = "0";
|
||||
overlay.style.visibility = "hidden";
|
||||
overlay.style.pointerEvents = "none";
|
||||
};
|
||||
|
||||
const finishAfterMinimum = () => {
|
||||
const remaining = MIN_VISIBLE_MS - (performance.now() - startedAt);
|
||||
window.setTimeout(reveal, Math.max(0, remaining));
|
||||
};
|
||||
|
||||
const maxTimer = window.setTimeout(reveal, MAX_WAIT_MS);
|
||||
|
||||
const src = HERO_IMAGES[pathname];
|
||||
if (src) {
|
||||
let handled = false;
|
||||
const onReady = () => {
|
||||
if (handled) return;
|
||||
handled = true;
|
||||
window.clearTimeout(maxTimer);
|
||||
finishAfterMinimum();
|
||||
};
|
||||
const image = new Image();
|
||||
image.onload = onReady;
|
||||
image.onerror = onReady;
|
||||
image.src = src;
|
||||
if (image.complete) onReady();
|
||||
} else {
|
||||
window.clearTimeout(maxTimer);
|
||||
finishAfterMinimum();
|
||||
}
|
||||
|
||||
return () => {
|
||||
window.clearTimeout(maxTimer);
|
||||
document.documentElement.classList.remove("is-transitioning");
|
||||
};
|
||||
}, [pathname]);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={overlayRef}
|
||||
aria-hidden="true"
|
||||
style={{ opacity: 0, visibility: "hidden", pointerEvents: "none" }}
|
||||
className="fixed inset-0 z-[2000] bg-bg-1"
|
||||
>
|
||||
<div className="flex h-full items-center justify-center">
|
||||
<img
|
||||
src={logo}
|
||||
alt=""
|
||||
className="h-40 w-40 animate-pulse md:h-56 md:w-56"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="absolute inset-x-0 bottom-0 h-16 overflow-hidden bg-primary/10">
|
||||
<span className="absolute inset-0 flex items-center justify-center whitespace-nowrap text-sm font-semibold uppercase tracking-[0.3em] text-primary/25">
|
||||
Unis par le cœur
|
||||
</span>
|
||||
<div
|
||||
ref={fillRef}
|
||||
style={{ width: "0%" }}
|
||||
className="absolute inset-y-0 left-0 bg-primary"
|
||||
/>
|
||||
<span
|
||||
ref={textRef}
|
||||
style={{ clipPath: "inset(0 100% 0 0)" }}
|
||||
className="absolute inset-0 flex items-center justify-center whitespace-nowrap text-sm font-semibold uppercase tracking-[0.3em] text-white"
|
||||
>
|
||||
Unis par le cœur
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PageTransition;
|
||||
@@ -462,7 +462,7 @@ const PillNav: React.FC<PillNavProps> = ({
|
||||
onClick={toggleMobileMenu}
|
||||
aria-label="Toggle menu"
|
||||
aria-expanded={isMobileMenuOpen}
|
||||
className="md:hidden rounded-full border-0 flex flex-col items-center justify-center gap-1 cursor-pointer p-0 relative"
|
||||
className="md:hidden rounded-full border-0 flex flex-col items-center justify-center gap-1 cursor-pointer p-0 relative transition-transform duration-150 active:scale-90"
|
||||
style={{
|
||||
width: "var(--nav-h)",
|
||||
height: "var(--nav-h)",
|
||||
@@ -488,22 +488,8 @@ const PillNav: React.FC<PillNavProps> = ({
|
||||
>
|
||||
<ul className="list-none m-0 flex flex-col gap-2">
|
||||
{items.map((item) => {
|
||||
const defaultStyle: React.CSSProperties = {
|
||||
background: "var(--pill-bg)",
|
||||
color: "var(--pill-text)",
|
||||
};
|
||||
|
||||
const hoverIn = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
||||
e.currentTarget.style.background = "var(--color-bg-2)";
|
||||
e.currentTarget.style.color = "var(--color-heading-accent)";
|
||||
};
|
||||
const hoverOut = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
||||
e.currentTarget.style.background = "var(--pill-bg)";
|
||||
e.currentTarget.style.color = "var(--pill-text)";
|
||||
};
|
||||
|
||||
const linkClasses =
|
||||
"block py-4 px-6 text-[16px] font-semibold rounded-b-[20px] transition-all duration-200 uppercase tracking-wide text-center shadow-md";
|
||||
"mobile-menu-link block py-4 px-6 text-[16px] font-semibold rounded-b-[20px] transition-all duration-200 uppercase tracking-wide text-center shadow-md";
|
||||
|
||||
return (
|
||||
<li key={item.href}>
|
||||
@@ -511,10 +497,7 @@ const PillNav: React.FC<PillNavProps> = ({
|
||||
<Link
|
||||
to={item.href}
|
||||
className={linkClasses}
|
||||
style={defaultStyle}
|
||||
onMouseEnter={hoverIn}
|
||||
onMouseLeave={hoverOut}
|
||||
onClick={closeMobileMenu} // On appelle bien notre fonction qui modifie l'état et lance l'animation de fermeture
|
||||
onClick={closeMobileMenu}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
@@ -522,9 +505,6 @@ const PillNav: React.FC<PillNavProps> = ({
|
||||
<a
|
||||
href={item.href}
|
||||
className={linkClasses}
|
||||
style={defaultStyle}
|
||||
onMouseEnter={hoverIn}
|
||||
onMouseLeave={hoverOut}
|
||||
onClick={closeMobileMenu}
|
||||
>
|
||||
{item.label}
|
||||
|
||||
@@ -18,6 +18,27 @@
|
||||
text-orientation: mixed;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.site-header {
|
||||
transition: opacity 150ms ease-out;
|
||||
}
|
||||
|
||||
.mobile-menu-link {
|
||||
background-color: var(--pill-bg);
|
||||
color: var(--pill-text);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.mobile-menu-link:active {
|
||||
background-color: var(--color-bg-2);
|
||||
color: var(--color-heading-accent);
|
||||
transform: scale(0.96);
|
||||
}
|
||||
}
|
||||
|
||||
.is-transitioning .site-header {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
|
||||
@@ -18,7 +18,7 @@ export const MainLayout = () => {
|
||||
return (
|
||||
<div className="flex flex-col min-h-screen bg-bg-1 font-sans text-site-text">
|
||||
{/* NAVIGATION */}
|
||||
<div className="fixed top-0 left-0 w-full z-50 flex justify-center pt-4 md:pt-6 pointer-events-none px-4 md:px-0">
|
||||
<div className="site-header fixed top-0 left-0 w-full z-50 flex justify-center pt-4 md:pt-6 pointer-events-none px-4 md:px-0">
|
||||
<div className="pointer-events-auto flex items-center justify-between w-full md:w-auto md:justify-center gap-4 max-w-400">
|
||||
<PillNav
|
||||
logo={logo}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
const TRANSITION_END_EVENT = "cup:transition-end";
|
||||
|
||||
let transitionActive = false;
|
||||
|
||||
export const markTransitionStart = () => {
|
||||
transitionActive = true;
|
||||
};
|
||||
|
||||
export const markTransitionEnd = () => {
|
||||
if (!transitionActive) return;
|
||||
transitionActive = false;
|
||||
window.dispatchEvent(new Event(TRANSITION_END_EVENT));
|
||||
};
|
||||
|
||||
export const runAfterTransition = (callback: () => void): (() => void) => {
|
||||
if (!transitionActive) {
|
||||
callback();
|
||||
return () => {};
|
||||
}
|
||||
|
||||
const handler = () => {
|
||||
window.removeEventListener(TRANSITION_END_EVENT, handler);
|
||||
callback();
|
||||
};
|
||||
|
||||
window.addEventListener(TRANSITION_END_EVENT, handler);
|
||||
return () => window.removeEventListener(TRANSITION_END_EVENT, handler);
|
||||
};
|
||||
+233
-117
@@ -1,4 +1,4 @@
|
||||
import { useLayoutEffect, useRef, useState, useCallback } from "react";
|
||||
import { useLayoutEffect, useRef, useState, useCallback, useEffect } from "react";
|
||||
import AnimatedContent from "../components/AnimatedContent";
|
||||
import SEO from "../components/SEO";
|
||||
|
||||
@@ -29,14 +29,137 @@ interface Category {
|
||||
history: HistoryItem[];
|
||||
}
|
||||
|
||||
interface YearGroupImage {
|
||||
item: EventImage;
|
||||
index: number;
|
||||
}
|
||||
|
||||
interface YearGroup {
|
||||
year: string;
|
||||
title: string;
|
||||
bg: string;
|
||||
text: string;
|
||||
images: EventImage[];
|
||||
images: YearGroupImage[];
|
||||
}
|
||||
|
||||
const isVideo = (src?: string) => !!src && /\.(mp4|webm)$/i.test(src);
|
||||
|
||||
// ============================================================================
|
||||
// SOUS-COMPOSANT : Lightbox plein écran (images + vidéos)
|
||||
// ============================================================================
|
||||
const Lightbox = ({
|
||||
items,
|
||||
index,
|
||||
onClose,
|
||||
onNavigate,
|
||||
}: {
|
||||
items: EventImage[];
|
||||
index: number;
|
||||
onClose: () => void;
|
||||
onNavigate: (index: number) => void;
|
||||
}) => {
|
||||
const item = items[index];
|
||||
|
||||
useEffect(() => {
|
||||
const onKey = (event: KeyboardEvent) => {
|
||||
if (event.key === "Escape") onClose();
|
||||
else if (event.key === "ArrowRight")
|
||||
onNavigate((index + 1) % items.length);
|
||||
else if (event.key === "ArrowLeft")
|
||||
onNavigate((index - 1 + items.length) % items.length);
|
||||
};
|
||||
window.addEventListener("keydown", onKey);
|
||||
const previousOverflow = document.body.style.overflow;
|
||||
document.body.style.overflow = "hidden";
|
||||
return () => {
|
||||
window.removeEventListener("keydown", onKey);
|
||||
document.body.style.overflow = previousOverflow;
|
||||
};
|
||||
}, [index, items.length, onClose, onNavigate]);
|
||||
|
||||
if (!item) return null;
|
||||
|
||||
const previous = () => onNavigate((index - 1 + items.length) % items.length);
|
||||
const next = () => onNavigate((index + 1) % items.length);
|
||||
|
||||
return (
|
||||
<div
|
||||
className="fixed inset-0 z-[1500] flex items-center justify-center bg-black/90 p-4 backdrop-blur-sm md:p-10"
|
||||
onClick={onClose}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Fermer"
|
||||
onClick={onClose}
|
||||
className="absolute right-4 top-4 z-10 flex h-11 w-11 items-center justify-center rounded-full bg-white/10 text-2xl text-white transition-colors hover:bg-white/25 md:right-8 md:top-6"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
|
||||
{items.length > 1 && (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Média précédent"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
previous();
|
||||
}}
|
||||
className="absolute left-3 z-10 flex h-11 w-11 items-center justify-center rounded-full bg-white/10 text-2xl text-white transition-colors hover:bg-white/25 md:left-8"
|
||||
>
|
||||
‹
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Média suivant"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
next();
|
||||
}}
|
||||
className="absolute right-3 z-10 flex h-11 w-11 items-center justify-center rounded-full bg-white/10 text-2xl text-white transition-colors hover:bg-white/25 md:right-8"
|
||||
>
|
||||
›
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
|
||||
<figure
|
||||
className="flex max-h-[88vh] max-w-[92vw] flex-col items-center gap-4"
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
>
|
||||
{isVideo(item.src) ? (
|
||||
<video
|
||||
src={item.src}
|
||||
controls
|
||||
autoPlay
|
||||
loop
|
||||
playsInline
|
||||
className="max-h-[80vh] max-w-[92vw] rounded-xl shadow-2xl"
|
||||
/>
|
||||
) : (
|
||||
<img
|
||||
src={item.src}
|
||||
alt={item.alt}
|
||||
className="max-h-[80vh] max-w-[92vw] rounded-xl object-contain shadow-2xl"
|
||||
/>
|
||||
)}
|
||||
{(item.imageTitle || item.imageDesc) && (
|
||||
<figcaption className="max-w-2xl text-center text-white/85">
|
||||
{item.imageTitle && (
|
||||
<div className="text-lg font-semibold">{item.imageTitle}</div>
|
||||
)}
|
||||
{item.imageDesc && (
|
||||
<div className="text-sm text-white/70">{item.imageDesc}</div>
|
||||
)}
|
||||
</figcaption>
|
||||
)}
|
||||
</figure>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// SOUS-COMPOSANT : Gère l'effet "Scroll Vertical -> Glissement Horizontal"
|
||||
// ============================================================================
|
||||
@@ -45,10 +168,16 @@ const CategoryHorizontalScroll = ({ category }: { category: Category }) => {
|
||||
const trackRef = useRef<HTMLDivElement>(null);
|
||||
const [progress, setProgress] = useState(0);
|
||||
const [maxTranslate, setMaxTranslate] = useState(0);
|
||||
const [trackHeight, setTrackHeight] = useState("100vh");
|
||||
const [lightboxIndex, setLightboxIndex] = useState<number | null>(null);
|
||||
|
||||
const media = category.history.filter(
|
||||
(item): item is EventImage => item.type === "image",
|
||||
);
|
||||
|
||||
// 1. On regroupe les images par année
|
||||
const groupedHistory: YearGroup[] = [];
|
||||
let currentYear: YearGroup | null = null;
|
||||
let mediaIndex = 0;
|
||||
|
||||
category.history.forEach((item: HistoryItem) => {
|
||||
if (item.type === "intro") {
|
||||
@@ -62,171 +191,158 @@ const CategoryHorizontalScroll = ({ category }: { category: Category }) => {
|
||||
groupedHistory.push(newYearGroup);
|
||||
currentYear = newYearGroup;
|
||||
} else if (item.type === "image" && currentYear) {
|
||||
currentYear.images.push(item);
|
||||
currentYear.images.push({ item, index: mediaIndex });
|
||||
mediaIndex += 1;
|
||||
}
|
||||
});
|
||||
|
||||
// 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));
|
||||
const maxScroll = rect.height - window.innerHeight;
|
||||
if (maxScroll <= 0) {
|
||||
setProgress(0);
|
||||
return;
|
||||
}
|
||||
const p = Math.max(0, Math.min(1, -rect.top / maxScroll));
|
||||
setProgress(p);
|
||||
}, []);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const updateMeasurements = () => {
|
||||
if (trackRef.current) {
|
||||
const max = trackRef.current.scrollWidth - window.innerWidth + 80;
|
||||
setMaxTranslate(max > 0 ? max : 0);
|
||||
}
|
||||
const track = trackRef.current;
|
||||
if (!track) return;
|
||||
|
||||
const measure = () => {
|
||||
const max = Math.max(0, track.scrollWidth - window.innerWidth + 80);
|
||||
setMaxTranslate(max);
|
||||
setTrackHeight(`${window.innerHeight + max}px`);
|
||||
};
|
||||
|
||||
updateMeasurements();
|
||||
window.addEventListener("resize", updateMeasurements);
|
||||
measure();
|
||||
const observer = new ResizeObserver(measure);
|
||||
observer.observe(track);
|
||||
window.addEventListener("resize", measure);
|
||||
window.addEventListener("scroll", handleScroll, { passive: true });
|
||||
handleScroll();
|
||||
const raf = requestAnimationFrame(handleScroll);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("resize", updateMeasurements);
|
||||
cancelAnimationFrame(raf);
|
||||
observer.disconnect();
|
||||
window.removeEventListener("resize", measure);
|
||||
window.removeEventListener("scroll", handleScroll);
|
||||
};
|
||||
}, [handleScroll]);
|
||||
|
||||
const containerHeight = `${(groupedHistory.length + 1) * 80}vh`;
|
||||
|
||||
return (
|
||||
<section
|
||||
ref={containerRef}
|
||||
style={{ height: containerHeight }}
|
||||
style={{ height: trackHeight }}
|
||||
className="relative w-full"
|
||||
>
|
||||
<div className="sticky top-0 h-screen w-full flex items-center overflow-hidden bg-bg-1">
|
||||
<div className="sticky top-0 flex h-screen w-full items-center overflow-hidden bg-bg-1">
|
||||
<div
|
||||
ref={trackRef}
|
||||
className="flex items-center gap-12 md:gap-24 w-max px-6 md:px-20 will-change-transform"
|
||||
className="flex w-max items-center gap-10 px-6 will-change-transform md:gap-16 md:px-20"
|
||||
style={{
|
||||
transform: `translate3d(-${progress * maxTranslate}px, 0, 0)`,
|
||||
}}
|
||||
>
|
||||
<div className="w-[85vw] md:w-[40vw] shrink-0 pl-2">
|
||||
<div className="w-[78vw] shrink-0 md:w-[32vw]">
|
||||
<h2
|
||||
className={`text-5xl md:text-7xl lg:text-8xl font-black tracking-tight mb-6 ${category.themeColor}`}
|
||||
className={`mb-6 text-4xl font-black tracking-tight md:text-6xl lg:text-7xl ${category.themeColor}`}
|
||||
>
|
||||
{category.title}
|
||||
</h2>
|
||||
<div className="w-20 h-2 bg-heading-accent rounded-full mb-8"></div>
|
||||
<p className="text-xl md:text-2xl text-site-text/80 leading-relaxed font-light">
|
||||
<div className="mb-8 h-2 w-20 rounded-full bg-heading-accent" />
|
||||
<p className="text-xl font-light leading-relaxed text-site-text/80 md:text-2xl">
|
||||
{category.description}
|
||||
</p>
|
||||
<p className="mt-6 text-xs uppercase tracking-[0.25em] text-site-text/40">
|
||||
{groupedHistory.length} année
|
||||
{groupedHistory.length > 1 ? "s" : ""} · {media.length} média
|
||||
{media.length > 1 ? "s" : ""}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{groupedHistory.map((yearGroup, index) => (
|
||||
{groupedHistory.map((yearGroup) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`w-[85vw] md:w-[65vw] lg:w-[50vw] h-[65vh] md:h-[75vh] shrink-0 rounded-[40px] shadow-2xl flex flex-col p-6 md:p-10 border border-black/5 ${yearGroup.bg} ${yearGroup.text}`}
|
||||
key={yearGroup.year}
|
||||
className="flex shrink-0 items-center gap-6 md:gap-10"
|
||||
>
|
||||
<div className="mb-6 flex flex-col gap-1">
|
||||
<h3 className="text-6xl md:text-7xl font-black opacity-90 tracking-tighter">
|
||||
<div
|
||||
className={`flex h-[46vh] w-24 shrink-0 flex-col items-center justify-center gap-3 rounded-[28px] border border-black/5 px-2 text-center shadow-lg md:h-[54vh] md:w-32 ${yearGroup.bg} ${yearGroup.text}`}
|
||||
>
|
||||
<span className="text-2xl font-black tracking-tighter md:text-3xl">
|
||||
{yearGroup.year}
|
||||
</h3>
|
||||
<p className="text-2xl md:text-3xl font-medium">
|
||||
{yearGroup.title}
|
||||
</p>
|
||||
</span>
|
||||
{yearGroup.title && (
|
||||
<span className="text-[10px] font-medium leading-snug md:text-xs">
|
||||
{yearGroup.title}
|
||||
</span>
|
||||
)}
|
||||
<span className="text-[10px] uppercase tracking-widest opacity-60">
|
||||
{yearGroup.images.length} média
|
||||
{yearGroup.images.length > 1 ? "s" : ""}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 gap-3 md:gap-4 flex-1">
|
||||
{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 (
|
||||
<div
|
||||
key={idx}
|
||||
className={`relative rounded-2xl overflow-hidden bg-black/10 ${spanClass} group`}
|
||||
>
|
||||
{isVideo ? (
|
||||
<div className="flex shrink-0 items-center gap-4 md:gap-6">
|
||||
{yearGroup.images.map(({ item, index }) => (
|
||||
<button
|
||||
key={index}
|
||||
type="button"
|
||||
aria-label={item.alt || "Agrandir le média"}
|
||||
onClick={() => setLightboxIndex(index)}
|
||||
className="group relative shrink-0 cursor-zoom-in overflow-hidden rounded-2xl shadow-xl"
|
||||
>
|
||||
{isVideo(item.src) ? (
|
||||
<>
|
||||
<video
|
||||
src={img.src}
|
||||
autoPlay
|
||||
loop
|
||||
src={item.src}
|
||||
muted
|
||||
loop
|
||||
playsInline
|
||||
preload="metadata"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"
|
||||
className="block h-[46vh] w-auto max-w-[75vw] object-cover transition-transform duration-700 group-hover:scale-105 md:h-[54vh]"
|
||||
/>
|
||||
) : img.src ? (
|
||||
<img
|
||||
src={img.src}
|
||||
alt={img.alt}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"
|
||||
/>
|
||||
) : (
|
||||
<div className="absolute inset-0 flex items-center justify-center text-sm opacity-50 bg-white/10">
|
||||
Pas de média
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(img.imageTitle || img.imageDesc) && (
|
||||
<div className="absolute bottom-0 left-0 w-full p-4 md:p-6 bg-linear-to-t from-black/90 via-black/40 to-transparent">
|
||||
{img.imageTitle && (
|
||||
<h4 className="text-white font-bold text-base md:text-lg mb-1 drop-shadow-md">
|
||||
{img.imageTitle}
|
||||
</h4>
|
||||
)}
|
||||
{img.imageDesc && (
|
||||
<p className="text-white/90 text-sm md:text-base leading-snug hidden md:block drop-shadow-sm">
|
||||
{img.imageDesc}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<span className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
||||
<span className="flex h-12 w-12 items-center justify-center rounded-full bg-black/50 text-white">
|
||||
▶
|
||||
</span>
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<img
|
||||
src={item.src}
|
||||
alt={item.alt}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className="block h-[46vh] w-auto max-w-[75vw] object-cover transition-transform duration-700 group-hover:scale-105 md:h-[54vh]"
|
||||
/>
|
||||
)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="absolute bottom-0 left-0 h-1 w-full bg-black/5">
|
||||
<div
|
||||
className="h-full bg-heading-accent"
|
||||
style={{ width: `${progress * 100}%` }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{lightboxIndex !== null && (
|
||||
<Lightbox
|
||||
items={media}
|
||||
index={lightboxIndex}
|
||||
onClose={() => setLightboxIndex(null)}
|
||||
onNavigate={setLightboxIndex}
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
};
|
||||
@@ -379,7 +495,7 @@ export default function Events() {
|
||||
type: "intro",
|
||||
year: "2022",
|
||||
title: "Notre premier rassemblement",
|
||||
bg: "bg-[#f7f0e5]",
|
||||
bg: "bg-white",
|
||||
text: "text-[#1a247f]",
|
||||
},
|
||||
{
|
||||
@@ -455,7 +571,7 @@ export default function Events() {
|
||||
type: "intro",
|
||||
year: "2024",
|
||||
title: "Un Noël de Solidarité",
|
||||
bg: "bg-[#f7f0e5]",
|
||||
bg: "bg-white",
|
||||
text: "text-[#1a247f]",
|
||||
},
|
||||
{
|
||||
|
||||
+45
-14
@@ -1,11 +1,7 @@
|
||||
import AnimatedContent from "../components/AnimatedContent";
|
||||
|
||||
const Privacy = () => {
|
||||
const lastUpdate = new Date().toLocaleDateString("fr-FR", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
});
|
||||
const lastUpdate = "19 octobre 2026";
|
||||
|
||||
return (
|
||||
<div className="w-full pt-32 pb-20 bg-bg-1 min-h-screen">
|
||||
@@ -50,6 +46,7 @@ const Privacy = () => {
|
||||
<li>Aucun formulaire d'inscription.</li>
|
||||
<li>Aucun système de commentaire.</li>
|
||||
<li>Aucune inscription à une newsletter.</li>
|
||||
<li>Aucun profil de navigation ni mesure d'audience.</li>
|
||||
</ul>
|
||||
</section>
|
||||
</AnimatedContent>
|
||||
@@ -62,8 +59,9 @@ const Privacy = () => {
|
||||
<p>
|
||||
Ce site n'utilise{" "}
|
||||
<strong>aucun cookie publicitaire ou de traçage</strong> (Google
|
||||
Analytics, Pixels, etc.). L'unique contenu tiers (les actualités
|
||||
de notre page Facebook) n'est chargé{" "}
|
||||
Analytics, Pixels, etc.). L'actualité de notre page Facebook —
|
||||
textes et images — est relayée par notre propre serveur et n'est
|
||||
affichée{" "}
|
||||
<strong>qu'après votre consentement explicite</strong> via la
|
||||
bannière prévue à cet effet.
|
||||
</p>
|
||||
@@ -79,7 +77,7 @@ const Privacy = () => {
|
||||
<AnimatedContent distance={20} direction="vertical" delay={0.4}>
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold text-primary mb-4">
|
||||
4. Services Tiers
|
||||
4. Contenus et services tiers
|
||||
</h2>
|
||||
<p className="mb-4">
|
||||
Notre site utilise certaines fonctionnalités externes pour
|
||||
@@ -88,11 +86,13 @@ const Privacy = () => {
|
||||
<ul className="list-disc pl-6 space-y-4 marker:text-hover-nav">
|
||||
<li>
|
||||
<strong>Facebook / Meta :</strong> Nous affichons les
|
||||
actualités publiques de notre page Facebook. Ce contenu n'est
|
||||
chargé qu'après votre accord. Aucune donnée vous concernant
|
||||
n'est envoyée à Facebook tant que vous n'avez pas accepté,
|
||||
et vous pouvez à tout moment consulter la page via un lien
|
||||
direct sans charger le contenu intégré.
|
||||
actualités publiques de notre page Facebook. Pour protéger
|
||||
votre vie privée, les publications et les images ne sont pas
|
||||
chargées directement depuis les serveurs de Meta : elles
|
||||
transitent par notre propre serveur. Aucune donnée vous
|
||||
concernant n'est transmise à Meta tant que vous n'avez pas
|
||||
accepté, et vous pouvez à tout moment consulter la page via un
|
||||
lien direct sans charger le contenu intégré.
|
||||
</li>
|
||||
<li>
|
||||
<strong>HelloAsso / Leetchi :</strong> Les boutons de don
|
||||
@@ -107,7 +107,38 @@ const Privacy = () => {
|
||||
<AnimatedContent distance={20} direction="vertical" delay={0.5}>
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold text-primary mb-4">
|
||||
5. Contact
|
||||
5. Hébergement et journaux
|
||||
</h2>
|
||||
<p>
|
||||
Le site est hébergé sur une infrastructure dédiée située dans
|
||||
l'Union européenne. Comme la plupart des serveurs web, celui-ci
|
||||
peut enregistrer des données techniques (adresse IP, type de
|
||||
navigateur, date et heure de connexion) à des fins de sécurité
|
||||
et de bon fonctionnement. Ces journaux ne sont ni exploités à
|
||||
des fins commerciales, ni cédés à des tiers.
|
||||
</p>
|
||||
</section>
|
||||
</AnimatedContent>
|
||||
|
||||
<AnimatedContent distance={20} direction="vertical" delay={0.6}>
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold text-primary mb-4">
|
||||
6. Vos droits
|
||||
</h2>
|
||||
<p>
|
||||
Conformément au Règlement Général sur la Protection des Données
|
||||
(RGPD), vous disposez d'un droit d'accès, de rectification,
|
||||
d'effacement et d'opposition sur les données vous concernant.
|
||||
Pour exercer ces droits, vous pouvez nous contacter à l'adresse
|
||||
indiquée ci-dessous.
|
||||
</p>
|
||||
</section>
|
||||
</AnimatedContent>
|
||||
|
||||
<AnimatedContent distance={20} direction="vertical" delay={0.7}>
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold text-primary mb-4">
|
||||
7. Contact
|
||||
</h2>
|
||||
<p>
|
||||
Pour toute question concernant cette politique ou l'association,
|
||||
|
||||
Reference in New Issue
Block a user