fix: redesign earth hud interactions and legend behavior

This commit is contained in:
linkong
2026-03-26 17:58:03 +08:00
parent ab09f0ba78
commit 30a29a6e34
15 changed files with 988 additions and 364 deletions

View File

@@ -74,6 +74,7 @@ import {
hideInfoCard,
setInfoCardNoBorder,
} from "./info-card.js";
import { initLegend, setLegendMode } from "./legend.js";
export let scene;
export let camera;
@@ -194,6 +195,7 @@ function isSameCable(cable1, cable2) {
}
function showCableInfo(cable) {
setLegendMode("cables");
showInfoCard("cable", {
name: cable.userData.name,
owner: cable.userData.owner,
@@ -211,6 +213,7 @@ function showSatelliteInfo(props) {
const perigee = (6371 * (1 - ecc)).toFixed(0);
const apogee = (6371 * (1 + ecc)).toFixed(0);
setLegendMode("satellites");
showInfoCard("satellite", {
name: props?.name || "-",
norad_id: props?.norad_cat_id,
@@ -333,6 +336,7 @@ export function init() {
addLights();
initInfoCard();
initLegend();
const earthObj = createEarth(scene);
targetRotation = {
x: earthObj.rotation.x,