feat: live settings panel (≈45 Werte, Live/Reload, Persistenz, AO live)

- panel.js: Drawer-Panel (P / ⚙), schema-getrieben, ●live/⟳reload-Badges
- Werte direkt im Panel einstellbar statt in config.js grabben
- Live-Apply über mutateNested (nur Plain-Objekte, nie Modul-Namespace)
  + registerApply-Callbacks für Three.js-Objekte (FOV, Belichtung, Fog, Licht, Schatten-Frustum, Bloom)
- PLAYER.*/CONTROLS.* live (player.js liest jeden Frame neu)
- AO jetzt live: debounced world.markAllDirty() remesht alle Chunks ohne F5
- Reload-Pflichtige Werte persistiert + blinkender Neu-Starten-Button
  (Seed, Meereshöhe, Spawn, MSAA, Tone-Mapping, Schatten an/Größe, AO-Level)
- Persistenz: localStorage (debounced), config.js lädt beim Start
- HUD/Overlay ausgeblendet, solange das Panel offen ist (Welt frei sichtbar)
- Buttons: Neu starten, Auf Standard zurücksetzen, Werte kopieren (JSON)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
minecraft-cloneandClaude committed 2026-06-21 16:31:25 +02:00
1 parent d6f6774815
commit 6e8e207afa
7 files changed
+775 -78

No files matched your search

+169
View File
@@ -105,3 +105,172 @@ canvas { display: block; }
.panel p { font-size: 16px; margin-bottom: 16px; opacity: 0.9; }
.keys { font-size: 13px; line-height: 1.9; opacity: 0.85; }
.keys b { color: #ffe08a; }
/* Settings-Panel offen → Spiel-HUD und Start-Overlay verstecken, damit die
Welt unverstellt sichtbar bleibt. Das Overlay verdeckt sonst die ganze Welt,
sobald das Panel den Pointer-Lock freigibt (pointerlockchange-Handler). */
body.panel-open #overlay,
body.panel-open #hud,
body.panel-open #hotbar,
body.panel-open #crosshair { opacity: 0; pointer-events: none; transition: opacity 0.18s; }
/* ============================================================
Settings-Panel (Drawer von rechts)
============================================================ */
.gear-btn {
position: fixed;
top: 12px; right: 12px;
width: 40px; height: 40px;
border-radius: 8px;
border: 1px solid rgba(255,255,255,0.18);
background: rgba(0,0,0,0.45);
color: #fff;
font-size: 20px;
cursor: pointer;
z-index: 20;
display: flex; align-items: center; justify-content: center;
transition: background 0.15s, transform 0.15s;
backdrop-filter: blur(2px);
}
.gear-btn:hover { background: rgba(0,0,0,0.65); transform: rotate(30deg); }
.settings-panel {
position: fixed;
top: 0; right: 0; bottom: 0;
width: 340px;
max-width: 92vw;
background: rgba(18,22,28,0.96);
border-left: 1px solid rgba(255,255,255,0.12);
box-shadow: -10px 0 40px rgba(0,0,0,0.5);
transform: translateX(105%);
transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1);
z-index: 30;
display: flex;
flex-direction: column;
font-size: 13px;
color: #e8eaed;
}
.settings-panel.open { transform: translateX(0); }
.sp-header {
display: flex; align-items: center; justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid rgba(255,255,255,0.1);
flex: 0 0 auto;
}
.sp-header h2 { font-size: 17px; font-weight: 600; letter-spacing: 0.5px; }
.sp-close {
background: none; border: none; color: #bdc1c6;
font-size: 18px; cursor: pointer; padding: 2px 8px; border-radius: 4px;
}
.sp-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.reload-banner {
background: rgba(255,180,60,0.16);
border-bottom: 1px solid rgba(255,180,60,0.35);
color: #ffd9a0;
padding: 9px 16px;
font-size: 12px;
flex: 0 0 auto;
}
.sp-body {
overflow-y: auto;
padding: 8px 14px 16px;
flex: 1 1 auto;
scrollbar-width: thin;
scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.sp-body::-webkit-scrollbar { width: 8px; }
.sp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 4px; }
.sp-group { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sp-group:last-child { border-bottom: none; }
.sp-group-title {
font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
color: #8ab4f8; margin-bottom: 8px; font-weight: 600;
}
.ctrl-row { margin: 9px 0; }
.ctrl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.ctrl-label { color: #cdd2da; }
.ctrl-value {
font-variant-numeric: tabular-nums;
color: #9aa0a6; font-size: 12px;
min-width: 56px; text-align: right;
}
.badge { font-size: 10px; padding: 1px 5px; border-radius: 8px; margin-left: 6px; vertical-align: middle; }
.badge.live { background: rgba(80,200,120,0.18); color: #7ee2a0; }
.badge.reload { background: rgba(255,180,60,0.18); color: #ffc870; }
/* Range-Slider */
.ctrl-row input[type=range] {
width: 100%; height: 5px; -webkit-appearance: none; appearance: none;
background: rgba(255,255,255,0.15); border-radius: 3px; outline: none; cursor: pointer;
}
.ctrl-row input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none; appearance: none;
width: 16px; height: 16px; border-radius: 50%;
background: #8ab4f8; border: 2px solid #1b2a3a; cursor: pointer;
}
.ctrl-row input[type=range]::-moz-range-thumb {
width: 14px; height: 14px; border-radius: 50%;
background: #8ab4f8; border: 2px solid #1b2a3a; cursor: pointer;
}
/* Number / Select / Color */
.ctrl-row input[type=number] {
width: 100%; box-sizing: border-box;
background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
color: #fff; padding: 5px 8px; border-radius: 5px; font-size: 13px;
}
.ctrl-row select {
width: 100%; box-sizing: border-box;
background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
color: #fff; padding: 5px 8px; border-radius: 5px; font-size: 13px;
}
.ctrl-row input[type=color] {
width: 100%; height: 28px; padding: 0; border: 1px solid rgba(255,255,255,0.15);
border-radius: 5px; background: transparent; cursor: pointer;
}
/* Toggle-Switch (Checkbox) */
.switch { display: inline-flex; align-items: center; cursor: pointer; }
.switch input { display: none; }
.switch-track {
width: 38px; height: 20px; border-radius: 12px;
background: rgba(255,255,255,0.18); position: relative; transition: background 0.2s;
}
.switch-track::after {
content: ""; position: absolute; top: 2px; left: 2px;
width: 16px; height: 16px; border-radius: 50%; background: #fff;
transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: #4caf7d; }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.ctrl-row:has(.switch) .ctrl-value { display: none; }
/* Footer-Buttons */
.sp-footer {
display: flex; gap: 8px; padding: 12px 14px;
border-top: 1px solid rgba(255,255,255,0.1);
flex: 0 0 auto; flex-wrap: wrap;
}
.sp-btn {
flex: 1 1 auto; min-width: 90px;
background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
color: #e8eaed; padding: 8px 6px; border-radius: 6px;
font-size: 12px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.sp-btn:hover { background: rgba(255,255,255,0.16); }
.sp-btn.restart { background: rgba(138,180,248,0.18); border-color: rgba(138,180,248,0.45); }
.sp-btn.restart:hover { background: rgba(138,180,248,0.32); }
.sp-btn.reset { background: rgba(240,90,90,0.15); border-color: rgba(240,90,90,0.4); }
.sp-btn.reset:hover { background: rgba(240,90,90,0.28); }
.settings-panel.dirty .sp-btn.restart {
animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(138,180,248,0.4); }
50% { box-shadow: 0 0 0 5px rgba(138,180,248,0); }
}