diff --git a/components/sections/WhatWeDo.tsx b/components/sections/WhatWeDo.tsx index da0cbca..7a12c6d 100644 --- a/components/sections/WhatWeDo.tsx +++ b/components/sections/WhatWeDo.tsx @@ -29,47 +29,53 @@ const content = [ const WhatWeDo = () => { useEffect(() => { - gsap.registerPlugin(ScrollTrigger) - const tl = gsap.timeline({ - scrollTrigger: { - trigger: ".badge-start-trigger", - start: "top 300", - end: "+=510", - scrub: 1, - }, - }) + const mm = gsap.matchMedia() - tl.from("#privacy", { fill: "#E1523A" }, "+=0.5") - .to("#privacy", { fill: "#111827", ease: "ease-out" }) - .to(".badge-right", { y: 220, ease: "ease-out" }) - .to("#scaling", { fill: "#E1523A", ease: "ease-in" }, "+=0.5") - .to(".badge-right", { y: 510, ease: "ease-out" }) - .to("#scaling", { fill: "#111827", ease: "ease-out" }) - .to("#explorations", { fill: "#E1523A", ease: "ease-in" }) + mm.add("(min-width: 1024px)", () => { + gsap.registerPlugin(ScrollTrigger) + const tl = gsap.timeline({ + scrollTrigger: { + trigger: ".badge-start-trigger", + start: "top center", + end: "+=550", + scrub: 1, + // markers: true, + }, + }) + + tl.from("#privacy", { fill: "#E1523A" }, "+=0.5") + .to(".badge-right", { y: 50, ease: "ease-out" }, "+=1") + .to("#privacy", { fill: "#111827", ease: "ease-out" }, "+=0.5") + .to(".badge-right", { y: 100, ease: "ease-out" }) + .to("#scaling", { fill: "#E1523A", ease: "ease-in" }) + .to(".badge-right", { y: 250, ease: "ease-out" }, "+=1") + .to(".badge-right", { y: 350, ease: "ease-out" }) + .to("#scaling", { fill: "#111827", ease: "ease-out" }) + .to("#explorations", { fill: "#E1523A", ease: "ease-in" }) + .to(".badge-right", { y: 550, ease: "ease-out" }) + }) }, []) return ( -
-

+
+

What we do

-
+
{content.map((item, index) => ( -
-

{item.title}

+
+

{item.title}

-

{item.description}

+

{item.description}

))}
-
+