import React, { useRef, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { Icons } from './landing/constants'; import gsap from 'gsap'; import { ScrollTrigger } from 'gsap/ScrollTrigger'; gsap.registerPlugin(ScrollTrigger); const services = [ { title: "Commercial & Residential Repair and Diagnostics", desc: "Leak detection & shingle replacement in record time. We identify micro-fractures invisible to the naked eye using drone-captured LiDAR scans and AI-powered thermal analysis.", icon: Icons.Home, color: "from-blue-400 to-blue-600", glow: "shadow-blue-500/20", badge: "Licensed", badgeClass: "permit-stamp--verified", badgeIcon: "\u2713", stat: 5847, statLabel: "Properties Inspected", }, { title: "Lead & Data Solutions", desc: "Advanced lead scoring and real-time storm tracking alerts. Know where the damage is before the phone rings. We direct your reps and marketing into high-impact zones where probability, urgency and opportunity align.", icon: Icons.Chart, color: "from-purple-400 to-indigo-600", glow: "shadow-purple-500/20", badge: "Certified", badgeClass: "permit-stamp--accent", badgeIcon: "\u25B9", stat: 96, statSuffix: "%", statLabel: "Lead Accuracy", } ]; const Services = () => { const navigate = useNavigate(); const statRefs = useRef([]); useEffect(() => { // Animated Stat Counters statRefs.current.forEach((el) => { if (!el) return; const target = parseFloat(el.dataset.target); const suffix = el.dataset.suffix || ''; const counter = { value: 0 }; el.innerText = '0' + suffix; const formatNumber = (num) => { return Math.round(num).toLocaleString('en-US'); }; gsap.to(counter, { value: target, duration: 2.5, ease: "power2.out", scrollTrigger: { trigger: el, start: "top 85%", toggleActions: "play none none none", }, onUpdate: () => { el.innerText = formatNumber(counter.value) + suffix; }, snap: { value: 1 } }); }); }, []); const handleMouseMove = (e) => { const card = e.currentTarget; const rect = card.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; const centerX = rect.width / 2; const centerY = rect.height / 2; const rotateX = ((y - centerY) / centerY) * -4; const rotateY = ((x - centerX) / centerX) * 4; card.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale(1.02)`; }; const handleMouseLeave = (e) => { e.currentTarget.style.transform = 'perspective(1000px) rotateX(0) rotateY(0) scale(1)'; }; return (
▷ Core Operations

What We Do Best

Military-grade technology applied to civilian roofing. Two pillars, one platform.

{services.map((service, idx) => (
{/* Measurement ticks — top */}
{/* Gradient glow on hover */}
{/* Top row: Icon + Service number */}
0{idx + 1}

{service.title}

{service.desc}

{/* Inline stat with animation */}
statRefs.current[idx] = el} data-target={service.stat} data-suffix={service.statSuffix || ''} className="font-mono text-2xl font-bold text-zinc-900 dark:text-white tracking-tight" > 0{service.statSuffix || ''} {service.statLabel}
{/* Footer row: Permit stamp + CTA */}
{service.badgeIcon} {service.badge}
{ e.stopPropagation(); navigate('/login'); }} className="flex items-center gap-2 text-xs font-bold text-zinc-500 uppercase tracking-wider group-hover:text-blue-400 transition-colors" > Explore
{/* Measurement ticks — bottom */}
))}
{/* Trust signals strip */}
{[ { label: "AI-Powered Analysis", icon: "◉" }, { label: "15-Min Turnaround", icon: "◉" }, { label: "Drone-Powered Inspections", icon: "◉" }, { label: "Insurance-Ready Reports", icon: "◉" }, ].map((item, i) => (
{item.icon} {item.label}
))}
); }; export default Services;