## Bug修复详情 ### 1. 致命错误:球面距离计算 (calculateDistance) - 问题:使用勾股定理计算经纬度距离,在球体表面完全错误 - 修复:改用Haversine公式计算球面大圆距离 - 影响:赤道1度=111km,极地1度=19km,原计算误差巨大 ### 2. 经度范围规范化 (vector3ToLatLon) - 问题:Math.atan2返回[-180°,180°],转换后可能超出标准范围 - 修复:添加while循环规范化到[-180, 180]区间 - 影响:避免本初子午线附近返回360°的异常值 ### 3. 屏幕坐标转换支持非全屏 (screenToEarthCoords) - 问题:假设Canvas永远全屏,非全屏时点击偏移严重 - 修复:新增domElement参数,使用getBoundingClientRect()计算相对坐标 - 影响:嵌入式3D地球组件也能精准拾取 ### 4. 地球旋转时经纬度映射错误 - 问题:Raycaster返回世界坐标,未考虑地球自转 - 修复:使用earth.worldToLocal()转换到本地坐标空间 - 影响:地球旋转时经纬度显示正确跟随 ## 新增功能 - CelesTrak卫星数据采集器 - Space-Track卫星数据采集器 - 卫星可视化模块(500颗,实时SGP4轨道计算) - 海底光缆悬停显示info-card - 统一info-card组件 - 工具栏按钮(Stellarium风格) - 缩放控制(百分比显示) - Docker volume映射(代码热更新) ## 文件变更 - utils.js: 坐标转换核心逻辑修复 - satellites.js: 新增卫星可视化 - cables.js: 悬停交互支持 - main.js: 悬停/锁定逻辑 - controls.js: 工具栏UI - info-card.js: 统一卡片组件 - docker-compose.yml: volume映射 - restart.sh: 简化重启脚本
248 lines
4.4 KiB
CSS
248 lines
4.4 KiB
CSS
/* info-panel */
|
|
|
|
#info-panel {
|
|
position: absolute;
|
|
top: 20px;
|
|
left: 20px;
|
|
background-color: rgba(10, 10, 30, 0.85);
|
|
border-radius: 10px;
|
|
padding: 20px;
|
|
width: 320px;
|
|
z-index: 10;
|
|
box-shadow: 0 0 20px rgba(0, 150, 255, 0.3);
|
|
border: 1px solid rgba(0, 150, 255, 0.2);
|
|
backdrop-filter: blur(5px);
|
|
}
|
|
|
|
#info-panel h1 {
|
|
font-size: 1.8rem;
|
|
margin-bottom: 5px;
|
|
color: #4db8ff;
|
|
text-shadow: 0 0 10px rgba(77, 184, 255, 0.5);
|
|
}
|
|
|
|
#info-panel .subtitle {
|
|
color: #aaa;
|
|
margin-bottom: 20px;
|
|
font-size: 0.9rem;
|
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
|
padding-bottom: 10px;
|
|
}
|
|
|
|
#info-panel .cable-info {
|
|
margin-top: 15px;
|
|
padding-top: 15px;
|
|
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
#info-panel .cable-info h3 {
|
|
color: #4db8ff;
|
|
margin-bottom: 8px;
|
|
font-size: 1.2rem;
|
|
}
|
|
|
|
#info-panel .cable-property {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-bottom: 5px;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
#info-panel .property-label {
|
|
color: #aaa;
|
|
}
|
|
|
|
#info-panel .property-value {
|
|
color: #fff;
|
|
font-weight: 500;
|
|
}
|
|
|
|
#info-panel .controls {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-top: 20px;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
}
|
|
|
|
#info-panel button {
|
|
background: linear-gradient(135deg, #0066cc, #004c99);
|
|
color: white;
|
|
border: none;
|
|
padding: 8px 15px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
font-size: 0.9rem;
|
|
transition: all 0.3s;
|
|
flex: 1;
|
|
min-width: 120px;
|
|
box-shadow: 0 2px 5px rgba(0,0,0,0.3);
|
|
}
|
|
|
|
#info-panel button:hover {
|
|
background: linear-gradient(135deg, #0088ff, #0066cc);
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 5px 15px rgba(0,102,204,0.4);
|
|
}
|
|
|
|
#info-panel .zoom-controls {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-top: 15px;
|
|
padding-top: 15px;
|
|
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
#info-panel .zoom-buttons {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 15px;
|
|
margin-top: 10px;
|
|
width: 100%;
|
|
}
|
|
|
|
#info-panel .zoom-percent-container {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 15px;
|
|
}
|
|
|
|
#info-panel .zoom-percent {
|
|
font-size: 1.4rem;
|
|
font-weight: 600;
|
|
color: #4db8ff;
|
|
min-width: 70px;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
padding: 5px 10px;
|
|
border-radius: 5px;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
#info-panel .zoom-percent:hover {
|
|
background: rgba(77, 184, 255, 0.2);
|
|
box-shadow: 0 0 10px rgba(77, 184, 255, 0.3);
|
|
}
|
|
|
|
#info-panel .zoom-buttons .zoom-btn {
|
|
width: 36px;
|
|
height: 36px;
|
|
min-width: 36px;
|
|
border: none;
|
|
border-radius: 50%;
|
|
background: rgba(77, 184, 255, 0.2);
|
|
color: #4db8ff;
|
|
font-size: 22px;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: all 0.2s ease;
|
|
padding: 0;
|
|
flex: 0 0 auto;
|
|
}
|
|
|
|
#info-panel .zoom-buttons .zoom-btn:hover {
|
|
background: rgba(77, 184, 255, 0.4);
|
|
transform: scale(1.1);
|
|
box-shadow: 0 0 10px rgba(77, 184, 255, 0.5);
|
|
}
|
|
|
|
#info-panel .zoom-buttons button {
|
|
flex: 1;
|
|
min-width: 60px;
|
|
}
|
|
|
|
/* Info Card - Unified details panel (inside info-panel) */
|
|
.info-card {
|
|
margin-top: 15px;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
border-radius: 8px;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.info-card.no-border {
|
|
background: transparent;
|
|
border: none;
|
|
}
|
|
|
|
.info-card-header {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 10px 12px;
|
|
background: rgba(77, 184, 255, 0.1);
|
|
gap: 8px;
|
|
}
|
|
|
|
.info-card-icon {
|
|
font-size: 18px;
|
|
}
|
|
|
|
.info-card-header h3 {
|
|
flex: 1;
|
|
margin: 0;
|
|
font-size: 1rem;
|
|
color: #4db8ff;
|
|
}
|
|
|
|
.info-card-content {
|
|
padding: 10px 12px;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.info-card-property {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 6px 0;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.info-card-property:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.info-card-label {
|
|
color: #aaa;
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
.info-card-value {
|
|
color: #4db8ff;
|
|
font-weight: 500;
|
|
font-size: 0.9rem;
|
|
text-align: right;
|
|
max-width: 180px;
|
|
word-break: break-word;
|
|
}
|
|
|
|
/* Cable type */
|
|
.info-card.cable {
|
|
border-color: rgba(255, 200, 0, 0.4);
|
|
}
|
|
|
|
.info-card.cable .info-card-header {
|
|
background: rgba(255, 200, 0, 0.15);
|
|
}
|
|
|
|
.info-card.cable .info-card-header h3 {
|
|
color: #ffc800;
|
|
}
|
|
|
|
/* Satellite type */
|
|
.info-card.satellite {
|
|
border-color: rgba(0, 229, 255, 0.4);
|
|
}
|
|
|
|
.info-card.satellite .info-card-header {
|
|
background: rgba(0, 229, 255, 0.15);
|
|
}
|
|
|
|
.info-card.satellite .info-card-header h3 {
|
|
color: #00e5ff;
|
|
}
|