"use client"; import React, { useState, useEffect, useRef } from "react"; import gsap from "gsap"; import { ScrollTrigger } from "gsap/ScrollTrigger"; if (typeof window !== "undefined") { gsap.registerPlugin(ScrollTrigger); } const ROADMAP_DATA = [ { year: 2026, pct: 25, trackLeft: "12.5%", phase: "Pilot Phase", phaseClass: "yellow", title: "Hyderabad Pilot", desc: "Launch operations in Hyderabad with dedicated EV hubs and MileTruth AI v1.0.", icon: ( ), stats: [ { text: "50-80 orders/day", icon: }, { text: "1 city", icon: }, { text: "10+ women partners", icon: } ] }, { year: 2027, pct: 50, trackLeft: "37.5%", phase: "Multi-City", phaseClass: "green", title: "Multi-City Scale", desc: "Expand to Bengaluru and Chennai, securing key B2B enterprise traction.", icon: ( ), stats: [ { text: "300-500 orders/day", icon: }, { text: "3 cities", icon: }, { text: "50+ EVs", icon: } ] }, { year: 2028, pct: 75, trackLeft: "62.5%", phase: "Platform", phaseClass: "blue", title: "Platform Expansion", desc: "Scale to 5+ cities. Launch developer API marketplace and Series A readiness.", icon: ( ), stats: [ { text: "1,200+ orders/day", icon: }, { text: "5+ cities", icon: }, { text: "API marketplace", icon: } ] }, { year: 2030, pct: 100, trackLeft: "87.5%", phase: "Vision State", phaseClass: "white-pill", title: "AI Pulse Layer", desc: "Nationwide AI logistics grid reaching 15+ cities, empowering female micro-entrepreneurs.", icon: ( ), stats: [ { text: "5,000+ orders/day", icon: }, { text: "Rs 65 Cr+ revenue", icon: Rs }, { text: "2,000+ women partners", icon: } ] } ]; export default function IntelligenceGrid() { const [activeYear, setActiveYear] = useState(2030); const containerRef = useRef(null); const canvasRef = useRef(null); // Map year to target percent const getActivePercent = () => { if (activeYear === 2026) return 25; if (activeYear === 2027) return 50; if (activeYear === 2028) return 75; return 100; }; // Map year to timeline horizontal track width const getTrackWidth = () => { if (activeYear === 2026) return "12.5%"; if (activeYear === 2027) return "37.5%"; if (activeYear === 2028) return "62.5%"; return "87.5%"; }; useEffect(() => { const container = containerRef.current; if (!container) return; // 1. Dotted City Connections Canvas loops const canvas = canvasRef.current; if (!canvas) return; const ctx = canvas.getContext("2d"); if (!ctx) return; let animationFrameId: number; let width = (canvas.width = canvas.offsetWidth); let height = (canvas.height = canvas.offsetHeight); const handleResize = () => { if (!canvas) return; width = canvas.width = canvas.offsetWidth; height = canvas.height = canvas.offsetHeight; }; window.addEventListener("resize", handleResize); const nodes = [ { name: "Hyderabad", x: 0.18, y: 0.55 }, { name: "Chennai", x: 0.42, y: 0.72 }, { name: "Bengaluru", x: 0.64, y: 0.42 }, { name: "Mumbai", x: 0.82, y: 0.62 } ]; const particles = [ { from: 0, to: 1, t: 0, speed: 0.005 }, { from: 1, to: 2, t: 0.3, speed: 0.004 }, { from: 2, to: 3, t: 0.6, speed: 0.006 } ]; const draw = () => { ctx.clearRect(0, 0, width, height); // Draw faint connection lines ctx.lineWidth = 1.5; ctx.setLineDash([6, 6]); ctx.strokeStyle = "rgba(220, 38, 38, 0.12)"; ctx.beginPath(); for (let i = 0; i < nodes.length - 1; i++) { const startX = nodes[i].x * width; const startY = nodes[i].y * height; const endX = nodes[i + 1].x * width; const endY = nodes[i + 1].y * height; ctx.moveTo(startX, startY); ctx.lineTo(endX, endY); } ctx.stroke(); ctx.setLineDash([]); // Draw flowing sparks along connections particles.forEach((p) => { p.t += p.speed; if (p.t >= 1) p.t = 0; const startNode = nodes[p.from]; const endNode = nodes[p.to]; const startX = startNode.x * width; const startY = startNode.y * height; const endX = endNode.x * width; const endY = endNode.y * height; const curX = startX + (endX - startX) * p.t; const curY = startY + (endY - startY) * p.t; ctx.beginPath(); ctx.arc(curX, curY, 4, 0, Math.PI * 2); ctx.fillStyle = "#c01227"; ctx.shadowColor = "#c01227"; ctx.shadowBlur = 10; ctx.fill(); ctx.shadowBlur = 0; }); // City labels & glow halos nodes.forEach((n) => { const xCoord = n.x * width; const yCoord = n.y * height; ctx.beginPath(); ctx.arc(xCoord, yCoord, 8, 0, Math.PI * 2); ctx.fillStyle = "rgba(220, 38, 38, 0.08)"; ctx.fill(); ctx.beginPath(); ctx.arc(xCoord, yCoord, 3, 0, Math.PI * 2); ctx.fillStyle = "rgba(255, 255, 255, 0.25)"; ctx.fill(); ctx.fillStyle = "rgba(255, 255, 255, 0.12)"; ctx.font = "bold 11px 'Manrope', sans-serif"; ctx.textAlign = "center"; ctx.fillText(n.name, xCoord, yCoord - 14); }); animationFrameId = requestAnimationFrame(draw); }; draw(); return () => { window.removeEventListener("resize", handleResize); cancelAnimationFrame(animationFrameId); }; }, []); // Circular progress calculations const activePercent = getActivePercent(); const radius = 30; const circumference = 2 * Math.PI * radius; // 188.49 const strokeOffset = circumference * (1 - activePercent / 100); return ( {/* Subtle Canvas Dotted Logistics Network Background */} {/* Floating background glowing spotlights */} {/* Header tag and Titles */} VISION / 2030 The Intelligence Grid Behind Every Urban Mile From Hyderabad EV pilot to nationwide AI logistics intelligence by 2030 {/* Interactive glowing timeline progress track */} ROADMAP TO 2030 {/* Timeline Track fillers */} {/* Glowing active year nodes */} {ROADMAP_DATA.map((node) => ( = node.year ? "active" : ""}`} style={{ left: node.trackLeft }} > {activeYear === node.year && ( )} ))} {/* Circular glowing progress SVG ring */} {activePercent}% COMPLETE → {/* 3D Floating Grid cards */} {ROADMAP_DATA.map((card) => { const is2030 = card.year === 2030; const isActive = activeYear === card.year; return ( setActiveYear(card.year)} className={`roadmap-col-card ${is2030 ? "glowing-vision-card" : ""} ${isActive ? "active" : ""}`} data-card={card.year} > {/* Sparkles particles loop (for 2030 only) */} {is2030 && ( <> > )} {card.year} {card.icon} {card.phase} {card.title} {card.desc} {card.stats.map((stat, sIndex) => ( {stat.icon} {stat.text} ))} ); })} ); }
From Hyderabad EV pilot to nationwide AI logistics intelligence by 2030
{card.desc}