replacing elements in page directories

This commit is contained in:
2026-06-02 10:06:41 +02:00
parent 2cde72a93c
commit 546a4f4e29
16 changed files with 13 additions and 13 deletions
+160
View File
@@ -0,0 +1,160 @@
'use client';
import { useRef, useEffect, useState } from 'react';
import { useTranslations } from "next-intl";
export default function TimelineSection() {
const sectionRef = useRef<HTMLElement>(null);
const [visible, setVisible] = useState(false);
const t = useTranslations('about');
const lineTop = '58%';
const steps = [
{
title: t('step1.title'),
text: t('step1.text'),
year: '2019',
position: 'top' as const,
left: '16%',
},
{
title: t('step2.title'),
text: t('step2.text'),
year: '2022',
position: 'bottom' as const,
left: '50%',
},
{
title: t('step3.title'),
text: t('step3.text'),
year: '2026',
position: 'top' as const,
left: '84%',
},
];
useEffect(() => {
const section = sectionRef.current;
if (!section) return;
const observer = new IntersectionObserver(
([entry]) => {
if (entry.isIntersecting) {
setVisible(true);
section.querySelectorAll('.reveal').forEach((el) => el.classList.add('visible'));
observer.unobserve(section);
}
},
{ threshold: 0.12 }
);
observer.observe(section);
return () => observer.disconnect();
}, []);
return (
<section id="about" ref={sectionRef} className="w-full py-24 md:py-36 bg-brand-brown/3 rounded-2xl px-6 md:px-12 lg:px-20">
{/* Label */}
<div className="reveal flex items-center gap-3 mb-6">
<span className="w-8 h-px bg-brand-brown/40" />
<span className="font-sans text-[11px] uppercase tracking-[0.2em] text-brand-brown/45">{t('sectionLabel')}</span>
</div>
<h2 className="reveal font-serif text-[clamp(48px,7vw,100px)] leading-none text-brand-brown mb-16 md:mb-24">
{t('title')}
</h2>
{/* Mobile layout */}
<div className="flex flex-col gap-5 md:hidden">
{steps.map((step, i) => (
<div
key={i}
className="reveal rounded-xl border border-brand-brown/12 border-l-4 border-l-brand-brown bg-white/60 p-6 backdrop-blur-sm"
style={{ transitionDelay: `${i * 100}ms` }}
>
<span className="font-sans text-[11px] uppercase tracking-widest text-brand-brown/40 mb-3 block">{step.year}</span>
<h3 className="font-serif text-2xl text-brand-brown mb-3">{step.title}</h3>
<p className="font-sans text-sm leading-relaxed text-brand-brown/65">{step.text}</p>
</div>
))}
</div>
{/* Desktop timeline */}
<div className="hidden md:block relative h-[440px]">
{/* Background track */}
<div
className="absolute left-0 right-0 h-px bg-brand-brown/12 rounded-full"
style={{ top: lineTop }}
/>
{/* Animated progress line */}
<div
className="absolute left-0 h-px bg-brand-brown/50 rounded-full"
style={{
top: lineTop,
width: visible ? '95%' : '0%',
transition: 'width 1400ms cubic-bezier(0.22, 1, 0.36, 1)',
transitionDelay: '200ms',
}}
/>
{steps.map((step, i) => (
<div
key={i}
className="absolute -translate-x-1/2"
style={{ left: step.left, top: lineTop }}
>
{/* Dot */}
<div
className="absolute left-1/2 -translate-x-1/2 -translate-y-1/2"
style={{ top: 0 }}
>
<div
className="h-4 w-4 rounded-full border-2 border-brand-beige bg-brand-brown shadow-[0_0_0_3px_rgba(44,30,22,0.2)]"
style={{
opacity: visible ? 1 : 0,
transform: visible ? 'scale(1)' : 'scale(0)',
transition: 'opacity 400ms ease, transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1)',
transitionDelay: `${600 + i * 200}ms`,
}}
/>
</div>
{/* Year label */}
<div
className="absolute left-1/2 -translate-x-1/2 font-sans text-[10px] uppercase tracking-widest text-brand-brown/35"
style={{
[step.position === 'top' ? 'top' : 'bottom']: '18px',
opacity: visible ? 1 : 0,
transition: 'opacity 400ms ease',
transitionDelay: `${800 + i * 200}ms`,
}}
>
{step.year}
</div>
{/* Card */}
<div
className={[
'absolute left-1/2 w-[260px] -translate-x-1/2 rounded-xl border border-brand-brown/12 border-l-4 border-l-brand-brown bg-white/80 p-5 text-left shadow-sm backdrop-blur-sm',
step.position === 'top' ? 'bottom-10' : 'top-10',
].join(' ')}
style={{
opacity: visible ? 1 : 0,
transform: visible
? 'translateY(0)'
: step.position === 'top' ? 'translateY(10px)' : 'translateY(-10px)',
transition: 'opacity 600ms ease, transform 600ms cubic-bezier(0.22,1,0.36,1)',
transitionDelay: `${700 + i * 180}ms`,
}}
>
<h3 className="font-serif text-xl text-brand-brown mb-2">{step.title}</h3>
<p className="font-sans text-sm leading-relaxed text-brand-brown/65">{step.text}</p>
</div>
</div>
))}
</div>
</section>
);
}
@@ -0,0 +1,82 @@
'use client';
import { useRef, useEffect } from 'react';
import { useTranslations } from "next-intl";
export default function ApproachSection() {
const sectionRef = useRef<HTMLElement>(null);
const t = useTranslations('approach');
const features = [
{
imagePath: '/icons/brain.svg',
title: t('feature1.title'),
text: t('feature1.text'),
},
{
imagePath: '/icons/building.svg',
title: t('feature2.title'),
text: t('feature2.text'),
},
{
imagePath: '/icons/people.svg',
title: t('feature3.title'),
text: t('feature3.text'),
},
];
useEffect(() => {
const section = sectionRef.current;
if (!section) return;
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.querySelectorAll('.reveal').forEach((el) => {
el.classList.add('visible');
});
observer.unobserve(entry.target);
}
});
},
{ threshold: 0.15 }
);
observer.observe(section);
return () => observer.disconnect();
}, []);
return (
<section ref={sectionRef} className="w-full py-24 md:py-36">
{/* Section label */}
<div className="reveal flex items-center gap-3 mb-12 md:mb-16">
<span className="w-8 h-px bg-brand-brown/40" />
<span className="font-sans text-[11px] uppercase tracking-[0.2em] text-brand-brown/45">{t('sectionLabel')}</span>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-12 md:gap-6 lg:gap-16">
{features.map((feature, i) => (
<div
key={i}
className="reveal group flex flex-col items-center p-8 rounded-2xl border border-brand-brown/8 bg-white/40 hover:bg-white/70 hover:border-brand-brown/15 transition-all duration-300 cursor-default"
style={{ transitionDelay: `${i * 120}ms` }}
>
{/* Icon container */}
<div className="w-20 h-20 rounded-2xl bg-brand-brown/5 flex items-center justify-center mb-6 group-hover:bg-brand-brown/8 transition-colors duration-300">
<img className="w-10 h-10" src={feature.imagePath} alt="" aria-hidden="true" />
</div>
<div className="font-serif text-brand-brown text-center leading-[1.1] text-[clamp(1.4rem,2.2vw,1.65rem)] mb-4">
{feature.title}
</div>
<div className="font-sans text-sm text-center text-brand-brown/60 leading-relaxed">
{feature.text}
</div>
</div>
))}
</div>
</section>
);
}
+140
View File
@@ -0,0 +1,140 @@
'use client';
import { useEffect, useRef } from 'react';
import { useTranslations } from "next-intl";
export default function HeroSection() {
const sectionRef = useRef<HTMLElement>(null);
const t = useTranslations('hero');
useEffect(() => {
const section = sectionRef.current;
if (!section) return;
const items = section.querySelectorAll<HTMLElement>('.hero-reveal');
items.forEach((el, i) => {
setTimeout(() => {
el.style.opacity = '1';
el.style.transform = 'translateY(0)';
}, 120 + i * 110);
});
}, []);
return (
<section
id="home"
ref={sectionRef}
className="w-full min-h-[calc(100vh-(2*11px))] rounded-[10px] bg-brand-brown text-brand-beige flex flex-col overflow-hidden relative"
>
{/* Spacer: clears the fixed header (~91px) + mirrors the bottom bar height (~52px)
so justify-center lands on the visual centre of the viewport below the header */}
<div className="shrink-0" style={{ height: 'clamp(120px, 15vh, 160px)' }} />
{/* Main content */}
<div className="flex flex-col lg:flex-row flex-1 items-center px-8 md:px-14 lg:px-20 gap-10 lg:gap-0">
{/* Left — editorial text */}
<div className="flex flex-col justify-center lg:w-[55%] lg:pr-12 gap-8 lg:gap-10">
{/* Label */}
<div
className="hero-reveal"
style={{ opacity: 0, transform: 'translateY(28px)', transition: 'opacity 700ms cubic-bezier(0.22,1,0.36,1), transform 700ms cubic-bezier(0.22,1,0.36,1)' }}
>
<span className="inline-flex items-center gap-2 font-sans text-xs uppercase tracking-[0.2em] text-brand-beige/50">
<span className="w-6 h-px bg-brand-beige/30" />
{t('sectionLabel')}
</span>
</div>
{/* Headline */}
<div
className="hero-reveal"
style={{ opacity: 0, transform: 'translateY(28px)', transition: 'opacity 700ms cubic-bezier(0.22,1,0.36,1), transform 700ms cubic-bezier(0.22,1,0.36,1)' }}
>
<h1 className="font-serif leading-[0.95] text-[clamp(36px,5.5vw,88px)] text-brand-beige">
{t('title')}
</h1>
</div>
{/* Description */}
<div
className="hero-reveal"
style={{ opacity: 0, transform: 'translateY(28px)', transition: 'opacity 700ms cubic-bezier(0.22,1,0.36,1), transform 700ms cubic-bezier(0.22,1,0.36,1)' }}
>
<p className="font-sans text-base font-light text-brand-beige/60 max-w-md leading-relaxed">
{t('subtitle')}
</p>
</div>
{/* CTA */}
<div
className="hero-reveal"
style={{ opacity: 0, transform: 'translateY(28px)', transition: 'opacity 700ms cubic-bezier(0.22,1,0.36,1), transform 700ms cubic-bezier(0.22,1,0.36,1)' }}
>
<a
href="/#works"
className="group inline-flex items-center gap-2 font-sans text-sm text-brand-beige/80 hover:text-brand-beige transition-colors duration-200 cursor-pointer"
onClick={(e) => {
e.preventDefault();
document.getElementById('works')?.scrollIntoView({ behavior: 'smooth' });
}}
>
<span className="relative">
{t('cta')}
<span className="absolute bottom-0 left-0 w-full h-px bg-brand-beige/40 origin-left scale-x-0 group-hover:scale-x-100 transition-transform duration-300" />
</span>
<svg className="w-4 h-4 group-hover:translate-x-1 transition-transform duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M17 8l4 4m0 0l-4 4m4-4H3" />
</svg>
</a>
</div>
</div>
{/* Right — portrait */}
<div
className="hero-reveal relative flex items-center justify-center lg:w-[45%]"
style={{ opacity: 0, transform: 'translateY(28px)', transition: 'opacity 900ms cubic-bezier(0.22,1,0.36,1), transform 900ms cubic-bezier(0.22,1,0.36,1)' }}
>
<div className="relative rounded-[10px] overflow-hidden" style={{ width: 'clamp(260px, 32vw, 420px)', height: 'clamp(320px, 40vw, 520px)' }}>
<img
src="/images/pofile.png"
alt="Mathéo Guilbert, développeur Full Stack"
className="w-full h-full object-cover object-top"
style={{ filter: 'sepia(8%) brightness(0.95) contrast(1.02)' }}
/>
{/* Subtle vignette */}
<div className="absolute inset-0 bg-gradient-to-t from-brand-brown/30 via-transparent to-transparent pointer-events-none" />
</div>
</div>
</div>
{/* Bottom bar — scroll indicator */}
<div className="flex justify-center items-center px-8 md:px-14 lg:px-20 pb-8">
{/* Scroll arrow */}
<div
className="hero-reveal flex flex-col items-center gap-1.5 text-brand-beige/40"
style={{
opacity: 0,
transform: 'translateY(28px)',
transition: 'opacity 700ms cubic-bezier(0.22,1,0.36,1), transform 700ms cubic-bezier(0.22,1,0.36,1)',
animationDelay: '1s'
}}
>
<span className="font-sans text-[10px] uppercase tracking-[0.15em]">{t('scrollPrompt')}</span>
<svg
className="w-4 h-4"
style={{ animation: 'arrowBounce 1.8s ease-in-out infinite' }}
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M19 9l-7 7-7-7" />
</svg>
</div>
</div>
</section>
);
}
+65
View File
@@ -0,0 +1,65 @@
'use client';
import { useRef, useEffect } from 'react';
import { useTranslations } from "next-intl";
import { Project } from "@/lib/projects/types";
import { ProjectCard } from "../../../components/ui/ProjectCard";
type props = {
projects: Project[];
locale: string;
};
export default function WorksSection({ projects, locale }: props) {
const sectionRef = useRef<HTMLElement>(null);
const t = useTranslations('works');
useEffect(() => {
const section = sectionRef.current;
if (!section) return;
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.querySelectorAll('.reveal').forEach((el, i) => {
setTimeout(() => el.classList.add('visible'), i * 120);
});
observer.unobserve(entry.target);
}
});
},
{ threshold: 0.08 }
);
observer.observe(section);
return () => observer.disconnect();
}, []);
return (
<section id="works" ref={sectionRef} className="w-full flex flex-col items-start justify-start pt-20 md:pt-28">
{/* Section label */}
<div className="reveal flex items-center gap-3 mb-4">
<span className="w-8 h-px bg-brand-brown/40" />
<span className="font-sans text-[11px] uppercase tracking-[0.2em] text-brand-brown/45">{t('sectionLabel')}</span>
</div>
<h2 className="reveal font-serif text-[clamp(56px,8vw,112px)] text-brand-brown leading-none mb-12 md:mb-16">
{t('title')}
</h2>
<div className="w-full">
{projects.map((project, index) => (
<ProjectCard
key={project.slug}
project={project}
locale={locale}
isTheLast={index === projects.length - 1}
index={index}
/>
))}
</div>
</section>
);
}