diff --git a/index.html b/index.html index 77d54ba..fa4f3ce 100644 --- a/index.html +++ b/index.html @@ -40,18 +40,20 @@ stroke-width: 1; } .languageText, .romanizationText { - visibility: hidden; + /* visibility: hidden; */ font-family: "Noto Sans"; font-size:1.25em; pointer-events: none; } + /* .language:hover ~ .languageText { visibility: visible; } .language:hover ~ .romanizationText { visibility: visible; } + */ .testClass:hover { fill: red; @@ -100,7 +102,7 @@

Indian Translate

-
+ diff --git a/updateTranslations.js b/updateTranslations.js index 105696d..2a1006d 100644 --- a/updateTranslations.js +++ b/updateTranslations.js @@ -1,3 +1,7 @@ +function hideText(request) { + document.querySelectorAll(".languageText, .romanizationText").forEach(element => element.style.visibility = 'hidden') +} + function updateTranslations(response) { const translations = JSON.parse(response); document.querySelectorAll(".languageText").forEach(element => { @@ -23,5 +27,7 @@ function updateTranslations(response) { element.textContent = "(" + romanizations[element.id.replace("Romanization", "")] + ")"; } }); + // Show elements again + document.querySelectorAll(".languageText, .romanizationText").forEach(element => element.style.visibility = 'visible') }); }