ggs-header: Tourismustal + Tourismusregion (Batch 2)
- Komponente: btnHome/⌂-Erkennung (ganzer Header durchsucht), sim-eigener Musik-Toggle (btnMusic) -> Musik-Icon, Panel-Optik (blur/shadow/radius) gestrippt fuer Sims mit .panel-Leiste. - Beide Tourismus-Sims: topbar -> ggs-header (Klassen additiv, alle IDs + ui.js-Bindings erhalten), Tempo-Popover ueber .ggs-speed, Musik bleibt eigenes Panel (btnMusic oeffnet es). ggs-header.css vor style.css fuer position:fixed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,12 @@
|
||||
z-index: 1000;
|
||||
flex-wrap: nowrap;
|
||||
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
||||
/* Falls die Sim-Leiste ein Panel-Styling mitbringt (blur/shadow/radius):
|
||||
strippen, damit nur die einzelnen schwebenden Pillen sichtbar sind. */
|
||||
backdrop-filter: none !important;
|
||||
-webkit-backdrop-filter: none !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
/* Overlay-Modus: Zeile schwebt über Vollbild-Canvas (Heli, Tourismus …).
|
||||
|
||||
@@ -74,6 +74,8 @@
|
||||
var RESET_IDS = ['btn-reset', 'btnReset', 'btn-restart', 'btn-neustart'];
|
||||
var HELP_IDS = ['btn-info', 'btnHelp', 'btn-help', 'btn-anleitung', 'btn-hilfe'];
|
||||
var GLOSSAR_IDS = ['glossar-btn', 'btn-glossar', 'btnGlossar', 'btnGlossary'];
|
||||
var MUSIC_IDS = ['btnMusic', 'btnMusik', 'music-toggle-btn']; // sim-eigener Musik-Toggle (öffnet eigenes Panel)
|
||||
var HOME_IDS = ['btnHome', 'btn-home', 'ggs-home-link'];
|
||||
|
||||
/* Glyph-Buttons (Ton), die die Sim per textContent umschaltet:
|
||||
Icon nach jeder Änderung nachziehen, Mute-Zustand als Icon spiegeln. */
|
||||
@@ -166,13 +168,16 @@
|
||||
var tick = header.querySelector('.kw-tick-dot'); if (tick) pille.appendChild(tick);
|
||||
|
||||
/* --- 2) Home-Button links neben die Pille ----------------- */
|
||||
var homeBtn = null;
|
||||
var acts = header.querySelectorAll('.ggs-header-actions a, .ggs-header-actions button');
|
||||
for (var h = 0; h < acts.length; h++) {
|
||||
var a = acts[h];
|
||||
var href = a.getAttribute('href') || '';
|
||||
if (a.id === 'btn-info' || a.id === 'btn-sound' || a.id === 'btn-reset' || a.id === 'ggs-lehrplan-link') continue;
|
||||
if (/schueler|cockpit|\/$/.test(href) || (a.textContent || '').indexOf('🏠') >= 0) { homeBtn = a; break; }
|
||||
var homeBtn = byIds(header, HOME_IDS);
|
||||
if (!homeBtn) {
|
||||
var acts = header.querySelectorAll('a, button');
|
||||
for (var h = 0; h < acts.length; h++) {
|
||||
var a = acts[h];
|
||||
var href = a.getAttribute('href') || '';
|
||||
var t = a.textContent || '';
|
||||
if (a.id === 'btn-info' || a.id === 'btn-sound' || a.id === 'btn-reset' || a.id === 'ggs-lehrplan-link') continue;
|
||||
if (/schueler|cockpit|\/$/.test(href) || t.indexOf('🏠') >= 0 || t.indexOf('⌂') >= 0) { homeBtn = a; break; }
|
||||
}
|
||||
}
|
||||
if (!homeBtn) {
|
||||
homeBtn = document.createElement('a');
|
||||
@@ -199,6 +204,7 @@
|
||||
watchGlyphBtn(soundBtn, function (t) { return /🔇|🔈|🔕|off|aus|mute|stumm/i.test(t) ? 'sound-off' : 'sound'; }, 'Ton an/aus');
|
||||
setIcon(resetBtn, 'restart', 'Neu starten');
|
||||
setIcon(byIds(header, GLOSSAR_IDS), 'glossar'); // sim-interner Glossar/Fachinfo-Button
|
||||
setIcon(byIds(header, MUSIC_IDS), 'music'); // sim-eigener Musik-Toggle (öffnet eigenes Panel)
|
||||
var lehrplan = q('#ggs-lehrplan-link'); if (lehrplan) lehrplan.style.display = 'none';
|
||||
|
||||
/* --- 4) Tempo-Panel (nur wenn .ggs-speed vorhanden) ------- */
|
||||
|
||||
Reference in New Issue
Block a user