diff options
-rw-r--r-- | public/main.js | 2 | ||||
-rw-r--r-- | src/main.lisp | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/public/main.js b/public/main.js index 3b9e6fc..db9a9f9 100644 --- a/public/main.js +++ b/public/main.js @@ -56,7 +56,7 @@ if (node !== null) { const shift = getShift(tonality, e.target.value) tonality = e.target.value tonalities = tonality === 'F' || tonality.indexOf('♭') > -1 ? tonalities_b : tonalities_s - document.querySelectorAll('.g-Chords__Chord').forEach(chord => { + document.querySelectorAll('.g-Chords__Name').forEach(chord => { if (chord.innerText !== '%') { chord.innerText = applyShift(tonalities, chord.innerText, shift) } diff --git a/src/main.lisp b/src/main.lisp index d7dec7f..d2090e5 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -76,15 +76,22 @@ ; Chords +(defun chord-name (x) + (h "span" '(("class" "g-Chords__Name")) (list (string x)))) + (defun rhythm (x) - (h "img" (list '("class" "g-Chords__Rhythm") (list "src" (format nil "/rhythms/~S.png" x))) nil)) + (h "img" + (list + '("class" "g-Chords__Rhythm") + (list "src" (format nil "/rhythms/~S.png" x))) + nil)) (defun chord-div (x) (h "span" '(("class" "g-Chords__Chord")) (if (listp x) - (cons (string (car x)) (mapcar #'rhythm (cdr x))) - (list (string x))))) + (cons (chord-name (car x)) (mapcar #'rhythm (cdr x))) + (list (chord-name x))))) (defun chord-cell (x) (h "td" '(("class" "g-Chords__Cell")) |