diff options
author | Joris | 2022-07-04 14:42:01 +0200 |
---|---|---|
committer | Joris | 2022-07-04 19:36:37 +0200 |
commit | 03f50c7284fb2195e559d0c3246a636bdf9a58e5 (patch) | |
tree | c77d5ec58c8e168a018284e220504fcecd6a810a /src/view | |
parent | fade87173afbfdd51534646ed49844efa2d0e530 (diff) |
Show only current and next chord
Stop showing the previous chord, this is not helpful.
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/play.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/view/play.ts b/src/view/play.ts index 26558cd..20da6c7 100644 --- a/src/view/play.ts +++ b/src/view/play.ts @@ -8,24 +8,22 @@ export function view(options: Options): Element[] { let chords = h('div', { className: 'g-Play' }, chordNode(), - chordNode(), chordNode(options), chordNode(options) ) let chordBeat = 1 - dom.triggerAnimation(chords as HTMLElement, 'g-Play--Shift') - dom.triggerAnimation(chords.children[2] as HTMLElement, 'g-Chord--Beat') + dom.triggerAnimation(chords.children[1] as HTMLElement, 'g-Chord--Beat') setInterval(() => { if (chordBeat == options.beatsPerChord) { shiftChords(chords, options) chords.children[0].classList.remove('g-Chord--Beat') dom.triggerAnimation(chords as HTMLElement, 'g-Play--Shift') - dom.triggerAnimation(chords.children[2] as HTMLElement, 'g-Chord--Beat') + dom.triggerAnimation(chords.children[1] as HTMLElement, 'g-Chord--Beat') chordBeat = 1 } else { - dom.triggerAnimation(chords.children[2] as HTMLElement, 'g-Chord--Beat') + dom.triggerAnimation(chords.children[1] as HTMLElement, 'g-Chord--Beat') chordBeat += 1 } }, 60 / options.bpm * 1000) |