Fix all the fucking connection coloring
This commit is contained in:
		@@ -3,11 +3,10 @@ import React from 'react';
 | 
				
			|||||||
interface ConnectionProps {
 | 
					interface ConnectionProps {
 | 
				
			||||||
  from: { x: number; y: number };
 | 
					  from: { x: number; y: number };
 | 
				
			||||||
  to: { x: number; y: number };
 | 
					  to: { x: number; y: number };
 | 
				
			||||||
  fromColor?: string;
 | 
					  color?: string;
 | 
				
			||||||
  toColor?: string;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const Connection: React.FC<ConnectionProps> = ({ from, to, fromColor, toColor }) => {
 | 
					export const Connection: React.FC<ConnectionProps> = ({ from, to, color }) => {
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <g>
 | 
					    <g>
 | 
				
			||||||
      {/* Glow effect */}
 | 
					      {/* Glow effect */}
 | 
				
			||||||
@@ -16,8 +15,8 @@ export const Connection: React.FC<ConnectionProps> = ({ from, to, fromColor, toC
 | 
				
			|||||||
        y1={from.y}
 | 
					        y1={from.y}
 | 
				
			||||||
        x2={to.x}
 | 
					        x2={to.x}
 | 
				
			||||||
        y2={to.y}
 | 
					        y2={to.y}
 | 
				
			||||||
        stroke={fromColor || "#a855f7"}
 | 
					        stroke={color || "#a855f7"}
 | 
				
			||||||
        strokeWidth="3"
 | 
					        strokeWidth="5"
 | 
				
			||||||
        opacity="0.3"
 | 
					        opacity="0.3"
 | 
				
			||||||
      />
 | 
					      />
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
@@ -27,7 +26,7 @@ export const Connection: React.FC<ConnectionProps> = ({ from, to, fromColor, toC
 | 
				
			|||||||
        y1={from.y}
 | 
					        y1={from.y}
 | 
				
			||||||
        x2={to.x}
 | 
					        x2={to.x}
 | 
				
			||||||
        y2={to.y}
 | 
					        y2={to.y}
 | 
				
			||||||
        stroke={fromColor || "#a855f7"}
 | 
					        stroke={color || "#a855f7"}
 | 
				
			||||||
        strokeWidth="1"
 | 
					        strokeWidth="1"
 | 
				
			||||||
        opacity="0.7"
 | 
					        opacity="0.7"
 | 
				
			||||||
        className="transition-all duration-300"
 | 
					        className="transition-all duration-300"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -177,23 +177,22 @@ export const GalaxyMap = () => {
 | 
				
			|||||||
                if (!fromPos || !toPos) return null;
 | 
					                if (!fromPos || !toPos) return null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // Get colors for both regions
 | 
					                // Get colors for both regions
 | 
				
			||||||
                const fromColor = getSecurityColor(region.security);
 | 
					 | 
				
			||||||
                const toRegion = regions.find(r => r.regionName === connectedRegion);
 | 
					                const toRegion = regions.find(r => r.regionName === connectedRegion);
 | 
				
			||||||
                const toColor = toRegion ? getSecurityColor(toRegion.security) : fromColor;
 | 
					                const avgSecurity = (region.security + toRegion.security) / 2;
 | 
				
			||||||
 | 
					                const color = getSecurityColor(avgSecurity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return (
 | 
					                return (
 | 
				
			||||||
                  <Connection
 | 
					                  <Connection
 | 
				
			||||||
                    key={`${region.regionName}-${connectedRegion}`}
 | 
					                    key={`${region.regionName}-${connectedRegion}`}
 | 
				
			||||||
                    from={fromPos}
 | 
					                    from={fromPos}
 | 
				
			||||||
                    to={toPos}
 | 
					                    to={toPos}
 | 
				
			||||||
                    fromColor={fromColor}
 | 
					                    color={color}
 | 
				
			||||||
                    toColor={toColor}
 | 
					 | 
				
			||||||
                  />
 | 
					                  />
 | 
				
			||||||
                );
 | 
					                );
 | 
				
			||||||
              })
 | 
					              })
 | 
				
			||||||
            )}
 | 
					            )}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            {/* Render nodes */}
 | 
					            {/* Render fromCodes */}
 | 
				
			||||||
            {regions?.map((region) => (
 | 
					            {regions?.map((region) => (
 | 
				
			||||||
              <MapNode
 | 
					              <MapNode
 | 
				
			||||||
                key={region.regionName}
 | 
					                key={region.regionName}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,8 +24,7 @@ interface ProcessedConnection {
 | 
				
			|||||||
  key: string;
 | 
					  key: string;
 | 
				
			||||||
  from: Position;
 | 
					  from: Position;
 | 
				
			||||||
  to: Position;
 | 
					  to: Position;
 | 
				
			||||||
  fromColor: string;
 | 
					  color: string;
 | 
				
			||||||
  toColor: string;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const fetchRegionData = async (regionName: string): Promise<SolarSystem[]> => {
 | 
					const fetchRegionData = async (regionName: string): Promise<SolarSystem[]> => {
 | 
				
			||||||
@@ -80,8 +79,7 @@ export const RegionMap: React.FC<{ regionName: string }> = ({ regionName }) => {
 | 
				
			|||||||
          key: connectionKey,
 | 
					          key: connectionKey,
 | 
				
			||||||
          from: fromPos,
 | 
					          from: fromPos,
 | 
				
			||||||
          to: toPos,
 | 
					          to: toPos,
 | 
				
			||||||
          fromColor: connectionColor,
 | 
					          color: connectionColor
 | 
				
			||||||
          toColor: connectionColor
 | 
					 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
@@ -244,8 +242,7 @@ export const RegionMap: React.FC<{ regionName: string }> = ({ regionName }) => {
 | 
				
			|||||||
                key={connection.key}
 | 
					                key={connection.key}
 | 
				
			||||||
                from={connection.from}
 | 
					                from={connection.from}
 | 
				
			||||||
                to={connection.to}
 | 
					                to={connection.to}
 | 
				
			||||||
                fromColor={connection.fromColor}
 | 
					                color={connection.color}
 | 
				
			||||||
                toColor={connection.toColor}
 | 
					 | 
				
			||||||
              />
 | 
					              />
 | 
				
			||||||
            ))}
 | 
					            ))}
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user