import { useEffect, useRef } from "react"; import { gsap } from "gsap"; import { SplitText } from "@/plugins"; import ArrowDownSm from "../../../public/assets/imgs/icon/arrow-down-sm.png"; import Hero31 from "../../../public/assets/imgs/hero/3/1.jpg"; import Image from "next/image.js"; const DigitalMarketingHero = () => { const titleLeft = useRef(); const titleRight = useRef(); const heroTextAnim = useRef(); const videoCheck = useRef(); const videoCloseSection = useRef(); const videoTitle = useRef(); const heroArea = useRef(); const wrapper = useRef(); useEffect(() => { if (typeof window !== "undefined") { let split_creatives = new SplitText(titleLeft.current, { type: "chars" }); let split_solutions = new SplitText(titleRight.current, { type: "chars", }); let split_text_animation = new SplitText(heroTextAnim.current, { type: "chars words", }); let tHero = gsap.context(() => { let HomeDigital = gsap.timeline(); HomeDigital.from(split_creatives.chars, { duration: 2, x: 100, autoAlpha: 0, stagger: 0.2, }); HomeDigital.from( split_solutions.chars, { duration: 1, x: 100, autoAlpha: 0, stagger: 0.1 }, "-=1" ); HomeDigital.from( split_text_animation.words, { duration: 1, x: 50, autoAlpha: 0, stagger: 0.05 }, "-=1" ); }); return () => tHero.revert(); } }, []); const openVideo = () => { let headerArea = document.querySelector(".header__area-3"); let video = videoTitle.current; let videoClose = videoCloseSection.current; if (videoCheck.current.checked) { wrapper.current.style.zIndex = "1"; video.style.display = "none"; videoClose.style.display = "block"; heroArea.current.classList.add("start-video"); headerArea.classList.add("bg-white"); } else { wrapper.current.style.zIndex = "999"; video.style.display = "block"; videoClose.style.display = "none"; heroArea.current.classList.remove("start-video"); headerArea.classList.remove("bg-white"); } }; return ( <>

For

Startups

{/*

*/}

Affordable development packages for startups. Get everything you need, from website design to advanced digital solutions. Perfect for building, growing, and scaling your business with ease.

{/*

Watch video intro

Close video intro

*/}
Hero Image
); }; export default DigitalMarketingHero;