fix: refine earth hud structure and bun startup flow

- refactor the /earth HUD into class-first CSS layers with dedicated base, hud, and toolbar responsibilities
- clean up Earth markup and runtime DOM hooks so shared panel, toolbar, tooltip, and status classes stay consistent after dynamic updates
- keep HUD scaling configurable through extracted constants and remove leftover legacy panel/toolbar styling paths
- make planet.sh self-bootstrap Bun and uv by prepending local runtime bins to PATH and auto-installing missing tools in fresh environments
- document Bun as the frontend package manager of record and sync repository version metadata to 0.24.1
This commit is contained in:
rayd1o
2026-04-09 02:12:22 +08:00
parent 34d94a6b6b
commit c4ea918fac
24 changed files with 1248 additions and 1192 deletions

View File

@@ -1,183 +1,58 @@
/* info-panel */
#info-panel {
top: 20px;
left: 20px;
border-radius: 18px;
padding: 20px;
width: 320px;
.hud-panel-info {
top: var(--hud-offset);
left: var(--hud-offset);
border-radius: var(--hud-radius);
padding: calc(20px * var(--hud-scale));
width: calc(320px * var(--hud-scale));
z-index: 10;
font-size: var(--hud-font-size);
}
#info-panel h1 {
font-size: 1.8rem;
margin-bottom: 5px;
.hud-panel-info .earth-app-title {
font-size: calc(1.8rem * var(--hud-scale));
margin-bottom: var(--hud-gap-xs);
color: #4db8ff;
text-shadow: 0 0 10px rgba(77, 184, 255, 0.5);
text-align: center;
}
#info-panel .subtitle {
margin-bottom: 20px;
.hud-panel-info .subtitle {
margin-bottom: calc(20px * var(--hud-scale));
border-bottom: 1px solid rgba(255,255,255,0.1);
padding-bottom: 12px;
padding-bottom: calc(12px * var(--hud-scale));
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
gap: calc(4px * var(--hud-scale));
}
#info-panel .subtitle-main {
.hud-panel-info .subtitle-main {
color: #d7e7f5;
font-size: 0.95rem;
font-size: calc(0.95rem * var(--hud-scale));
line-height: 1.35;
font-weight: 500;
letter-spacing: 0.02em;
}
#info-panel .subtitle-meta {
.hud-panel-info .subtitle-meta {
color: #8ea5bc;
font-size: 0.74rem;
font-size: calc(0.74rem * var(--hud-scale));
line-height: 1.3;
letter-spacing: 0.08em;
text-transform: uppercase;
}
#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;
display: none;
margin-top: var(--hud-gap-lg);
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(110, 176, 255, 0.04)),
rgba(7, 18, 36, 0.2);
border-radius: 14px;
border-radius: calc(14px * var(--hud-scale));
border: 1px solid rgba(225, 242, 255, 0.12);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.08),
@@ -195,24 +70,24 @@
.info-card-header {
display: flex;
align-items: center;
padding: 10px 12px;
padding: calc(10px * var(--hud-scale)) calc(12px * var(--hud-scale));
background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(77, 184, 255, 0.06));
gap: 8px;
gap: var(--hud-gap-sm);
}
.info-card-icon {
font-size: 18px;
font-size: calc(18px * var(--hud-scale));
}
.info-card-header h3 {
flex: 1;
margin: 0;
font-size: 1rem;
font-size: calc(1rem * var(--hud-scale));
color: #4db8ff;
}
#info-card-content {
padding: 10px 12px;
.info-card-content {
padding: calc(10px * var(--hud-scale)) calc(12px * var(--hud-scale));
max-height: 40vh;
overflow-y: auto;
scrollbar-width: thin;
@@ -220,29 +95,30 @@
pointer-events: auto;
}
#info-card-content::-webkit-scrollbar {
.info-card-content::-webkit-scrollbar {
width: 6px;
}
#info-card-content::-webkit-scrollbar-track {
.info-card-content::-webkit-scrollbar-track {
background: transparent;
}
#info-card-content::-webkit-scrollbar-thumb {
.info-card-content::-webkit-scrollbar-thumb {
background: linear-gradient(180deg, rgba(210, 237, 255, 0.32), rgba(110, 176, 255, 0.34));
border-radius: 999px;
}
#info-card-content::-webkit-scrollbar-thumb:hover {
.info-card-content::-webkit-scrollbar-thumb:hover {
background: linear-gradient(180deg, rgba(232, 246, 255, 0.42), rgba(128, 198, 255, 0.46));
}
.info-card-property {
display: flex;
justify-content: space-between;
padding: 6px;
padding: calc(6px * var(--hud-scale));
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
pointer-events: auto;
gap: var(--hud-gap-sm);
}
.info-card-property:last-child {
@@ -251,7 +127,7 @@
.info-card-label {
color: #aaa;
font-size: 0.85rem;
font-size: calc(0.85rem * var(--hud-scale));
cursor: pointer;
transition: color 0.18s ease;
}
@@ -263,9 +139,9 @@
.info-card-value {
color: #4db8ff;
font-weight: 500;
font-size: 0.9rem;
font-size: calc(0.9rem * var(--hud-scale));
text-align: right;
max-width: 180px;
max-width: calc(180px * var(--hud-scale));
word-break: break-word;
}