|
|
@ -4,6 +4,7 @@ const kyujitai = [["万","萬"],["与","與"],["両","兩"],["並","竝"],["乗"
|
|
|
|
const challenge = document.getElementById("challenge");
|
|
|
|
const challenge = document.getElementById("challenge");
|
|
|
|
|
|
|
|
|
|
|
|
const defaultHeight = challenge.scrollHeight + "px";
|
|
|
|
const defaultHeight = challenge.scrollHeight + "px";
|
|
|
|
|
|
|
|
let verticalHeight;
|
|
|
|
challenge.style.height = defaultHeight;
|
|
|
|
challenge.style.height = defaultHeight;
|
|
|
|
|
|
|
|
|
|
|
|
const vocab = document.getElementById("challenge-vocab");
|
|
|
|
const vocab = document.getElementById("challenge-vocab");
|
|
|
@ -58,6 +59,7 @@ directionButton.addEventListener("click", function() {
|
|
|
|
texts.forEach(text => text.classList.add("vertical"));
|
|
|
|
texts.forEach(text => text.classList.add("vertical"));
|
|
|
|
this.innerHTML = "↔";
|
|
|
|
this.innerHTML = "↔";
|
|
|
|
challenge.style.height = challenge.scrollHeight + "px";
|
|
|
|
challenge.style.height = challenge.scrollHeight + "px";
|
|
|
|
|
|
|
|
verticalHeight = challenge.style.height;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
texts.forEach(text => text.classList.remove("vertical"));
|
|
|
|
texts.forEach(text => text.classList.remove("vertical"));
|
|
|
|
this.innerHTML = "↕";
|
|
|
|
this.innerHTML = "↕";
|
|
|
@ -66,6 +68,22 @@ directionButton.addEventListener("click", function() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
directionButton.click();
|
|
|
|
directionButton.click();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const englishButton = document.getElementById("english");
|
|
|
|
|
|
|
|
const challengeEnglish = document.getElementById("challenge-english");
|
|
|
|
|
|
|
|
if (englishButton) {
|
|
|
|
|
|
|
|
englishButton.addEventListener("click", function() {
|
|
|
|
|
|
|
|
if (this.innerHTML == "Show translation") {
|
|
|
|
|
|
|
|
challengeEnglish.style.removeProperty("display");
|
|
|
|
|
|
|
|
this.innerHTML = "Hide translation";
|
|
|
|
|
|
|
|
challenge.style.height = challenge.scrollHeight + "px";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
challengeEnglish.style.display = "none";
|
|
|
|
|
|
|
|
this.innerHTML = "Show translation";
|
|
|
|
|
|
|
|
challenge.style.height = directionButton.innerHTML == "↕" ? defaultHeight : verticalHeight;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("highlight").addEventListener("click", function() {
|
|
|
|
document.getElementById("highlight").addEventListener("click", function() {
|
|
|
|
if (this.innerHTML === "漢字") {
|
|
|
|
if (this.innerHTML === "漢字") {
|
|
|
|
vocab.style.display = "none";
|
|
|
|
vocab.style.display = "none";
|
|
|
|