import { useEffect, useRef } from "react"; import { Power1, gsap } from "gsap"; import { ScrollTrigger } from "@/plugins"; import Link from "next/link.js"; import Counter3 from "../../../public/assets/imgs/thumb/counter-3.png"; import Image from "next/image.js"; gsap.registerPlugin(ScrollTrigger); const DigitalMarketingWorkflow = () => { const workflowWrapper = useRef(); useEffect(() => { if (typeof window !== "undefined") { let device_width = window.innerWidth; let tHero = gsap.context(() => { if (device_width > 1200) { var workflow_section_3 = workflowWrapper.current; if (workflow_section_3) { let duration = 1, sections = gsap.utils.toArray(".wf_panel"), sectionIncrement = duration / (sections.length - 1), tl = gsap.timeline({ scrollTrigger: { trigger: ".workflow__wrapper-3", pin: true, scrub: 1, start: "top top", end: "+=5000", }, }); tl.to(sections, { xPercent: -100 * (sections.length - 1), duration: duration, ease: "none", }); sections.forEach((section, index) => { let tween = gsap.from(section, { opacity: 0, scale: 0.6, duration: 0.5, force3D: true, paused: true, }); addSectionCallbacks(tl, { start: sectionIncrement * (index - 0.99), end: sectionIncrement * (index + 0.99), onEnter: () => tween.play(), onLeave: () => tween.reverse(), onEnterBack: () => tween.play(), onLeaveBack: () => tween.reverse(), }); index || tween.progress(1); }); function addSectionCallbacks( timeline, { start, end, param, onEnter, onLeave, onEnterBack, onLeaveBack } ) { let trackDirection = (animation) => { let onUpdate = animation.eventCallback("onUpdate"), prevTime = animation.time(); animation.direction = animation.reversed() ? -1 : 1; animation.eventCallback("onUpdate", () => { let time = animation.time(); if (prevTime !== time) { animation.direction = time < prevTime ? -1 : 1; prevTime = time; } onUpdate && onUpdate.call(animation); }); }, empty = (v) => v; timeline.direction || trackDirection(timeline); start >= 0 && timeline.add( () => ((timeline.direction < 0 ? onLeaveBack : onEnter) || empty)( param ), start ); end <= timeline.duration() && timeline.add( () => ((timeline.direction < 0 ? onEnterBack : onLeave) || empty)( param ), end ); } } for (let i = 1; i < 5; i++) { gsap.from(gsap.utils.toArray(`.count${i}`), { textContent: 0, duration: 1, delay: 3, ease: Power1.easeIn, snap: { textContent: 1 }, stagger: 1, scrollTrigger: { trigger: ".counter__number", }, }); } } }); return () => tHero.revert(); } }, []); return ( <>

why
choose us

why
choose us

Keword,Research Strategy, Survey, & Analytics

Attention, we take out our round glasses and our sweater with elbow patches to go back to the origins of the user experience: the first mention of the user and its importance was born in the

60%

Strategy

Your marketing strategy optimizing performances doesn’t have to be a guessing game.

95%

Audience

Your marketing strategy optimizing performances doesn’t have to be a guessing game.

70%

Keyword

Your marketing strategy optimizing performances doesn’t have to be a guessing game.

Why
Choose Us

25k

Project
completed

8k

Happy
customers

15

Years
experiences

98

Awards
achievement

Counter Image
{/* CTA area start */}

Have you project in mind?

Let’s make something great together!

Contact
with us
{/* CTA area end */}
); }; export default DigitalMarketingWorkflow;