tools:skalentrainer
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| tools:skalentrainer [15/05/2025 08:59] – ↷ Seitename wurde von tools:skalentrainer-pruefung auf tools:skalentrainer geändert Eric Weber | tools:skalentrainer [22/05/2025 16:31] (aktuell) – Eric Weber | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== Skalentrainer ====== | ||
| - | |||
| - | |||
| < | < | ||
| < | < | ||
| Zeile 113: | Zeile 110: | ||
| # | # | ||
| display: none; | display: none; | ||
| + | } | ||
| + | .practice-scales-container { | ||
| + | display: grid; | ||
| + | grid-template-columns: | ||
| + | gap: 15px; | ||
| + | margin: 20px 0; | ||
| + | } | ||
| + | .practice-scale-btn { | ||
| + | background-color: | ||
| + | color: #2c3e50; | ||
| + | border: 2px solid #bdc3c7; | ||
| + | padding: 15px; | ||
| + | border-radius: | ||
| + | cursor: pointer; | ||
| + | font-size: 16px; | ||
| + | font-weight: | ||
| + | text-align: center; | ||
| + | transition: all 0.2s; | ||
| + | } | ||
| + | .practice-scale-btn: | ||
| + | background-color: | ||
| + | transform: translateY(-2px); | ||
| + | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
| + | } | ||
| + | .practice-scale-btn: | ||
| + | transform: translateY(0); | ||
| + | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); | ||
| + | } | ||
| + | .practice-scale-btn.playing { | ||
| + | background-color: | ||
| + | color: black; | ||
| + | border-color: | ||
| } | } | ||
| .quiz-options { | .quiz-options { | ||
| Zeile 208: | Zeile 237: | ||
| </ | </ | ||
| < | < | ||
| + | < | ||
| | | ||
| <div class=" | <div class=" | ||
| Zeile 267: | Zeile 297: | ||
| <div id=" | <div id=" | ||
| < | < | ||
| - | <div class=" | + | |
| - | < | + | |
| - | <span class=" | + | |
| + | <!-- Practice scale buttons will be generated here --> | ||
| + | | ||
| + | |||
| + | | ||
| <button id=" | <button id=" | ||
| </ | </ | ||
| Zeile 306: | Zeile 340: | ||
| let audioContext; | let audioContext; | ||
| let currentMode = " | let currentMode = " | ||
| - | let allScalesSelected = true; | + | let allScalesSelected = false; |
| let quizInProgress = false; | let quizInProgress = false; | ||
| let currentQuizQuestion = 0; | let currentQuizQuestion = 0; | ||
| Zeile 314: | Zeile 348: | ||
| let currentScale; | let currentScale; | ||
| let questionAnswered = false; | let questionAnswered = false; | ||
| + | let currentlyPlayingScale = null; | ||
| // Function to stop all audio | // Function to stop all audio | ||
| Zeile 321: | Zeile 356: | ||
| resetQuiz(); | resetQuiz(); | ||
| } | } | ||
| + | | ||
| + | // Reset practice scale visual state | ||
| + | resetPracticeScaleButtons(); | ||
| | | ||
| // If audio context exists, cancel all scheduled sounds | // If audio context exists, cancel all scheduled sounds | ||
| Zeile 345: | Zeile 383: | ||
| document.getElementById(" | document.getElementById(" | ||
| } | } | ||
| + | } | ||
| + | |||
| + | // Reset practice scale button visual states | ||
| + | function resetPracticeScaleButtons() { | ||
| + | document.querySelectorAll(" | ||
| + | btn.classList.remove(" | ||
| + | }); | ||
| + | currentlyPlayingScale = null; | ||
| } | } | ||
| Zeile 351: | Zeile 397: | ||
| // Set up event listeners | // Set up event listeners | ||
| document.getElementById(" | document.getElementById(" | ||
| - | document.getElementById(" | ||
| document.getElementById(" | document.getElementById(" | ||
| document.getElementById(" | document.getElementById(" | ||
| Zeile 363: | Zeile 408: | ||
| setMode(this.dataset.mode); | setMode(this.dataset.mode); | ||
| stopAllAudio(); | stopAllAudio(); | ||
| + | updatePracticeScales(); | ||
| }); | }); | ||
| }); | }); | ||
| Zeile 368: | Zeile 414: | ||
| // Add event listeners to stop audio when settings change | // Add event listeners to stop audio when settings change | ||
| document.querySelectorAll(" | document.querySelectorAll(" | ||
| - | checkbox.addEventListener(" | + | checkbox.addEventListener(" |
| + | | ||
| + | updatePracticeScales(); | ||
| + | }); | ||
| }); | }); | ||
| - | // Initialize progress markers | + | // Initialize progress markers |
| initializeProgressMarkers(); | initializeProgressMarkers(); | ||
| + | updatePracticeScales(); | ||
| }); | }); | ||
| Zeile 385: | Zeile 435: | ||
| | | ||
| document.getElementById(" | document.getElementById(" | ||
| + | updatePracticeScales(); | ||
| } | } | ||
| Zeile 398: | Zeile 449: | ||
| } | } | ||
| }); | }); | ||
| + | } | ||
| + | |||
| + | // Update practice scales display | ||
| + | function updatePracticeScales() { | ||
| + | const container = document.getElementById(" | ||
| + | container.innerHTML = ""; | ||
| | | ||
| + | const selectedScales = getSelectedScales(); | ||
| + | | ||
| + | if (selectedScales.length === 0) { | ||
| + | container.innerHTML = "<p style=' | ||
| + | return; | ||
| + | } | ||
| + | | ||
| + | selectedScales.forEach(scale => { | ||
| + | const button = document.createElement(" | ||
| + | button.className = " | ||
| + | button.textContent = getScaleName(scale); | ||
| + | button.dataset.scale = scale; | ||
| + | | ||
| + | button.addEventListener(" | ||
| + | playPracticeScale(scale, | ||
| + | }); | ||
| + | | ||
| + | container.appendChild(button); | ||
| + | }); | ||
| + | } | ||
| + | // Play a practice scale | ||
| + | function playPracticeScale(scale, | ||
| + | // Reset all button states | ||
| + | resetPracticeScaleButtons(); | ||
| + | | ||
| + | // Set current button as playing | ||
| + | buttonElement.classList.add(" | ||
| + | currentlyPlayingScale = scale; | ||
| + | | ||
| + | const startNote = getScaleStartNote(scale); | ||
| + | | ||
| + | playScale(scale, | ||
| + | // Remove playing state after scale finishes | ||
| + | if (currentlyPlayingScale === scale) { | ||
| + | buttonElement.classList.remove(" | ||
| + | currentlyPlayingScale = null; | ||
| + | } | ||
| + | }); | ||
| } | } | ||
| Zeile 579: | Zeile 674: | ||
| setTimeout(callback, | setTimeout(callback, | ||
| } | } | ||
| - | } | ||
| - | |||
| - | // Practice all selected scales | ||
| - | function startPractice() { | ||
| - | if (!isAnyScaleSelected()) { | ||
| - | alert(" | ||
| - | return; | ||
| - | } | ||
| - | | ||
| - | const scales = getSelectedScales(); | ||
| - | initAudioContext(); | ||
| - | | ||
| - | let index = 0; | ||
| - | const playNextScale = () => { | ||
| - | if (index < scales.length) { | ||
| - | const scale = scales[index]; | ||
| - | const startNote = getScaleStartNote(scale); | ||
| - | playScale(scale, | ||
| - | index++; | ||
| - | setTimeout(playNextScale, | ||
| - | }); | ||
| - | } | ||
| - | }; | ||
| - | | ||
| - | playNextScale(); | ||
| } | } | ||
tools/skalentrainer.1747292374.txt.gz · Zuletzt geändert: von Eric Weber
