diff --git a/index.html b/index.html index db709f1..2aa5d59 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + Esiah's Universe diff --git a/public/3d/badge_texture.png b/public/3d/badge_texture.png deleted file mode 100644 index 6ac7f1e..0000000 Binary files a/public/3d/badge_texture.png and /dev/null differ diff --git a/public/3d/badge_texture.webp b/public/3d/badge_texture.webp new file mode 100644 index 0000000..654a547 Binary files /dev/null and b/public/3d/badge_texture.webp differ diff --git a/public/3d/lanyard.png b/public/3d/lanyard.png deleted file mode 100644 index 01a9b07..0000000 Binary files a/public/3d/lanyard.png and /dev/null differ diff --git a/public/3d/lanyard.webp b/public/3d/lanyard.webp new file mode 100644 index 0000000..57827f5 Binary files /dev/null and b/public/3d/lanyard.webp differ diff --git a/public/images/Coeur-UA-PAM.webp b/public/images/Coeur-UA-PAM.webp new file mode 100644 index 0000000..58e7906 Binary files /dev/null and b/public/images/Coeur-UA-PAM.webp differ diff --git a/public/images/Cohaise.jpg b/public/images/Cohaise.jpg deleted file mode 100644 index bf06df3..0000000 Binary files a/public/images/Cohaise.jpg and /dev/null differ diff --git a/public/images/Cohaise.webp b/public/images/Cohaise.webp new file mode 100644 index 0000000..df8db44 Binary files /dev/null and b/public/images/Cohaise.webp differ diff --git a/public/images/Contact.jpg b/public/images/Contact.jpg deleted file mode 100644 index 1dfd222..0000000 Binary files a/public/images/Contact.jpg and /dev/null differ diff --git a/public/images/Contact.webp b/public/images/Contact.webp new file mode 100644 index 0000000..4261bf6 Binary files /dev/null and b/public/images/Contact.webp differ diff --git a/public/images/EotLS.png b/public/images/EotLS.png deleted file mode 100644 index cf95b09..0000000 Binary files a/public/images/EotLS.png and /dev/null differ diff --git a/public/images/EotLS.webp b/public/images/EotLS.webp new file mode 100644 index 0000000..a572eb4 Binary files /dev/null and b/public/images/EotLS.webp differ diff --git a/public/images/Esiah-s-Universe.webp b/public/images/Esiah-s-Universe.webp new file mode 100644 index 0000000..8238074 Binary files /dev/null and b/public/images/Esiah-s-Universe.webp differ diff --git a/public/images/JesusKing.jpg b/public/images/JesusKing.jpg deleted file mode 100644 index 20dbca7..0000000 Binary files a/public/images/JesusKing.jpg and /dev/null differ diff --git a/public/images/JesusKing.webp b/public/images/JesusKing.webp new file mode 100644 index 0000000..b20e0ca Binary files /dev/null and b/public/images/JesusKing.webp differ diff --git a/public/images/MC.png b/public/images/MC.png deleted file mode 100644 index 4609425..0000000 Binary files a/public/images/MC.png and /dev/null differ diff --git a/public/images/Metz-Campus.webp b/public/images/Metz-Campus.webp new file mode 100644 index 0000000..3f8b565 Binary files /dev/null and b/public/images/Metz-Campus.webp differ diff --git a/public/images/NTR-Lvl.png b/public/images/NTR-Lvl.png deleted file mode 100644 index c56389c..0000000 Binary files a/public/images/NTR-Lvl.png and /dev/null differ diff --git a/public/images/NTR-Lvl.webp b/public/images/NTR-Lvl.webp new file mode 100644 index 0000000..434a24b Binary files /dev/null and b/public/images/NTR-Lvl.webp differ diff --git a/public/images/NTR-Menu.png b/public/images/NTR-Menu.png deleted file mode 100644 index 15f3298..0000000 Binary files a/public/images/NTR-Menu.png and /dev/null differ diff --git a/public/images/NTR-Menu.webp b/public/images/NTR-Menu.webp new file mode 100644 index 0000000..c3a61f7 Binary files /dev/null and b/public/images/NTR-Menu.webp differ diff --git a/public/images/NTR.png b/public/images/NTR.png deleted file mode 100644 index bfc6304..0000000 Binary files a/public/images/NTR.png and /dev/null differ diff --git a/public/images/NTR.webp b/public/images/NTR.webp new file mode 100644 index 0000000..de0885b Binary files /dev/null and b/public/images/NTR.webp differ diff --git a/public/images/PortfolioE1.png b/public/images/PortfolioE1.png deleted file mode 100644 index d68789a..0000000 Binary files a/public/images/PortfolioE1.png and /dev/null differ diff --git a/public/images/PortfolioE1.webp b/public/images/PortfolioE1.webp new file mode 100644 index 0000000..ae98ef9 Binary files /dev/null and b/public/images/PortfolioE1.webp differ diff --git a/public/images/Projects.png b/public/images/Projects.png deleted file mode 100644 index 402db54..0000000 Binary files a/public/images/Projects.png and /dev/null differ diff --git a/public/images/Projects.webp b/public/images/Projects.webp new file mode 100644 index 0000000..280be8d Binary files /dev/null and b/public/images/Projects.webp differ diff --git a/public/images/SPRotD.png b/public/images/SPRotD.png deleted file mode 100644 index fc3caa7..0000000 Binary files a/public/images/SPRotD.png and /dev/null differ diff --git a/public/images/SPRotD.webp b/public/images/SPRotD.webp new file mode 100644 index 0000000..0001469 Binary files /dev/null and b/public/images/SPRotD.webp differ diff --git a/public/images/WYG-TIWIF.webp b/public/images/WYG-TIWIF.webp new file mode 100644 index 0000000..0ec3b38 Binary files /dev/null and b/public/images/WYG-TIWIF.webp differ diff --git a/public/images/Zatyshok.png b/public/images/Zatyshok.png deleted file mode 100644 index dbf0efc..0000000 Binary files a/public/images/Zatyshok.png and /dev/null differ diff --git a/public/images/Zatyshok.webp b/public/images/Zatyshok.webp new file mode 100644 index 0000000..ea86edc Binary files /dev/null and b/public/images/Zatyshok.webp differ diff --git a/public/images/contact/email-prev.jpg b/public/images/contact/email-prev.jpg deleted file mode 100644 index d4cd53e..0000000 Binary files a/public/images/contact/email-prev.jpg and /dev/null differ diff --git a/public/images/contact/email-prev.webp b/public/images/contact/email-prev.webp new file mode 100644 index 0000000..a66d85c Binary files /dev/null and b/public/images/contact/email-prev.webp differ diff --git a/public/images/contact/github-prev.jpg b/public/images/contact/github-prev.jpg deleted file mode 100644 index 98815db..0000000 Binary files a/public/images/contact/github-prev.jpg and /dev/null differ diff --git a/public/images/contact/github-prev.webp b/public/images/contact/github-prev.webp new file mode 100644 index 0000000..122b39d Binary files /dev/null and b/public/images/contact/github-prev.webp differ diff --git a/public/images/contact/insta-prev.jpg b/public/images/contact/insta-prev.jpg deleted file mode 100644 index 4ca5156..0000000 Binary files a/public/images/contact/insta-prev.jpg and /dev/null differ diff --git a/public/images/contact/insta-prev.webp b/public/images/contact/insta-prev.webp new file mode 100644 index 0000000..f9285f4 Binary files /dev/null and b/public/images/contact/insta-prev.webp differ diff --git a/public/images/contact/linkedin-cohaise-prev.jpg b/public/images/contact/linkedin-cohaise-prev.jpg deleted file mode 100644 index 5b3f334..0000000 Binary files a/public/images/contact/linkedin-cohaise-prev.jpg and /dev/null differ diff --git a/public/images/contact/linkedin-cohaise-prev.webp b/public/images/contact/linkedin-cohaise-prev.webp new file mode 100644 index 0000000..bc125ff Binary files /dev/null and b/public/images/contact/linkedin-cohaise-prev.webp differ diff --git a/public/images/contact/linkedin-perso-prev.jpg b/public/images/contact/linkedin-perso-prev.jpg deleted file mode 100644 index 92845f8..0000000 Binary files a/public/images/contact/linkedin-perso-prev.jpg and /dev/null differ diff --git a/public/images/contact/linkedin-perso-prev.webp b/public/images/contact/linkedin-perso-prev.webp new file mode 100644 index 0000000..6a35044 Binary files /dev/null and b/public/images/contact/linkedin-perso-prev.webp differ diff --git a/public/images/customSoftware.jpg b/public/images/customSoftware.jpg deleted file mode 100644 index 36d41b0..0000000 Binary files a/public/images/customSoftware.jpg and /dev/null differ diff --git a/public/images/customSoftware.webp b/public/images/customSoftware.webp new file mode 100644 index 0000000..2a23c23 Binary files /dev/null and b/public/images/customSoftware.webp differ diff --git a/public/images/logo.webp b/public/images/logo.webp new file mode 100644 index 0000000..d5fcf37 Binary files /dev/null and b/public/images/logo.webp differ diff --git a/public/images/mobileApps.jpg b/public/images/mobileApps.jpg deleted file mode 100644 index 579630f..0000000 Binary files a/public/images/mobileApps.jpg and /dev/null differ diff --git a/public/images/mobileApps.webp b/public/images/mobileApps.webp new file mode 100644 index 0000000..84242fe Binary files /dev/null and b/public/images/mobileApps.webp differ diff --git a/public/images/uxUI.jpg b/public/images/uxUI.jpg deleted file mode 100644 index ce4a7c9..0000000 Binary files a/public/images/uxUI.jpg and /dev/null differ diff --git a/public/images/uxUI.webp b/public/images/uxUI.webp new file mode 100644 index 0000000..1ab2166 Binary files /dev/null and b/public/images/uxUI.webp differ diff --git a/public/images/webDevelopment.jpg b/public/images/webDevelopment.jpg deleted file mode 100644 index 9e74a74..0000000 Binary files a/public/images/webDevelopment.jpg and /dev/null differ diff --git a/public/images/webDevelopment.webp b/public/images/webDevelopment.webp new file mode 100644 index 0000000..c9599aa Binary files /dev/null and b/public/images/webDevelopment.webp differ diff --git a/src/App.tsx b/src/App.tsx index 45bbe65..525fae3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,10 +12,13 @@ import Zatyshok from "./pages/projects/Zatyshok"; import NeoTokyoRush from "./pages/projects/NeoTokyoRush"; import EchoesOfTheLastStop from "./pages/projects/EchoesOfTheLastStop"; import ShadowPurgeRiteOfTheDemon from "./pages/projects/ShadowPurgeRiteOfTheDemon"; +import ScrollToTop from "./components/ScrollToTop"; +import WYGTIWIF from "./pages/projects/WYG-TIWIF"; function AppContent() { return ( <> + @@ -44,6 +47,7 @@ function AppContent() { element={} /> } /> + } /> diff --git a/src/components/AnimatedContent.tsx b/src/components/AnimatedContent.tsx new file mode 100644 index 0000000..6771669 --- /dev/null +++ b/src/components/AnimatedContent.tsx @@ -0,0 +1,153 @@ +import React, { useRef, useEffect } from "react"; +import { gsap } from "gsap"; +import { ScrollTrigger } from "gsap/ScrollTrigger"; + +gsap.registerPlugin(ScrollTrigger); + +interface AnimatedContentProps extends React.HTMLAttributes { + children: React.ReactNode; + container?: Element | string | null; + distance?: number; + direction?: "vertical" | "horizontal" | "none"; + reverse?: boolean; + duration?: number; + ease?: string; + initialOpacity?: number; + animateOpacity?: boolean; + scale?: number; + threshold?: number; + delay?: number; + disappearAfter?: number; + disappearDuration?: number; + disappearEase?: string; + onComplete?: () => void; + onDisappearanceComplete?: () => void; +} + +const AnimatedContent: React.FC = ({ + children, + container, + distance = 100, + direction = "vertical", + reverse = false, + duration = 0.8, + ease = "power3.out", + initialOpacity = 0, + animateOpacity = true, + scale = 1, + threshold = 0.1, + delay = 0, + disappearAfter = 0, + disappearDuration = 0.5, + disappearEase = "power3.in", + onComplete, + onDisappearanceComplete, + className = "", + ...props +}) => { + const ref = useRef(null); + + useEffect(() => { + const el = ref.current; + if (!el) return; + + let scrollerTarget: Element | string | null = + container || document.getElementById("snap-main-container") || null; + + if (typeof scrollerTarget === "string") { + scrollerTarget = document.querySelector(scrollerTarget); + } + + const startPct = (1 - threshold) * 100; + const setConfig: gsap.TweenVars = { + opacity: animateOpacity ? initialOpacity : 1, + visibility: "visible", + }; + + const toConfig: gsap.TweenVars = { + opacity: 1, + duration, + ease, + }; + if (direction !== "none") { + const axis = direction === "horizontal" ? "x" : "y"; + const offset = reverse ? -distance : distance; + setConfig[axis] = offset; + toConfig[axis] = 0; + } + if (scale !== 1) { + setConfig.scale = scale; + toConfig.scale = 1; + } + + gsap.set(el, setConfig); + + const tl = gsap.timeline({ + paused: true, + delay, + onComplete: () => { + if (onComplete) onComplete(); + if (disappearAfter > 0) { + const disappearConfig: gsap.TweenVars = { + opacity: animateOpacity ? initialOpacity : 0, + delay: disappearAfter, + duration: disappearDuration, + ease: disappearEase, + onComplete: () => onDisappearanceComplete?.(), + }; + + if (direction !== "none") { + const axis = direction === "horizontal" ? "x" : "y"; + disappearConfig[axis] = reverse ? distance : -distance; + } + + if (scale !== 1) { + disappearConfig.scale = 0.8; + } + + gsap.to(el, disappearConfig); + } + }, + }); + + tl.to(el, toConfig); + + const st = ScrollTrigger.create({ + trigger: el, + scroller: scrollerTarget || window, + start: `top ${startPct}%`, + once: true, + onEnter: () => tl.play(), + }); + + return () => { + st.kill(); + tl.kill(); + }; + }, [ + container, + distance, + direction, + reverse, + duration, + ease, + initialOpacity, + animateOpacity, + scale, + threshold, + delay, + disappearAfter, + disappearDuration, + disappearEase, + onComplete, + onDisappearanceComplete, + ]); + + return ( +
+ {children} +
+ ); +}; + +export default AnimatedContent; diff --git a/src/components/CardNav.jsx b/src/components/CardNav.jsx index 82f63fd..3dd5b6b 100644 --- a/src/components/CardNav.jsx +++ b/src/components/CardNav.jsx @@ -6,7 +6,7 @@ import Lanyard from "./Lanyard"; import "./CardNav.css"; const CardNav = ({ - logo = "/images/logo.png", + logo = "/images/logo.webp", logoAlt = "Esiah Logo", className = "", ease = "power3.out", @@ -62,44 +62,44 @@ const CardNav = ({ if (location.pathname.startsWith("/projects")) { return [ { - image: "/images/Projects.png", + image: "/images/Projects.webp", link: "/projects", title: "All my Projects", description: "To discover all my creations", }, { - image: "/images/NTR.png", + image: "/images/NTR.webp", link: "/projects/neo-tokyo-rush", title: "Neo Tokyo Rush", description: "Cyberpunk-inspired beat 'em All game", }, { - image: "/images/PortfolioE1.png", + image: "/images/PortfolioE1.webp", link: "https://portfolio-xesiahs-projects.vercel.app/", title: "Protfolio 2024", description: "Portfolio that gathers all my first year's projects", }, { - image: "/images/MC.png", + image: "/images/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/Zatyshok.png", + image: "/images/Zatyshok.webp", link: "/projects/zatyshok", title: "Затишок", description: "Moodboard application", }, { - image: "/images/SPRotD.png", + image: "/images/SPRotD.webp", link: "/projects/shadow-purge-rite-of-the-demon", title: "Shadow Purge - Rite of the Demon", description: "Hack n'slash RPG", }, { - image: "/images/EotLS.png", + image: "/images/EotLS.webp", link: "/projects/echoes-of-the-last-stop", title: "Echoes of the Last Stop", description: "Thriller game project in collaboration with my partner", @@ -108,19 +108,19 @@ const CardNav = ({ } return [ { - image: "/images/Projects.png", + image: "/images/Projects.webp", link: "/projects", title: "All my Projects", description: "To discover all my creations", }, { - image: "/images/Contact.jpg", + image: "/images/Contact.webp", link: "/contact", title: "Contact", description: "Any requests? Feel free to reach out!", }, { - image: "/images/Cohaise.jpg", + image: "/images/Cohaise.webp", link: "/cohaise", title: "Co Hai Se", description: "About us", diff --git a/src/components/FlowingMenu.css b/src/components/FlowingMenu.css index 8f6117a..b5246b0 100644 --- a/src/components/FlowingMenu.css +++ b/src/components/FlowingMenu.css @@ -3,10 +3,9 @@ --text-dim: rgba(255, 255, 255, 0.5); } -/* 1. CONFIGURATION LAYOUT & POINTER EVENTS */ .menu-wrap { width: 100vw; - margin-left: calc(-50vw + 50%); /* Full width hack */ + margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); margin-top: 8rem; margin-bottom: 8rem; @@ -15,7 +14,6 @@ position: relative; left: 0; will-change: height; - /* CRUCIAL : La souris passe à travers pour atteindre le background (parallaxe) */ pointer-events: none; } @@ -25,7 +23,6 @@ display: flex; flex-direction: column; padding: 0; - /* CRUCIAL : La souris passe à travers */ pointer-events: none; } @@ -34,7 +31,6 @@ overflow: hidden; border-top: 1px solid var(--border-subtle); transition: background-color 0.4s ease; - /* CRUCIAL : La souris passe à travers */ pointer-events: none; } @@ -42,7 +38,6 @@ border-bottom: 1px solid var(--border-subtle); } -/* 2. ÉLÉMENTS INTERACTIFS (On réactive la souris) */ .menu__item-link { display: flex; align-items: center; @@ -190,7 +185,7 @@ width: 350px; height: 100px; margin: 0 3vw; - border-radius: 4px; + border-radius: 50px; filter: grayscale(100%) contrast(1.2); opacity: 0.8; background-size: cover; diff --git a/src/components/FlowingMenu.jsx b/src/components/FlowingMenu.tsx similarity index 58% rename from src/components/FlowingMenu.jsx rename to src/components/FlowingMenu.tsx index 5e816f3..4b612a9 100644 --- a/src/components/FlowingMenu.jsx +++ b/src/components/FlowingMenu.tsx @@ -1,11 +1,29 @@ /* eslint-disable no-unused-vars */ -import { useRef, useEffect, useState } from "react"; +import React, { useRef, useEffect, useState } from "react"; import { gsap } from "gsap"; -import "./FlowingMenu.css"; import { ScrollToPlugin } from "gsap/ScrollToPlugin"; +import "./FlowingMenu.css"; + gsap.registerPlugin(ScrollToPlugin); -function FlowingMenu({ +// --- Définition des Types pour éviter l'erreur 'never[]' --- +export interface FlowingMenuItem { + text: string; + image: string; + Component?: React.ComponentType; +} + +interface FlowingMenuProps { + items?: FlowingMenuItem[]; + speed?: number; + textColor?: string; + bgColor?: string; + marqueeBgColor?: string; + marqueeTextColor?: string; + borderColor?: string; +} + +const FlowingMenu: React.FC = ({ items = [], speed = 15, textColor = "#fff", @@ -13,11 +31,11 @@ function FlowingMenu({ marqueeBgColor = "rgba(0,0,0,0.8)", marqueeTextColor = "#fff", borderColor = "rgba(255,255,255,0.1)", -}) { - const [activeIdx, setActiveIdx] = useState(null); +}) => { + const [activeIdx, setActiveIdx] = useState(null); const [isTransitioning, setIsTransitioning] = useState(false); - const toggleItem = (idx) => { + const toggleItem = (idx: number) => { if (isTransitioning) return; if (activeIdx === idx) { setActiveIdx(null); @@ -51,20 +69,24 @@ function FlowingMenu({ borderColor={borderColor} /> ))} -
+
); +}; + +// --- Sous-composant MenuItem --- +interface MenuItemProps extends FlowingMenuItem { + speed: number; + textColor: string; + marqueeBgColor: string; + marqueeTextColor: string; + borderColor: string; + isOpen: boolean; + onClick: () => void; } -function MenuItem({ +const MenuItem: React.FC = ({ text, image, speed, @@ -75,59 +97,65 @@ function MenuItem({ isOpen, onClick, Component, -}) { - const itemRef = useRef(null); - const marqueeRef = useRef(null); - const marqueeInnerRef = useRef(null); - const contentRef = useRef(null); +}) => { + const itemRef = useRef(null); + const marqueeRef = useRef(null); + const marqueeInnerRef = useRef(null); + const contentRef = useRef(null); const [repetitions, setRepetitions] = useState(2); + // État local pour retarder le montage du composant Masonry le temps que l'animation commence + const [shouldRenderContent, setShouldRenderContent] = useState(false); + + useEffect(() => { + if (isOpen) { + setShouldRenderContent(true); + } else { + // On attend la fin de l'animation de fermeture pour démonter + const timer = setTimeout(() => setShouldRenderContent(false), 500); + return () => clearTimeout(timer); + } + }, [isOpen]); useEffect(() => { const calculateRepetitions = () => { if (!marqueeInnerRef.current) return; - - const singlePart = - marqueeInnerRef.current.querySelector(".marquee__part"); + const singlePart = marqueeInnerRef.current.querySelector( + ".marquee__part", + ) as HTMLElement; if (!singlePart) return; - const partWidth = singlePart.offsetWidth; const windowWidth = window.innerWidth; - if (partWidth > 0) { - const needed = Math.ceil(windowWidth / partWidth) + 4; - setRepetitions(needed); + setRepetitions(Math.ceil(windowWidth / partWidth) + 4); } }; - calculateRepetitions(); window.addEventListener("resize", calculateRepetitions); return () => window.removeEventListener("resize", calculateRepetitions); }, [text]); useEffect(() => { - const marqueeContent = - marqueeInnerRef.current?.querySelector(".marquee__part"); + if (!marqueeInnerRef.current) return; + const marqueeContent = marqueeInnerRef.current.querySelector( + ".marquee__part", + ) as HTMLElement; if (!marqueeContent) return; - const contentWidth = marqueeContent.offsetWidth; - if (contentWidth === 0) return; - const tl = gsap.to(marqueeInnerRef.current, { x: -contentWidth, duration: speed, ease: "none", repeat: -1, }); - - return () => tl.kill(); + return () => { + tl.kill(); + }; }, [speed, repetitions]); useEffect(() => { if (isOpen && itemRef.current) { const isMobile = window.innerWidth < 768; - gsap.killTweensOf([contentRef.current, window, marqueeRef.current]); - gsap.to(contentRef.current, { height: "auto", opacity: 1, @@ -150,7 +178,6 @@ function MenuItem({ ease: "power2.out", }); } else { - gsap.killTweensOf(contentRef.current); gsap.to(contentRef.current, { height: 0, opacity: 0, @@ -160,20 +187,6 @@ function MenuItem({ } }, [isOpen]); - const handleMouseEnter = () => { - if (window.matchMedia("(pointer: coarse)").matches) return; - - if (isOpen) return; - - gsap.to(marqueeRef.current, { y: "0%", duration: 0.6, ease: "expo" }); - gsap.set(marqueeInnerRef.current, { force3D: true }); - }; - - const handleMouseLeave = () => { - if (window.matchMedia("(pointer: coarse)").matches) return; - gsap.to(marqueeRef.current, { y: "101%", duration: 0.6, ease: "expo" }); - }; - return (
+ !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}
+
-
{Component && }
+
+ {/* Rendu dynamique du Masonry : uniquement quand l'item est ouvert */} + {shouldRenderContent && Component && } +
-
+ +
-