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

@@ -0,0 +1,170 @@
/* hud.css - HUD surfaces and shared overlays */
.hud-panel {
position: absolute;
overflow: hidden;
isolation: isolate;
background:
radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.12), transparent 28%),
radial-gradient(circle at 78% 115%, rgba(255, 255, 255, 0.06), transparent 32%),
linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(110, 176, 255, 0.06)),
rgba(7, 18, 36, 0.28);
border: 1px solid rgba(225, 242, 255, 0.2);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.14),
inset 0 -1px 0 rgba(255, 255, 255, 0.04),
0 18px 40px rgba(0, 0, 0, 0.24),
0 0 32px rgba(120, 200, 255, 0.12);
backdrop-filter: blur(20px) saturate(145%);
-webkit-backdrop-filter: blur(20px) saturate(145%);
}
.hud-panel::before {
content: '';
position: absolute;
inset: 1px 1px 24% 1px;
border-radius: inherit;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05) 26%, transparent 70%);
opacity: 0.46;
pointer-events: none;
}
.hud-panel::after {
content: '';
position: absolute;
inset: -1px;
padding: 1.4px;
border-radius: inherit;
background:
linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(170, 223, 255, 0.2) 34%, rgba(88, 169, 255, 0.14) 68%, rgba(255, 255, 255, 0.24));
opacity: 0.78;
pointer-events: none;
filter: url(#liquid-glass-distortion) blur(0.35px);
-webkit-mask:
linear-gradient(#000 0 0) content-box,
linear-gradient(#000 0 0);
-webkit-mask-composite: xor;
mask:
linear-gradient(#000 0 0) content-box,
linear-gradient(#000 0 0);
mask-composite: exclude;
}
.hud-panel > * {
position: relative;
z-index: 1;
}
.hud-panel-title {
color: #4db8ff;
margin-bottom: var(--hud-gap-sm);
font-size: var(--hud-title-size);
}
.hud-panel-row {
display: flex;
justify-content: space-between;
gap: var(--hud-gap-sm);
}
.hud-panel-label {
color: #aaa;
}
.hud-panel-value {
color: #4db8ff;
font-weight: 500;
}
.hud-error-message {
color: #ff4444;
margin-top: 10px;
font-size: 0.9rem;
display: none;
padding: 10px;
background-color: rgba(255, 68, 68, 0.1);
border-radius: 5px;
border-left: 3px solid #ff4444;
}
.earth-status-message {
position: absolute;
top: 20px;
left: 50%;
transform: translate(-50%, -18px);
background-color: rgba(10, 10, 30, 0.85);
border-radius: 10px;
padding: 10px 15px;
z-index: 210;
box-shadow: 0 0 20px rgba(0, 150, 255, 0.3);
border: 1px solid rgba(0, 150, 255, 0.2);
font-size: 0.9rem;
display: none;
backdrop-filter: blur(5px);
text-align: center;
min-width: 180px;
opacity: 0;
transition:
transform 0.28s ease,
opacity 0.28s ease;
}
.earth-status-message.visible {
transform: translate(-50%, 0);
opacity: 1;
}
.earth-status-message.success {
color: #44ff44;
border-left: 3px solid #44ff44;
}
.earth-status-message.warning {
color: #ffff44;
border-left: 3px solid #ffff44;
}
.earth-status-message.error {
color: #ff4444;
border-left: 3px solid #ff4444;
}
.earth-tooltip {
position: absolute;
background-color: rgba(10, 10, 30, 0.95);
border: 1px solid #4db8ff;
border-radius: 5px;
padding: 5px 10px;
font-size: 0.8rem;
color: #fff;
pointer-events: none;
z-index: 100;
box-shadow: 0 0 10px rgba(77, 184, 255, 0.3);
display: none;
user-select: none;
}
.earth-app.layout-expanded .hud-panel-info {
top: var(--hud-offset);
left: var(--hud-offset);
transform: translate(calc(-100% + var(--hud-offset)), calc(-100% + var(--hud-offset)));
}
.earth-app.layout-expanded .hud-panel-coordinates {
top: var(--hud-offset);
right: var(--hud-offset);
transform: translate(calc(100% - var(--hud-offset)), calc(-100% + var(--hud-offset)));
}
.earth-app.layout-expanded .hud-panel-legend {
left: var(--hud-offset);
bottom: var(--hud-offset);
transform: translate(calc(-100% + var(--hud-offset)), calc(100% - var(--hud-offset)));
}
.earth-app.layout-expanded .hud-panel-stats {
right: var(--hud-offset);
bottom: var(--hud-offset);
transform: translate(calc(100% - var(--hud-offset)), calc(100% - var(--hud-offset)));
}