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

@@ -1,4 +1,5 @@
// info-card.js - Unified info card module
import { showStatusMessage } from './ui.js';
let currentType = null;
@@ -55,7 +56,32 @@ const CARD_CONFIG = {
};
export function initInfoCard() {
// Close button removed - now uses external clear button
const content = document.getElementById('info-card-content');
if (!content || content.dataset.copyBound === 'true') return;
content.addEventListener('click', async (event) => {
const label = event.target.closest('.info-card-label');
if (!label) return;
const property = label.closest('.info-card-property');
const valueEl = property?.querySelector('.info-card-value');
const value = valueEl?.textContent?.trim();
if (!value || value === '-') {
showStatusMessage('无可复制内容', 'warning');
return;
}
try {
await navigator.clipboard.writeText(value);
showStatusMessage(`已复制${label.textContent}${value}`, 'success');
} catch (error) {
console.error('Copy failed:', error);
showStatusMessage('复制失败', 'error');
}
});
content.dataset.copyBound = 'true';
}
export function setInfoCardNoBorder(noBorder = true) {