tools:piano
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung | |||
| tools:piano [30/03/2026 15:03] – Eric Weber | tools:piano [30/03/2026 15:32] (aktuell) – Eric Weber | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| < | < | ||
| - | <!-- | ||
| - | Interaktive Klaviatur mit Notenzeile | ||
| - | Einbindung in DokuWiki: Inhalt zwischen den <div id=" | ||
| - | Alle CSS-Stile sind auf #piano-app begrenzt und beeinflussen die restliche Seite nicht. | ||
| - | --> | ||
| - | |||
| <div id=" | <div id=" | ||
| Zeile 245: | Zeile 239: | ||
| #piano-app svg.pa-staff-svg { | #piano-app svg.pa-staff-svg { | ||
| - | display: block; | + | height: auto; /* Höhe dynamisch */ |
| - | flex: 1; | + | min-height: 60px; |
| - | | + | } |
| - | overflow: visible; | + | |
| - | } | + | |
| /* --- Oktaven-Scrollbar (sichtbar auf allen Geräten) --- */ | /* --- Oktaven-Scrollbar (sichtbar auf allen Geräten) --- */ | ||
| Zeile 410: | Zeile 402: | ||
| <h1 class=" | <h1 class=" | ||
| - | | + | <br></br> |
| <!-- Controls --> | <!-- Controls --> | ||
| Zeile 421: | Zeile 413: | ||
| <span class=" | <span class=" | ||
| <div class=" | <div class=" | ||
| - | <button id=" | + | <button id=" |
| - | <button id=" | + | <button id=" |
| </ | </ | ||
| <div class=" | <div class=" | ||
| Zeile 581: | Zeile 573: | ||
| const totalWidth = whiteKeys.length * WHITE_W; | const totalWidth = whiteKeys.length * WHITE_W; | ||
| keysContainer.style.width = totalWidth + ' | keysContainer.style.width = totalWidth + ' | ||
| + | // Beim Start ganz nach rechts scrollen (hohe Töne sichtbar) | ||
| + | setTimeout(() => { | ||
| + | const scrollEl = document.getElementById(' | ||
| + | scrollEl.scrollLeft = scrollEl.scrollWidth; | ||
| + | }, 0); | ||
| // Weiße Tasten | // Weiße Tasten | ||
| Zeile 824: | Zeile 821: | ||
| // ===================================================== | // ===================================================== | ||
| window.paResizeStaff = function(val) { | window.paResizeStaff = function(val) { | ||
| - | | + | |
| - | const h = Math.round(val * 0.9); // 60→54px … 200→180px | + | const svg = document.getElementById(' |
| - | | + | const badge = document.getElementById(' |
| - | const badge = document.getElementById('pa-clef-badge'); | + | |
| - | const bSize = Math.round(val * 0.44); | + | const scale = val / 100; |
| - | badge.style.width | + | // Padding anpassen |
| - | badge.style.height = bSize + ' | + | const padding = Math.round(16 * scale); |
| - | badge.style.fontSize = Math.round(bSize * 0.68) + ' | + | wrap.style.padding = padding |
| - | }; | + | // SVG-Höhe skalieren (Basis: 80px) |
| + | | ||
| + | svg.style.height = svgHeight + 'px'; | ||
| + | // Badge-Größe anpassen | ||
| + | | ||
| + | badge.style.width = bSize + ' | ||
| + | badge.style.height = bSize + ' | ||
| + | badge.style.fontSize = Math.round(bSize * 0.73) + ' | ||
| + | }; | ||
| // ===================================================== | // ===================================================== | ||
| Zeile 840: | Zeile 845: | ||
| const scrollEl = document.getElementById(' | const scrollEl = document.getElementById(' | ||
| const maxScroll = scrollEl.scrollWidth - scrollEl.clientWidth; | const maxScroll = scrollEl.scrollWidth - scrollEl.clientWidth; | ||
| - | scrollEl.scrollLeft = Math.round((val / 100) * maxScroll); | + | scrollEl.scrollLeft = Math.round((1 - val / 100) * maxScroll); |
| }; | }; | ||
| Zeile 848: | Zeile 853: | ||
| const maxScroll = scrollEl.scrollWidth - scrollEl.clientWidth; | const maxScroll = scrollEl.scrollWidth - scrollEl.clientWidth; | ||
| if (maxScroll <= 0) return; | if (maxScroll <= 0) return; | ||
| - | const pct = Math.round((scrollEl.scrollLeft / maxScroll) * 100); | + | const pct = Math.round((1 - scrollEl.scrollLeft / maxScroll) * 100); |
| document.getElementById(' | document.getElementById(' | ||
| }); | }); | ||
tools/piano.1774875803.txt.gz · Zuletzt geändert: von Eric Weber
