import { useEffect, useRef, useState } from "react"; import { gsap } from "gsap"; import { ScrollTrigger } from "@/plugins"; import Link from "next/link"; // import Service11 from "../../../public/assets/imgs/service/1/1.jpg"; // import Service12 from "../../../public/assets/imgs/service/1/2.png"; // import Service13 from "../../../public/assets/imgs/service/1/3.png"; // import Service14 from "../../../public/assets/imgs/service/1/4.png"; import Image from "next/image"; gsap.registerPlugin(ScrollTrigger); const ServiceElementV2 = () => { const [activeList, setActiveList] = useState(1); const [activeImg, setActiveImg] = useState(1); const [activeShape, setActiveShape] = useState(1); const serviceList = useRef(); useEffect(() => { if (typeof window !== "undefined") { let listItem = serviceList.current.children; console.log(listItem); for (let i = 0; i < listItem.length; i++) { listItem[i].addEventListener("mousemove", function (e) { var service_id = this.getAttribute("data-service"); setActiveImg(parseInt(service_id)); setActiveShape(parseInt(service_id)); if (service_id != 1) { setActiveList(0); } }); listItem[i].addEventListener("mouseout", function (e) { var service_id = this.getAttribute("data-service"); setActiveList(parseInt(service_id)); }); } let tHero = gsap.context(() => { let home1_services = gsap.utils.toArray(".animation_home1_service"); let service__number = gsap.utils.toArray( ".animation_home1_service .service__number span" ); let service__title = gsap.utils.toArray( ".animation_home1_service .service__title" ); let service__text = gsap.utils.toArray( ".animation_home1_service .service__text p" ); let service__link = gsap.utils.toArray( ".animation_home1_service .service__link p" ); home1_services.forEach((service, i) => { gsap.set( [ service__number[i], service__title[i], service__text[i], service__link[i], ], { opacity: 0, x: -50 } ); let home1ServiceTl = gsap.timeline({ scrollTrigger: { trigger: service, start: "top center+=300", end: "bottom bottom", markers: false, }, }); home1ServiceTl.to(service__number[i], { x: 0, opacity: 1, duration: 1.2, }); home1ServiceTl.to( service__title[i], { x: 0, opacity: 1, duration: 1.2, }, "-=1" ); home1ServiceTl.to( service__text[i], { x: 0, opacity: 1, duration: 1.2, }, "-=1" ); home1ServiceTl.to( service__link[i], { x: 0, opacity: 1, duration: 1.2, }, "-=1" ); }); }); return () => tHero.revert(); } }, []); return ( <>

service

Solution we
provide

With every single one of our clients we bring forth a deep passion for creative problem solving innovations{" "} forward thinking brands boundaries

{/*
Service Image Service Image Service Image Service Image
01

Web & Mobile Development

We create, products, brands, apps & websites for the companies all around the world class digital products

02

Interaction
Design

We create, products, brands, apps & websites for the companies all around the world class digital products

03

Digital
Maketing

We create, products, brands, apps & websites for the companies all around the world class digital products

04

Branding and Strategy

We create, products, brands, apps & websites for the companies all around the world class digital products

*/}
); }; export default ServiceElementV2;