import React, { useMemo } from 'react'; import type { RiverPath, MapTheme } from '../../types/mapTypes'; import { RealisticTree } from './RealisticTree'; interface RealisticRiverProps { river: RiverPath; theme: MapTheme; showLabels: boolean; } export const RealisticRiver: React.FC = ({ river, theme, showLabels, }) => { const isDark = theme.id !== 'parchment'; const pencil = theme.pencilColor; const shade = theme.pencilShade; // Muted antique verdigris-sepia water wash instead of bright digital blue const waterFill = isDark ? '#1e2b2e' : '#b8c5be'; const foamColor = isDark ? '#d8c8b0' : '#f2e6ce'; const riverConfig = useMemo(() => { if (river.id === 'river-elden') { return { // Tapers to a pointed mountain spring at (1348, 365) inside Dragon's Eye Tarn riverPoly: `M 1348,365 C 1322,410 1274,465 1222,535 C 1152,635 1032,695 972,815 C 910,935 942,1055 892,1175 C 850,1275 770,1355 698,1480 L 668,1480 C 745,1355 825,1275 865,1175 C 915,1055 885,935 948,815 C 1008,695 1132,635 1205,535 C 1258,465 1314,410 1348,365 Z`, leftBank: 'M 1348,365 C 1314,410 1258,465 1205,535 C 1132,635 1008,695 948,815 C 885,935 915,1055 865,1175 C 825,1275 745,1355 668,1480', rightBank: 'M 1348,365 C 1322,410 1274,465 1222,535 C 1152,635 1032,695 972,815 C 910,935 942,1055 892,1175 C 850,1275 770,1355 698,1480', labelPos: { x: 1035, y: 980, rot: -55 }, islands: [ { cx: 958, cy: 960, rx: 13, ry: 6, angle: -45, name: 'Elden Ait' }, { cx: 770, cy: 1330, rx: 16, ry: 7, angle: -50, name: 'Otter Shoal' }, ], waterfall: { x: 1214, y: 538, width: 24, height: 20, angle: -38, name: 'The Elden Cascades', }, rapids: [ { x: 1140, y: 660, angle: -40 }, { x: 920, y: 1020, angle: 60 }, ], sandbars: [ { cx: 995, cy: 750, rx: 11, ry: 4.5, angle: 30 }, { cx: 900, cy: 1110, rx: 13, ry: 5, angle: -25 }, ], bridges: river.hasBridges || [ { x: 945, y: 855, angle: -35, type: 'stone_arch', name: 'Highbridge' }, { x: 890, y: 1160, angle: 25, type: 'timber_trestle', name: 'Lower Toll Bridge' }, ], }; } else if (river.id === 'river-silver') { return { // Tapers from Mistwood Tarn (585, 395) into River Elden at (958, 820) riverPoly: `M 585,395 C 645,478 730,545 782,656 C 832,756 912,806 962,816 L 955,826 C 904,816 824,766 774,664 C 724,554 642,484 585,395 Z`, leftBank: 'M 585,395 C 642,484 724,554 774,664 C 824,766 904,816 955,826', rightBank: 'M 585,395 C 645,478 730,545 782,656 C 832,756 912,806 962,816', labelPos: { x: 740, y: 710, rot: 35 }, islands: [{ cx: 710, cy: 535, rx: 9, ry: 4.5, angle: 35, name: 'Willow Islet' }], waterfall: { x: 625, y: 452, width: 18, height: 15, angle: 45, name: 'Silver Falls', }, rapids: [{ x: 810, y: 710, angle: 50 }], sandbars: [{ cx: 755, cy: 610, rx: 8, ry: 3.5, angle: 40 }], bridges: river.hasBridges || [ { x: 740, y: 620, angle: 45, type: 'stone_arch', name: 'Silver Arch' }, ], }; } else { // Eastern River: Now tapers to a narrow spring at (2125, 420) and winds in organic S-curves! return { riverPoly: `M 2125,420 C 2065,500 2095,610 2025,720 C 1955,830 2015,960 1915,1080 C 1815,1200 1755,1340 1668,1500 L 1638,1500 C 1730,1340 1792,1200 1895,1080 C 1995,960 1938,830 2012,720 C 2082,610 2058,500 2125,420 Z`, leftBank: 'M 2125,420 C 2058,500 2082,610 2012,720 C 1938,830 1995,960 1895,1080 C 1792,1200 1730,1340 1638,1500', rightBank: 'M 2125,420 C 2065,500 2095,610 2025,720 C 1955,830 2015,960 1915,1080 C 1815,1200 1755,1340 1668,1500', labelPos: { x: 1935, y: 1020, rot: -52 }, islands: [{ cx: 1850, cy: 1155, rx: 11, ry: 5, angle: -52, name: 'Crag Islet' }], waterfall: { x: 2048, y: 660, width: 20, height: 18, angle: -35, name: 'The Great Cataract', }, rapids: [{ x: 1975, y: 860, angle: -55 }], sandbars: [{ cx: 1945, cy: 990, rx: 10, ry: 4.5, angle: -50 }], bridges: river.hasBridges || [ { x: 1982, y: 785, angle: -28, type: 'stone_arch', name: 'Highland Span' }, ], }; } }, [river.id, river.hasBridges]); const sandbarFill = isDark ? '#3d3425' : '#e6dcbf'; const islandVegetation = isDark ? '#263422' : '#d2d8ba'; return ( {/* 1. Main Water Body Tapered Ribbon */} {/* 2. Outer Riverbank Double Contour */} {/* Parallel Engraved Shoreline Waterlining */} {/* 3. Internal River Flow Streamlines */} {/* 4. Natural Sandbars & Gravel Shoals */} {riverConfig.sandbars.map((sb, sbIdx) => ( ))} {/* 5. River Rapids */} {riverConfig.rapids.map((rapid, rIdx) => ( ))} {/* 6. River Islands */} {riverConfig.islands.map((island, isIdx) => ( 14 ? 0.55 : 0.42})`}> {showLabels && island.name && island.rx > 12 && ( {island.name} )} ))} {/* 7. Waterfall */} {riverConfig.waterfall && ( {/* Rocky Ledge */} {showLabels && riverConfig.waterfall.name && ( {riverConfig.waterfall.name} )} )} {/* 8. Historic Bridges */} {riverConfig.bridges.map((bridge, bIdx) => ( {showLabels && bridge.name && ( {bridge.name} )} ))} {/* 9. River Name Label with Parchment Halo */} {showLabels && ( ~ {river.name} ~ )} ); };