From e52ea0c3e6fb1b808c72fadeb70a3ab34bda4b01 Mon Sep 17 00:00:00 2001 From: remi Date: Wed, 4 May 2022 21:54:05 +0200 Subject: [PATCH] toggle font button --- html/end.html | 1 + html/start.html | 26 ++++++++++++++++++++++++++ main.js | 28 ++++++++++++++++++++++------ test.html | 27 +++++++++++++++++++++++++++ text_analysis.css | 8 ++++++++ 5 files changed, 84 insertions(+), 6 deletions(-) diff --git a/html/end.html b/html/end.html index 3c3e9b8..7b9e190 100644 --- a/html/end.html +++ b/html/end.html @@ -1,4 +1,5 @@ + \ No newline at end of file diff --git a/html/start.html b/html/start.html index e7cfc41..6b50dc0 100644 --- a/html/start.html +++ b/html/start.html @@ -6,7 +6,33 @@ avg convo + + + +

toggle font

\ No newline at end of file diff --git a/main.js b/main.js index 4d38611..ce10409 100644 --- a/main.js +++ b/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(); } \ No newline at end of file diff --git a/test.html b/test.html index ccb47e5..5396c23 100644 --- a/test.html +++ b/test.html @@ -6,9 +6,35 @@ avg convo + + + +

toggle font

@@ -378,6 +404,7 @@ relfur chu arilaen dedaka'nya.
+ diff --git a/text_analysis.css b/text_analysis.css index 87c0e89..e933a0e 100644 --- a/text_analysis.css +++ b/text_analysis.css @@ -162,4 +162,12 @@ main { data-swap { display: none; +} + +.button { + text-decoration: underline; + text-align: center; + cursor: pointer; + user-select: none; + -webkit-user-select: none; } \ No newline at end of file