feat: add InfiniteCarousel component and Cohaise page with service details and tech logos
This commit is contained in:
@@ -119,8 +119,14 @@ const AnimatedContent: React.FC<AnimatedContentProps> = ({
|
||||
once: true,
|
||||
onEnter: () => tl.play(),
|
||||
});
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
ScrollTrigger.refresh();
|
||||
});
|
||||
|
||||
resizeObserver.observe(document.body);
|
||||
|
||||
return () => {
|
||||
resizeObserver.disconnect();
|
||||
st.kill();
|
||||
tl.kill();
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@ import React, { useRef, useEffect, useState } from "react";
|
||||
import { gsap } from "gsap";
|
||||
import { ScrollToPlugin } from "gsap/ScrollToPlugin";
|
||||
import "./FlowingMenu.css";
|
||||
import AnimatedContent from "./AnimatedContent";
|
||||
|
||||
gsap.registerPlugin(ScrollToPlugin);
|
||||
|
||||
@@ -193,35 +194,48 @@ const MenuItem: React.FC<MenuItemProps> = ({
|
||||
ref={itemRef}
|
||||
style={{ borderColor }}
|
||||
>
|
||||
<div
|
||||
className="menu__item-link"
|
||||
onClick={onClick}
|
||||
onMouseEnter={() =>
|
||||
!isOpen &&
|
||||
gsap.to(marqueeRef.current, { y: "0%", duration: 0.6, ease: "expo" })
|
||||
}
|
||||
onMouseLeave={() =>
|
||||
gsap.to(marqueeRef.current, {
|
||||
y: "101%",
|
||||
duration: 0.6,
|
||||
ease: "expo",
|
||||
})
|
||||
}
|
||||
<AnimatedContent
|
||||
distance={160}
|
||||
direction="horizontal"
|
||||
reverse={true}
|
||||
duration={2}
|
||||
ease="power3.out"
|
||||
initialOpacity={0}
|
||||
animateOpacity
|
||||
scale={1}
|
||||
delay={0.1}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="menu__item-link"
|
||||
onClick={onClick}
|
||||
onMouseEnter={() =>
|
||||
!isOpen &&
|
||||
gsap.to(marqueeRef.current, {
|
||||
y: "0%",
|
||||
duration: 0.6,
|
||||
ease: "expo",
|
||||
})
|
||||
}
|
||||
onMouseLeave={() =>
|
||||
gsap.to(marqueeRef.current, {
|
||||
y: "101%",
|
||||
duration: 0.6,
|
||||
ease: "expo",
|
||||
})
|
||||
}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
</AnimatedContent>
|
||||
<div
|
||||
className="service-details-wrapper"
|
||||
ref={contentRef}
|
||||
style={{ height: 0, overflow: "hidden", opacity: 0 }}
|
||||
>
|
||||
<div className="details-inner px-4 py-8 md:px-12 md:py-12 w-full">
|
||||
{/* Rendu dynamique du Masonry : uniquement quand l'item est ouvert */}
|
||||
{shouldRenderContent && Component && <Component />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="marquee"
|
||||
ref={marqueeRef}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import gsap from "gsap";
|
||||
import { ExternalLink } from "lucide-react";
|
||||
|
||||
interface CarouselItem {
|
||||
name: string;
|
||||
label: string;
|
||||
url: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
interface InfiniteCarouselProps {
|
||||
items: CarouselItem[];
|
||||
}
|
||||
|
||||
export default function InfiniteCarousel({ items }: InfiniteCarouselProps) {
|
||||
const scrollContainerRef = useRef<HTMLDivElement>(null);
|
||||
const animationRef = useRef<gsap.core.Tween | null>(null);
|
||||
|
||||
const scrollSpeed = 50; // Pixels par seconde
|
||||
|
||||
useEffect(() => {
|
||||
const container = scrollContainerRef.current;
|
||||
if (!container || items.length === 0) return;
|
||||
|
||||
const initAnimation = () => {
|
||||
const totalWidth = container.scrollWidth;
|
||||
const loopPoint = totalWidth / 2;
|
||||
|
||||
if (animationRef.current) animationRef.current.kill();
|
||||
|
||||
// 1. Création de l'animation
|
||||
animationRef.current = gsap.to(container, {
|
||||
scrollLeft: loopPoint,
|
||||
duration: loopPoint / scrollSpeed,
|
||||
ease: "none",
|
||||
repeat: -1,
|
||||
onRepeat: () => {
|
||||
container.scrollLeft = 0;
|
||||
},
|
||||
});
|
||||
|
||||
// 2. LE CHANGEMENT : On avance l'animation dès le départ
|
||||
// 0.15 signifie que l'on commence à 15% du premier trajet
|
||||
animationRef.current.progress(0.15);
|
||||
};
|
||||
|
||||
// On attend un court instant que le layout soit calculé
|
||||
const timer = setTimeout(initAnimation, 100);
|
||||
|
||||
const pause = () => animationRef.current?.pause();
|
||||
const resume = () => animationRef.current?.play();
|
||||
|
||||
container.addEventListener("mouseenter", pause);
|
||||
container.addEventListener("mouseleave", resume);
|
||||
container.addEventListener("touchstart", pause);
|
||||
container.addEventListener("touchend", resume);
|
||||
|
||||
return () => {
|
||||
clearTimeout(timer);
|
||||
animationRef.current?.kill();
|
||||
container.removeEventListener("mouseenter", pause);
|
||||
container.removeEventListener("mouseleave", resume);
|
||||
container.removeEventListener("touchstart", pause);
|
||||
container.removeEventListener("touchend", resume);
|
||||
};
|
||||
}, [items, scrollSpeed]);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={scrollContainerRef}
|
||||
className="relative z-10 w-full overflow-hidden no-scrollbar py-4 cursor-grab active:cursor-grabbing"
|
||||
>
|
||||
<div className="flex gap-6 px-4 md:px-12 w-max">
|
||||
{[...items, ...items].map((item, index) => (
|
||||
<a
|
||||
key={`${item.url}-${index}`}
|
||||
href={item.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="relative group aspect-3/4 h-[50vh] md:h-[60vh] shrink-0 overflow-hidden rounded-2xl border border-white/10 shadow-2xl transition-all duration-300 hover:border-white/30"
|
||||
>
|
||||
<img
|
||||
src={item.image}
|
||||
alt={item.name}
|
||||
className="w-full h-full object-cover transition-transform duration-700 ease-out group-hover:scale-110"
|
||||
/>
|
||||
<div className="cursor-target absolute inset-0 bg-linear-to-t from-black/80 via-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-end p-8 text-center">
|
||||
<span className="text-2xl font-bold text-white mb-1">
|
||||
{item.name}
|
||||
</span>
|
||||
<span className="text-sm text-white/70 mb-4">{item.label}</span>
|
||||
<div className="cursor-target bg-white/10 backdrop-blur-md rounded-full p-3 border border-white/20 hover:scale-110 transition-all duration-300">
|
||||
<ExternalLink className="w-6 h-6 text-white" />
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
.loading-screen {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 999999;
|
||||
background-color: #050000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: "Orbitron", sans-serif;
|
||||
color: var(--clr-text);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.loading-content {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
width: 80vw;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.loader-title {
|
||||
font-size: 2rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 4px;
|
||||
margin-bottom: 24px;
|
||||
color: var(--clr-accent);
|
||||
text-shadow: 0 0 15px rgba(183, 28, 28, 0.6);
|
||||
animation: pulse-loader 1.5s infinite ease-in-out;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.progress-container {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 100%;
|
||||
background: var(--clr-accent);
|
||||
box-shadow: 0 0 10px var(--clr-accent);
|
||||
transition: width 0.2s ease-out;
|
||||
}
|
||||
|
||||
/* Background effect */
|
||||
.space-background {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at center, #1a0505 0%, #050000 100%);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.stars-mini {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image:
|
||||
radial-gradient(1px 1px at 20px 30px, #eee, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 50px 160px, #ddd, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 80px 120px, #fff, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 110px 210px, #fff, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 150px 250px, #ddd, rgba(0, 0, 0, 0));
|
||||
background-repeat: repeat;
|
||||
background-size: 200px 250px;
|
||||
opacity: 0.3;
|
||||
animation: drift 20s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-loader {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 0.5;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes drift {
|
||||
from {
|
||||
transform: translateY(0);
|
||||
}
|
||||
to {
|
||||
transform: translateY(500px);
|
||||
}
|
||||
}
|
||||
|
||||
.loading-screen.fade-out {
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s ease-out;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import "./LoadingScreen.css";
|
||||
|
||||
const LoadingScreen: React.FC = () => {
|
||||
const [progress, setProgress] = useState(0);
|
||||
@@ -7,7 +6,7 @@ const LoadingScreen: React.FC = () => {
|
||||
useEffect(() => {
|
||||
const interval = window.setInterval(() => {
|
||||
setProgress((prev) => {
|
||||
const next = prev + 25 + Math.random() * 10;
|
||||
const next = prev + 5 + Math.random() * 7;
|
||||
if (next >= 100) {
|
||||
window.clearInterval(interval);
|
||||
return 100;
|
||||
@@ -20,14 +19,29 @@ const LoadingScreen: React.FC = () => {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="loading-screen">
|
||||
<div className="space-background">
|
||||
<div className="stars-mini"></div>
|
||||
<div className="fixed inset-0 z-999999 bg-[#050000] flex flex-col items-center justify-center font-orbitron text-(--clr-text) overflow-hidden">
|
||||
{/* Effet d'arrière-plan (Espace + Étoiles) */}
|
||||
<div className="absolute inset-0 opacity-80 bg-[radial-gradient(circle_at_center,#1a0505_0%,#050000_100%)]">
|
||||
{/* Étoiles en valeurs arbitraires Tailwind */}
|
||||
<div
|
||||
className="absolute inset-0 opacity-30 animate-[drift_20s_linear_infinite]
|
||||
bg-[radial-gradient(1px_1px_at_20px_30px,#eee,transparent),radial-gradient(1px_1px_at_40px_70px,#fff,transparent),radial-gradient(1px_1px_at_50px_160px,#ddd,transparent),radial-gradient(1px_1px_at_80px_120px,#fff,transparent),radial-gradient(1px_1px_at_110px_210px,#fff,transparent),radial-gradient(1px_1px_at_150px_250px,#ddd,transparent)]
|
||||
bg-size-[200px_250px]"
|
||||
></div>
|
||||
</div>
|
||||
<div className="loading-content">
|
||||
<div className="loader-title">Travelling to next galaxy</div>
|
||||
<div className="progress-container">
|
||||
<div className="progress-bar" style={{ width: `${progress}%` }}></div>
|
||||
|
||||
{/* Contenu principal */}
|
||||
<div className="relative z-10 w-[80vw] max-w-2/3 text-center px-4">
|
||||
<h1 className="text-2xl md:text-3xl uppercase tracking-[4px] mb-8 text-(--clr-accent) animate-[pulse-loader_1.5s_infinite_ease-in-out] [text-shadow:0_0_15px_rgba(183,28,28,0.6)]">
|
||||
Travelling to next galaxy
|
||||
</h1>
|
||||
|
||||
{/* Barre de progression */}
|
||||
<div className="w-full h-0.5 bg-white/5 rounded-full relative overflow-hidden">
|
||||
<div
|
||||
className="h-full bg-(--clr-accent) transition-[width] duration-100 ease-out shadow-[0_0_10px_var(--clr-accent)]"
|
||||
style={{ width: `${progress}%` }}
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ import TargetCursor from "../cursors/TargetCursor";
|
||||
export default function BackgroundWrapper() {
|
||||
const location = useLocation();
|
||||
const isCohaise = location.pathname === "/cohaise";
|
||||
const isHome = location.pathname === "/";
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -44,7 +45,7 @@ export default function BackgroundWrapper() {
|
||||
pillarHeight={1}
|
||||
noiseIntensity={0.5}
|
||||
pillarRotation={20}
|
||||
interactive
|
||||
interactive={false}
|
||||
mixBlendMode="screen"
|
||||
quality="high"
|
||||
/>
|
||||
@@ -52,8 +53,8 @@ export default function BackgroundWrapper() {
|
||||
) : (
|
||||
<div className="w-full h-full relative">
|
||||
<Galaxy
|
||||
mouseRepulsion={true}
|
||||
mouseInteraction={true}
|
||||
mouseRepulsion={isHome}
|
||||
mouseInteraction={isHome}
|
||||
density={1.5}
|
||||
glowIntensity={0.4}
|
||||
saturation={0}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
import {
|
||||
gameDevItems,
|
||||
reactWebItems,
|
||||
wordpressItems,
|
||||
desktopAppItems,
|
||||
angulartWebItems,
|
||||
} from "./ProjectDetails";
|
||||
|
||||
export interface MenuItem {
|
||||
image: string;
|
||||
link: string;
|
||||
@@ -5,6 +13,14 @@ export interface MenuItem {
|
||||
description: string;
|
||||
}
|
||||
|
||||
const allDetailItems = [
|
||||
...gameDevItems,
|
||||
...reactWebItems,
|
||||
...wordpressItems,
|
||||
...desktopAppItems,
|
||||
...angulartWebItems,
|
||||
];
|
||||
|
||||
export const projectMenuItems: MenuItem[] = [
|
||||
{
|
||||
image: "/images/projects/Projects.webp",
|
||||
@@ -12,56 +28,12 @@ export const projectMenuItems: MenuItem[] = [
|
||||
title: "All my Projects",
|
||||
description: "To discover all my creations",
|
||||
},
|
||||
{
|
||||
image: "/images/projects/NTR.webp",
|
||||
link: "/projects/neo-tokyo-rush",
|
||||
title: "Neo Tokyo Rush",
|
||||
description: "Cyberpunk-inspired beat 'em All game",
|
||||
},
|
||||
{
|
||||
image: "/images/projects/PortfolioE1.webp",
|
||||
link: "https://portfolio-xesiahs-projects.vercel.app/",
|
||||
title: "Portfolio 2024",
|
||||
description: "Portfolio that gathers all my first year's projects",
|
||||
},
|
||||
{
|
||||
image: "/images/projects/Metz-Campus.webp",
|
||||
link: "_blank https://metzcampus.fr/",
|
||||
title: "Metz Campus",
|
||||
description:
|
||||
"Website crafted for the Metz Campus organization during my first-year internship.",
|
||||
},
|
||||
{
|
||||
image: "/images/projects/Zatyshok.webp",
|
||||
link: "/projects/zatyshok",
|
||||
title: "Затишок",
|
||||
description: "Moodboard application",
|
||||
},
|
||||
{
|
||||
image: "/images/projects/SPRotD.webp",
|
||||
link: "/projects/shadow-purge-rite-of-the-demon",
|
||||
title: "Shadow Purge - Rite of the Demon",
|
||||
description: "Hack n'slash RPG",
|
||||
},
|
||||
{
|
||||
image: "/images/projects/EotLS.webp",
|
||||
link: "/projects/echoes-of-the-last-stop",
|
||||
title: "Echoes of the Last Stop",
|
||||
description: "Thriller game project in collaboration with my partner",
|
||||
},
|
||||
{
|
||||
image: "/images/projects/LesVoixDeLExil.webp",
|
||||
link: "/projects/les-voix-de-l-exil",
|
||||
title: "Les Voix de L'Exil",
|
||||
description:
|
||||
"An interactive visual novel where your choices shape the journey.",
|
||||
},
|
||||
{
|
||||
image: "/images/projects/WYG-TIWIF.webp",
|
||||
link: "/projects/wyg-tiwif",
|
||||
title: "WYG-TIWIF",
|
||||
description: "Your social travel hub",
|
||||
},
|
||||
...allDetailItems.map((item) => ({
|
||||
image: item.img,
|
||||
link: item.link,
|
||||
title: item.title,
|
||||
description: item.description,
|
||||
})),
|
||||
];
|
||||
|
||||
export const mainMenuItems: MenuItem[] = [
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import React from "react";
|
||||
import HorizontalMotion from "../HorizontalMotion";
|
||||
|
||||
const gameDevItems = [
|
||||
export const gameDevItems = [
|
||||
{
|
||||
id: "1",
|
||||
img: "images/projects/SPRotD.webp",
|
||||
img: "/images/projects/SPRotD.webp",
|
||||
link: "/projects/shadow-purge-rite-of-the-demon",
|
||||
title: "Shadow Purge : Rite of the Demon",
|
||||
description: "Hack n'slash RPG made with Unity & Aseprite.",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
img: "images/projects/EotLS.webp",
|
||||
img: "/images/projects/EotLS.webp",
|
||||
link: "/projects/echoes-of-the-last-stop",
|
||||
title: "Echoes of the Last Stop",
|
||||
description:
|
||||
@@ -19,7 +19,7 @@ const gameDevItems = [
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
img: "images/projects/NTR-Menu.webp",
|
||||
img: "/images/projects/NTR-Menu.webp",
|
||||
link: "/projects/neo-tokyo-rush",
|
||||
title: "Neo Tokyo Rush",
|
||||
description:
|
||||
@@ -27,7 +27,7 @@ const gameDevItems = [
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
img: "images/projects/LesVoixDeLExil.webp",
|
||||
img: "/images/projects/LesVoixDeLExil.webp",
|
||||
link: "/projects/les-voix-de-l-exil",
|
||||
title: "Les Voix de L'Exil",
|
||||
description:
|
||||
@@ -35,34 +35,42 @@ const gameDevItems = [
|
||||
},
|
||||
];
|
||||
|
||||
const reactWebItems = [
|
||||
export const reactWebItems = [
|
||||
{
|
||||
id: "101",
|
||||
img: "images/cohaise/cohaise.webp",
|
||||
img: "/images/cohaise/cohaise.webp",
|
||||
link: "/cohaise",
|
||||
title: "Co Hai Se",
|
||||
description: "Landing single page for my (fictionnal) compagny.",
|
||||
},
|
||||
{
|
||||
id: "102",
|
||||
img: "images/projects/Esiah-s-Universe.webp",
|
||||
img: "/images/projects/Esiah-s-Universe.webp",
|
||||
link: "/",
|
||||
title: "Esiah's Universe",
|
||||
description: "A journey through code, design, and imagination.",
|
||||
},
|
||||
{
|
||||
id: "103",
|
||||
img: "images/projects/Coeur-UA-PAM.webp",
|
||||
img: "/images/projects/Coeur-UA-PAM.webp",
|
||||
link: "https://coeur-ua-pam.fr/",
|
||||
title: "Coeur UA PAM",
|
||||
description: "Web site for Coeur UA PAM association.",
|
||||
},
|
||||
{
|
||||
id: "104",
|
||||
img: "/images/projects/WaterDroneIoTHackathon.webp",
|
||||
link: "https://waterdrone.esiah.dev/",
|
||||
title: "WaterDrone",
|
||||
description:
|
||||
"Web site made in 5 hours for WaterDrone 2026, an IoT Hackathon project.",
|
||||
},
|
||||
];
|
||||
|
||||
const wordpressItems = [
|
||||
export const wordpressItems = [
|
||||
{
|
||||
id: "201",
|
||||
img: "images/projects/Metz-Campus.webp",
|
||||
img: "/images/projects/Metz-Campus.webp",
|
||||
link: "https://metzcampus.fr/",
|
||||
title: "Metz Campus",
|
||||
description:
|
||||
@@ -70,10 +78,10 @@ const wordpressItems = [
|
||||
},
|
||||
];
|
||||
|
||||
const desktopAppItems = [
|
||||
export const desktopAppItems = [
|
||||
{
|
||||
id: "301",
|
||||
img: "images/projects/Zatyshok.webp",
|
||||
img: "/images/projects/Zatyshok.webp",
|
||||
link: "/projects/zatyshok",
|
||||
title: "Затишок",
|
||||
description:
|
||||
@@ -81,10 +89,10 @@ const desktopAppItems = [
|
||||
},
|
||||
];
|
||||
|
||||
const angulartWebItems = [
|
||||
export const angulartWebItems = [
|
||||
{
|
||||
id: "401",
|
||||
img: "images/projects/WYG-TIWIF.webp",
|
||||
img: "/images/projects/WYG-TIWIF.webp",
|
||||
link: "/projects/wyg-tiwif",
|
||||
title: "WYG-TIWIF",
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user