22 lines
1,005 B
TypeScript
22 lines
1,005 B
TypeScript
/**
|
|
* Centralised GSAP setup. Registers the (now-free) premium plugins ONCE,
|
|
* client-side only. Import { gsap, ScrollTrigger, ... } from here so every
|
|
* component shares the same registration and we never double-register.
|
|
*
|
|
* GSAP 3.15 ships DrawSVG / MorphSVG / SplitText / ScrollTrigger in the
|
|
* package (April 2025: all club plugins went free).
|
|
*/
|
|
import { gsap } from "gsap";
|
|
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
|
import { DrawSVGPlugin } from "gsap/DrawSVGPlugin";
|
|
import { MorphSVGPlugin } from "gsap/MorphSVGPlugin";
|
|
import { SplitText } from "gsap/SplitText";
|
|
|
|
if (typeof window !== "undefined") {
|
|
gsap.registerPlugin(ScrollTrigger, DrawSVGPlugin, MorphSVGPlugin, SplitText);
|
|
// Shared signature ease (mirrors the CSS --ease-out token). Registered once
|
|
// here so every component can use ease:"emilOut" without re-registering.
|
|
gsap.registerEase("emilOut", (p) => 1 - Math.pow(1 - p, 3.2));
|
|
}
|
|
|
|
export { gsap, ScrollTrigger, DrawSVGPlugin, MorphSVGPlugin, SplitText };
|