import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'; import { motion, useMotionTemplate, useMotionValue, useReducedMotion } from 'framer-motion'; import { Link } from 'react-router-dom'; import gsap from 'gsap'; import { ScrollTrigger } from 'gsap/ScrollTrigger'; import SEO from '../../components/SEO'; import Breadcrumb from '../../components/Breadcrumb'; import Services from '../../components/Services'; import CTA from '../../components/CTA'; import FAQ from '../../components/FAQ'; import AreasWeServe from '../../components/AreasWeServe'; import { ServiceData } from '../data/seoData'; import heroBg from '../assets/hero-bg.webp'; gsap.registerPlugin(ScrollTrigger); interface ServicePageProps { data: ServiceData; } const ServicePage: React.FC = ({ data }) => { const containerRef = useRef(null); const parallaxWrapperRef = useRef(null); const mouseX = useMotionValue(0); const mouseY = useMotionValue(0); const prefersReducedMotion = useReducedMotion(); const [isInteractive, setIsInteractive] = useState(false); const maskImage = useMotionTemplate`radial-gradient(100px circle at ${mouseX}px ${mouseY}px, black, transparent)`; const webkitMaskImage = useMotionTemplate`radial-gradient(100px circle at ${mouseX}px ${mouseY}px, black, transparent)`; useEffect(() => { if (prefersReducedMotion || typeof window === 'undefined') { setIsInteractive(false); return; } const mediaQuery = window.matchMedia('(pointer: fine) and (hover: hover)'); const updateState = () => setIsInteractive(mediaQuery.matches); updateState(); if (typeof mediaQuery.addEventListener === 'function') { mediaQuery.addEventListener('change', updateState); return () => mediaQuery.removeEventListener('change', updateState); } mediaQuery.addListener(updateState); return () => mediaQuery.removeListener(updateState); }, [prefersReducedMotion]); const handleMouseMove = ({ currentTarget, clientX, clientY }: React.MouseEvent) => { if (!isInteractive) return; const { left, top } = currentTarget.getBoundingClientRect(); mouseX.set(clientX - left); mouseY.set(clientY - top + 75); }; useLayoutEffect(() => { if (!isInteractive) { return; } const ctx = gsap.context(() => { // Parallax Background if (parallaxWrapperRef.current) { gsap.to(parallaxWrapperRef.current, { yPercent: 30, ease: "none", scrollTrigger: { trigger: containerRef.current, start: "top top", end: "bottom top", scrub: true } }); } // Text Stagger Animation gsap.fromTo(".hero-stagger", { y: 50, opacity: 0 }, { y: 0, opacity: 1, duration: 1, stagger: 0.2, ease: "power3.out", delay: 0.2 } ); }, containerRef); return () => ctx.revert(); }, [isInteractive]); useEffect(() => { window.scrollTo(0, 0); }, []); const schema = { "@context": "https://schema.org", "@type": "Service", "name": data.h1, "description": data.description, "url": `https://bayareait.services/${data.slug}`, "provider": { "@type": "LocalBusiness", "name": "Bay Area Affiliates", "url": "https://bayareait.services", "telephone": "+1-361-765-8400", "address": { "@type": "PostalAddress", "addressLocality": "Corpus Christi", "addressRegion": "TX", "addressCountry": "US" } }, "areaServed": [ { "@type": "City", "name": "Corpus Christi" }, { "@type": "City", "name": "Portland" }, { "@type": "City", "name": "Rockport" }, { "@type": "City", "name": "Aransas Pass" }, { "@type": "City", "name": "Kingsville" } ] }; return ( <>
{/* Hero Section */}
{/* Parallax Background */}
{/* Base Layer */} Abstract dark technology background {isInteractive && (
{/* Hero Content */}
Professional IT Services

{data.h1.split(' ').slice(0, -2).join(' ')}
{data.h1.split(' ').slice(-2).join(' ')}

{data.description}

Get Started View All Services
{/* Main Content Section */}
{/* Feature Highlight Section */}
speed

Fast Response

Quick resolution of IT issues to minimize downtime and keep your business running smoothly.

verified_user

Proactive Security

Advanced security measures and monitoring to protect your business from cyber threats.

support_agent

Expert Team

Experienced IT professionals dedicated to providing exceptional service and support.

{/* Services Section */} {/* Areas We Serve & CTA */}
); }; export default ServicePage;