From 92b868d966ee8a808cb5758a1ecbe256fdd78966 Mon Sep 17 00:00:00 2001 From: Gitea Actions <-2+gitea-actions@noreply.localhost> Date: Mon, 19 Oct 2026 21:59:09 +0000 Subject: [PATCH] feat: redesign events gallery and polish site UX (#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --------- Co-authored-by: xEsiah Reviewed-on: https://git.cohaise.dev/Esiah/CoeurUAPam/pulls/1 Reviewed-by: Esiah Co-authored-by: Gitea Actions <-2+gitea-actions@noreply.localhost> --- .github/workflows/pr.yml | 52 +++++ index.html | 5 +- public/android-chrome-192x192.png | 3 + public/apple-touch-icon.png | 3 + public/favicon.ico | Bin 0 -> 15086 bytes public/site.webmanifest | 19 ++ src/App.tsx | 2 + src/components/AnimatedContent.tsx | 8 +- src/components/PageTransition.tsx | 131 +++++++++++ src/components/PillNav.tsx | 26 +-- src/index.css | 21 ++ src/layouts/MainLayout.tsx | 2 +- src/lib/transition.ts | 28 +++ src/pages/Events.tsx | 350 +++++++++++++++++++---------- src/pages/Privacy.tsx | 59 +++-- 15 files changed, 552 insertions(+), 157 deletions(-) create mode 100644 .github/workflows/pr.yml create mode 100644 public/android-chrome-192x192.png create mode 100644 public/apple-touch-icon.png create mode 100644 public/favicon.ico create mode 100644 public/site.webmanifest create mode 100644 src/components/PageTransition.tsx create mode 100644 src/lib/transition.ts diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..12ed7cb --- /dev/null +++ b/.github/workflows/pr.yml @@ -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." diff --git a/index.html b/index.html index bbfe3c5..23ef9de 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,10 @@ - + + + + Coeur UA PAM - Unis par le coeur a&G_? zte^rRx%UPOxXL0Zf`K$_yR4w=zOu~w`_AQt2m!I|A8$UN;d$;nGiT16IsFXATxW`z z+O>_IWsSFzF_FfYvSly)E@{kh^_A3y?oqS$ebaV-?tf>oUlHoUoo||&{*$JGKg;~Zmv8E1=KNXhjz6d8 znfe*WO!bTtX7-LZe#I4kJy6Z|95zE=_nX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fDUupr#naPyo#3dft3Gc1uZu-y%wnA?o@?!KoC@8akdn(qbok=+aC zdRqL+xH-L}ODJD+a{yTE4Lm!PH=aUyK70BWYe~(_yw0U%lvjx+C8Kr=DVZ!~QPPxY zn5i@Z&HPG#z)HJrW-;;^+raO24A?_jmkzaLQecN@nyDDQ^`j7K}U>uAlzGI4`PrJFoHC*@b z4xl%<8-cE(;mhJr=-Xd4CIT47cg8eQEHAj)a~|tfE|-zBAK$CXnj|+5`$7W-dXkt) zV-6_(3}X&^ttg*gcPMXB9^nOiTzqSMdd6}W3jdmScehi1bkJ8mwOxLBN$A{r$^>&) z=I0Z1cji1XPGk9#_;cJd#$TlIP9NVG!&uFk^kCo4rnPrR?V39eeoCE{x-ohZpA8=w zoY@O{o<6=YhW`_xIVW0qchp_myV-K=Ecd<8eb^-Y3;YbmviFeBflX!%W6{H!yHc`! z68(tXoH=o@n~Tjvm*XE}$A~TIqfx7&uE{+L&CQkkNWax}_5~Y{&1DVV@jdW?c*pWY^V6xaUJ1nsxDMsNv!t)3EFG(a`Dcj+WMxK0mAZZ=e%_hmL0~HkjCZ zxb8r651M!Sh*MVfYaLn}JG5Im=w8kLG6aKrB-C56@$#Q?RO`#(ebECwF7*|@(%ep- z{%x<9F6%E`J{62}!sEPj{Wt1MOG;=Mt=3e&^&a(|OG^*M yMb=c`FtxG3O^vJnN72O4ym67Ysjs8^#+bOsTAL+3vQ;KaInK0V%G>@-4fKCOs}5QK literal 0 HcmV?d00001 diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 0000000..f421c69 --- /dev/null +++ b/public/site.webmanifest @@ -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" +} diff --git a/src/App.tsx b/src/App.tsx index 2a50b06..a355fc9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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 ( + }> } /> diff --git a/src/components/AnimatedContent.tsx b/src/components/AnimatedContent.tsx index 79dc45f..07c6694 100644 --- a/src/components/AnimatedContent.tsx +++ b/src/components/AnimatedContent.tsx @@ -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 = ({ 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(); }; diff --git a/src/components/PageTransition.tsx b/src/components/PageTransition.tsx new file mode 100644 index 0000000..d78f306 --- /dev/null +++ b/src/components/PageTransition.tsx @@ -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 = { + "/": "/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(null); + const fillRef = useRef(null); + const textRef = useRef(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 ( +