toggle font button
This commit is contained in:
28
main.js
28
main.js
@@ -5,13 +5,17 @@
|
||||
|
||||
let words = {}
|
||||
|
||||
let currentFont = "r";
|
||||
|
||||
function init() {
|
||||
createWordList();
|
||||
injectWords();
|
||||
document.querySelector("#popup-container").addEventListener("click", () => {
|
||||
document.querySelector("#popup-container").style.opacity = 0;
|
||||
document.querySelector("#popup-container").style.pointerEvents = "none";
|
||||
})
|
||||
// createWordList();
|
||||
// injectWords();
|
||||
// document.querySelector("#popup-container").addEventListener("click", () => {
|
||||
// document.querySelector("#popup-container").style.opacity = 0;
|
||||
// document.querySelector("#popup-container").style.pointerEvents = "none";
|
||||
// })
|
||||
// above are commented out until wordlist is added~
|
||||
document.querySelector("#font-button").addEventListener("click", () => {fontButton();});
|
||||
}
|
||||
|
||||
function showPopup(word) {
|
||||
@@ -68,6 +72,18 @@ function injectWords() {
|
||||
});
|
||||
}
|
||||
|
||||
function fontButton() {
|
||||
if (currentFont == "r") {
|
||||
document.querySelector("#style-heonian").disabled = false;
|
||||
document.querySelector("#style-roman").disabled = true;
|
||||
currentFont = "h";
|
||||
} else {
|
||||
document.querySelector("#style-heonian").disabled = true;
|
||||
document.querySelector("#style-roman").disabled = false;
|
||||
currentFont = "r";
|
||||
}
|
||||
}
|
||||
|
||||
window.onload = () => {
|
||||
init();
|
||||
}
|
||||
Reference in New Issue
Block a user