PR — Ouverture automatique / create-pr (push) Successful in 4s
Scroll system - Completely reworked `useRegionScroll` controller: paginated region-by-region scroll (wheel/swipe/arrows/Home/End/Space), native scroll neutralized, regions taller than viewport split into screens, time-based rAF animation, interruption only on effective deviation. - Region resolution in 3 levels: `data-region` (single element), `data-region-children` (each direct child), `.page-snap-section` as fallback. Added `data-no-region` to exclude hero/title. - Homepage: entire MagicBento as a single region. Projects page: one stop per project (`HorizontalMotion` with `data-region-children`), category title preserved, hero excluded. - Project detail pages (ProjectPage): hero excluded from regions, media in `data-region-children`, download button as separate region. - Contact/PageShell: updated markers, removed empty zones (no forced `min-height` on `.page-snap-section`). - Removed unbounded `--region-tail` in favor of capped reserve (15vh) + merged landing spots too close to each other. - Do not re-enable native `scroll-snap-type` (Chrome proximity snap traps the user on the first region). Content - Added Ensemble Scolaire Jean XXIII project page (Défi 6e - Class Life, CRM, Inventory IT) with images, wired into the route table, the projects list, the home bento grid and the navigation menu. - Sitemap: added the missing `/projects/hinterraum` and `/projects/overclock-uprising` routes, both live in `App.tsx`. Layout & navigation - Extracted shared `PageShell` and `ProjectPage` layout components. - Navigation: more reliable scroll-to-top, footer "Co Hai Se" bold with target cursor. - ZIP download: stopped propagation + global click handler ignores download. - Various fixes (cursor, 404, layouts), typecheck/ignoreDeprecations adjusted. Docs - Consolidated into `docs/AGENTS.md` as the single source of truth; removed the redundant `docs/README.md` and `docs/ROADMAP.md`.
157 lines
4.0 KiB
TypeScript
157 lines
4.0 KiB
TypeScript
import { ReactNode } from "react";
|
|
import AnimatedContent from "../AnimatedContent";
|
|
import SEO from "../SEO";
|
|
import DownloadButton from "../DownloadButton";
|
|
|
|
export interface ProjectMedia {
|
|
src: string;
|
|
alt: string;
|
|
href?: string;
|
|
}
|
|
|
|
interface ProjectPageProps {
|
|
title: string;
|
|
subtitle: string;
|
|
description: string;
|
|
media?: ProjectMedia[];
|
|
downloadId?: string;
|
|
children?: ReactNode;
|
|
headerDelay?: number;
|
|
}
|
|
|
|
const ProjectPage = ({
|
|
title,
|
|
subtitle,
|
|
description,
|
|
media = [],
|
|
downloadId,
|
|
children,
|
|
headerDelay = 0.1,
|
|
}: ProjectPageProps) => {
|
|
return (
|
|
<div className="layout-page w-full">
|
|
<SEO title={title} description={description} />
|
|
|
|
<div
|
|
className="page-snap-section w-full flex flex-col items-center"
|
|
data-no-region
|
|
>
|
|
<AnimatedContent
|
|
distance={50}
|
|
direction="vertical"
|
|
reverse={false}
|
|
duration={2}
|
|
ease="power3.out"
|
|
initialOpacity={0}
|
|
animateOpacity
|
|
scale={1}
|
|
delay={headerDelay}
|
|
>
|
|
<section className="main-section">
|
|
<h1 className="title">{title}</h1>
|
|
<p className="subtitle">{subtitle}</p>
|
|
</section>
|
|
</AnimatedContent>
|
|
</div>
|
|
|
|
{children && (
|
|
<div className="page-snap-section w-full">
|
|
<AnimatedContent
|
|
distance={80}
|
|
direction="vertical"
|
|
reverse={false}
|
|
duration={1.2}
|
|
ease="power3.out"
|
|
initialOpacity={0}
|
|
animateOpacity
|
|
scale={1}
|
|
delay={0.2}
|
|
>
|
|
{children}
|
|
</AnimatedContent>
|
|
</div>
|
|
)}
|
|
|
|
{media.length > 0 && (
|
|
<div className="page-snap-section w-full">
|
|
<AnimatedContent
|
|
distance={80}
|
|
direction="vertical"
|
|
reverse={false}
|
|
duration={1.2}
|
|
ease="power3.out"
|
|
initialOpacity={0}
|
|
animateOpacity
|
|
scale={1}
|
|
delay={0.25}
|
|
>
|
|
<div
|
|
data-region-children
|
|
className={`flex flex-col md:flex-row w-[90%] mx-auto gap-6 md:gap-10 justify-center ${
|
|
media.length > 1 ? "" : "items-center"
|
|
}`}
|
|
>
|
|
{media.map((item, index) => {
|
|
const image = (
|
|
<img
|
|
className="w-full rounded-[20px] hover:opacity-80 transition-opacity"
|
|
src={item.src}
|
|
alt={item.alt}
|
|
/>
|
|
);
|
|
|
|
if (item.href) {
|
|
return (
|
|
<a
|
|
key={index}
|
|
href={item.href}
|
|
target={item.href.startsWith("http") ? "_blank" : undefined}
|
|
rel={
|
|
item.href.startsWith("http")
|
|
? "noopener noreferrer"
|
|
: undefined
|
|
}
|
|
className="flex justify-center w-full md:w-1/2 mx-auto cursor-target"
|
|
>
|
|
{image}
|
|
</a>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div
|
|
key={index}
|
|
className="flex justify-center w-full md:w-1/2 mx-auto"
|
|
>
|
|
{image}
|
|
</div>
|
|
);
|
|
})}
|
|
</div>
|
|
</AnimatedContent>
|
|
</div>
|
|
)}
|
|
|
|
{downloadId && (
|
|
<div className="page-snap-section w-full" data-region>
|
|
<AnimatedContent
|
|
distance={60}
|
|
direction="vertical"
|
|
reverse={false}
|
|
duration={1.2}
|
|
ease="power3.out"
|
|
initialOpacity={0}
|
|
animateOpacity
|
|
scale={1}
|
|
delay={0.3}
|
|
>
|
|
<DownloadButton projectId={downloadId} />
|
|
</AnimatedContent>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default ProjectPage;
|