diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index bd10dab..fbb3ab0 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -96,7 +96,7 @@ function App() {
// Filter probes and planets from all bodies
const probes = bodies.filter((b) => b.type === 'probe');
const planets = bodies.filter((b) =>
- b.type === 'planet' || b.type === 'dwarf_planet' || b.type === 'satellite'
+ b.type === 'planet' || b.type === 'dwarf_planet' || b.type === 'satellite' || b.type === 'comet'
);
const handleBodySelect = (body: CelestialBody | null) => {
@@ -138,7 +138,7 @@ function App() {
{/* Header with simplified branding and User Auth */}
b.is_active !== false).length}
selectedBodyName={selectedBody?.name}
user={user}
onOpenAuth={() => setShowAuthModal(true)}
diff --git a/frontend/src/components/CelestialBody.tsx b/frontend/src/components/CelestialBody.tsx
index ea4b006..046b07e 100644
--- a/frontend/src/components/CelestialBody.tsx
+++ b/frontend/src/components/CelestialBody.tsx
@@ -8,10 +8,12 @@ import { useTexture, Html } from '@react-three/drei';
import type { CelestialBody as CelestialBodyType } from '../types';
import { calculateRenderPosition, getOffsetDescription } from '../utils/renderPosition';
import { fetchBodyResources } from '../utils/api';
+import { PLANET_SIZES, SATELLITE_SIZES, getCelestialSize } from '../config/celestialSizes';
interface CelestialBodyProps {
body: CelestialBodyType;
allBodies: CelestialBodyType[];
+ isSelected?: boolean;
}
// Saturn Rings component - multiple rings for band effect
@@ -73,12 +75,13 @@ function SaturnRings() {
}
// Planet component with texture
-function Planet({ body, size, emissive, emissiveIntensity, allBodies }: {
+function Planet({ body, size, emissive, emissiveIntensity, allBodies, isSelected = false }: {
body: CelestialBodyType;
size: number;
emissive: string;
emissiveIntensity: number;
allBodies: CelestialBodyType[];
+ isSelected?: boolean;
}) {
const meshRef = useRef(null);
const position = body.positions[0];
@@ -132,11 +135,12 @@ function Planet({ body, size, emissive, emissiveIntensity, allBodies }: {
meshRef={meshRef}
hasOffset={renderPosition.hasOffset}
allBodies={allBodies}
+ isSelected={isSelected}
/>;
}
// Separate component to handle texture loading
-function PlanetMesh({ body, size, emissive, emissiveIntensity, scaledPos, texturePath, position, meshRef, hasOffset, allBodies }: {
+function PlanetMesh({ body, size, emissive, emissiveIntensity, scaledPos, texturePath, position, meshRef, hasOffset, allBodies, isSelected = false }: {
body: CelestialBodyType;
size: number;
emissive: string;
@@ -147,6 +151,7 @@ function PlanetMesh({ body, size, emissive, emissiveIntensity, scaledPos, textur
meshRef: React.RefObject;
hasOffset: boolean;
allBodies: CelestialBodyType[];
+ isSelected?: boolean;
}) {
// Load texture if path is provided
const texture = texturePath ? useTexture(texturePath) : null;
@@ -212,25 +217,27 @@ function PlanetMesh({ body, size, emissive, emissiveIntensity, scaledPos, textur
distanceFactor={10}
style={{
color: body.type === 'star' ? '#FDB813' : '#ffffff',
- fontSize: '11px',
+ fontSize: '9px', // 从 11px 减小到 9px
fontWeight: 'bold',
textShadow: '0 0 4px rgba(0,0,0,0.8)',
pointerEvents: 'none',
userSelect: 'none',
whiteSpace: 'nowrap',
+ opacity: isSelected ? 1 : 0.4, // 未选中时更暗淡
+ transition: 'opacity 0.3s ease',
}}
>
{body.name_zh || body.name}
{offsetDesc && (
<>
-
+ {/* 从 9px 减小到 7px */}
{offsetDesc}
>
)}
-
+ {/* 从 8px 减小到 7px */}
{distance.toFixed(2)} AU