-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
26 lines (21 loc) · 895 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// This is where it all comes together.
window.addEventListener("DOMContentLoaded", () => {
const body = document.querySelector("#output");
const generate = () => {
// Fetches the settings from the UI, passes them to the
// progression generator, then updates the UI.
ui.rerenderProgression(
body,
business.generateRandProg(ui.getSettings()),
);
};
document.querySelector("#regen").addEventListener("click", generate);
document.querySelectorAll(".display-toggler").forEach((toggler) => {
toggler.addEventListener("click", () => ui.toggleDisplay(toggler));
});
const chordCheckboxes = document.querySelectorAll(".chord-type");
chordCheckboxes.forEach((chordCheckbox) => {
chordCheckbox.addEventListener("click", () => ui.showSelectedChords(chordCheckboxes));
});
generate();
});