feat: init repo
deploy / deploy (push) Canceled after 0s

This commit is contained in:
2026-11-10 19:56:03 +01:00
commit 858d862fed
166 changed files with 13336 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { ScrollToPlugin } from "gsap/ScrollToPlugin";
gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
export { gsap, ScrollTrigger };
export const prefersReducedMotion = (): boolean =>
typeof window !== "undefined" &&
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
/** Défilement fluide vers une section, sans toucher à l'URL. */
export const scrollToSection = (hash: string): void => {
const target = document.querySelector<HTMLElement>(hash);
if (!target) return;
if (prefersReducedMotion()) {
target.scrollIntoView({ behavior: "auto" });
return;
}
gsap.to(window, {
duration: 1,
scrollTo: { y: target, offsetY: 96 },
ease: "power3.inOut",
});
};