'use client'; import React, { useEffect, useState } from 'react'; // Isometric grid configuration - true 2:1 isometric projection const CELL_WIDTH = 120; const CELL_HEIGHT = 60; // Half of width for 2:1 isometric // Convert grid coordinates to isometric screen coordinates function gridToScreen(col: number, row: number): { x: number; y: number } { return { x: (col - row) * (CELL_WIDTH / 2), y: (col + row) * (CELL_HEIGHT / 2), }; } // Grid layout (10 columns x 8 rows) const GRID = { cols: 10, rows: 8, }; // Infrastructure positions const INFRASTRUCTURE = { solar: [ { col: 0, row: 5 }, { col: 1, row: 5 }, { col: 0, row: 6 }, { col: 1, row: 6 }, { col: 2, row: 7 }, { col: 3, row: 7 }, { col: 2, row: 8 }, { col: 3, row: 8 }, ], wind: [ { col: 0, row: 1 }, { col: 1, row: 2 }, { col: 2, row: 1 }, { col: 3, row: 0 }, { col: 4, row: 1 }, { col: 5, row: 0 }, ], substations: [ { col: 3, row: 3, type: 'collection' }, { col: 6, row: 4, type: 'distribution' }, { col: 5, row: 7, type: 'distribution' }, ], towers: [ { col: 4, row: 3 }, { col: 5, row: 4 }, { col: 4, row: 5 }, { col: 5, row: 6 }, ], city: [ { col: 8, row: 3, type: 'tall' }, { col: 9, row: 4, type: 'medium' }, { col: 8, row: 5, type: 'small' }, { col: 9, row: 5, type: 'medium' }, ], city2: [ { col: 6, row: 8, type: 'medium' }, { col: 7, row: 7, type: 'tall' }, { col: 7, row: 8, type: 'small' }, ], trees: [ { col: 0, row: 3 }, { col: 2, row: 6 }, { col: 3, row: 1 }, { col: 6, row: 2 }, { col: 6, row: 6 }, ], }; const POWER_LINES = [ { from: { col: 0, row: 1 }, to: { col: 1, row: 1 } }, { from: { col: 1, row: 2 }, to: { col: 1, row: 1 } }, { from: { col: 2, row: 1 }, to: { col: 1, row: 1 } }, { from: { col: 1, row: 1 }, to: { col: 1, row: 3 } }, { from: { col: 1, row: 3 }, to: { col: 3, row: 3 } }, { from: { col: 3, row: 0 }, to: { col: 4, row: 0 } }, { from: { col: 4, row: 0 }, to: { col: 4, row: 1 } }, { from: { col: 5, row: 0 }, to: { col: 5, row: 1 } }, { from: { col: 5, row: 1 }, to: { col: 4, row: 1 } }, { from: { col: 4, row: 1 }, to: { col: 4, row: 3 } }, { from: { col: 4, row: 3 }, to: { col: 3, row: 3 } }, { from: { col: 0, row: 5 }, to: { col: 1, row: 5 } }, { from: { col: 0, row: 6 }, to: { col: 0, row: 5 } }, { from: { col: 1, row: 6 }, to: { col: 1, row: 5 } }, { from: { col: 1, row: 5 }, to: { col: 1, row: 3 } }, { from: { col: 2, row: 7 }, to: { col: 3, row: 7 } }, { from: { col: 2, row: 8 }, to: { col: 2, row: 7 } }, { from: { col: 3, row: 8 }, to: { col: 3, row: 7 } }, { from: { col: 3, row: 7 }, to: { col: 3, row: 5 } }, { from: { col: 3, row: 5 }, to: { col: 3, row: 3 } }, { from: { col: 3, row: 3 }, to: { col: 4, row: 3 } }, { from: { col: 4, row: 3 }, to: { col: 5, row: 3 } }, { from: { col: 5, row: 3 }, to: { col: 5, row: 4 } }, { from: { col: 5, row: 4 }, to: { col: 6, row: 4 } }, { from: { col: 6, row: 4 }, to: { col: 7, row: 4 } }, { from: { col: 7, row: 4 }, to: { col: 8, row: 4 } }, { from: { col: 8, row: 4 }, to: { col: 8, row: 3 } }, { from: { col: 8, row: 4 }, to: { col: 8, row: 5 } }, { from: { col: 8, row: 3 }, to: { col: 9, row: 3 } }, { from: { col: 9, row: 3 }, to: { col: 9, row: 4 } }, { from: { col: 8, row: 5 }, to: { col: 9, row: 5 } }, { from: { col: 3, row: 3 }, to: { col: 3, row: 5 } }, { from: { col: 3, row: 5 }, to: { col: 4, row: 5 } }, { from: { col: 4, row: 5 }, to: { col: 5, row: 5 } }, { from: { col: 5, row: 5 }, to: { col: 5, row: 6 } }, { from: { col: 5, row: 6 }, to: { col: 5, row: 7 } }, { from: { col: 5, row: 7 }, to: { col: 6, row: 7 } }, { from: { col: 6, row: 7 }, to: { col: 6, row: 8 } }, { from: { col: 6, row: 7 }, to: { col: 7, row: 7 } }, { from: { col: 7, row: 7 }, to: { col: 7, row: 8 } }, ]; export default function HeroIllustration() { const [isMobile, setIsMobile] = useState(false); useEffect(() => { const checkMobile = () => setIsMobile(window.innerWidth < 768); checkMobile(); window.addEventListener('resize', checkMobile); return () => window.removeEventListener('resize', checkMobile); }, []); const viewBox = isMobile ? '400 0 1000 1100' : '-400 -200 1800 1100'; // Increase scale slightly and opacity significantly on mobile to fix the "thin" appearance const scale = isMobile ? 1.6 : 1; const opacity = isMobile ? 0.9 : 0.85; return (