diff --git a/index.html b/index.html index 184a078..7def3d1 100644 --- a/index.html +++ b/index.html @@ -71,8 +71,12 @@
- - + +

diff --git a/index.js b/index.js index 0dbd2af..143ccfb 100644 --- a/index.js +++ b/index.js @@ -13,10 +13,10 @@ const seriousLightButton = document.getElementById("seriousLightButton"); const seriousLightItalicButton = document.getElementById( "seriousLightItalicButton" ); -const newExampleText = document.getElementById("newExampleText"); +const newExampleTextInput = document.getElementById("newExampleTextInput"); const newExampleTextButton = document.getElementById("newExampleTextButton"); -const buttons = [ +const seriousElements = [ seriousOriginalButton, seriousItalicButton, seriousBoldButton, @@ -24,6 +24,7 @@ const buttons = [ seriousLightButton, seriousLightItalicButton, newExampleTextButton, + newExampleTextInput, ]; const seriousStyles = [ @@ -40,8 +41,8 @@ const clearClasses = () => { exampleTextClassList.remove(seriousStyle); mainClassList.remove(seriousStyle); } - for (seriousButton of buttons) { - seriousButton.classList.remove("selected"); + for (seriousElement of seriousElements) { + seriousElement.classList.remove("selected"); } }; @@ -52,15 +53,15 @@ const clearClassesAndSelectThisButton = (button) => { entirePageRadio.addEventListener("click", () => { mainClassList.add("serious"); - for (seriousButton of buttons) { - seriousButton.classList.add("serious"); + for (seriousElement of seriousElements) { + seriousElement.classList.add("serious"); } }); exampleTextOnlyRadio.addEventListener("click", () => { mainClassList.remove("serious"); - for (seriousButton of buttons) { - seriousButton.classList.remove("serious"); + for (seriousElement of seriousElements) { + seriousElement.classList.remove("serious"); } }); @@ -100,12 +101,12 @@ seriousLightItalicButton.addEventListener("click", function () { mainClassList.add("seriousLightItalic"); }); -newExampleText.addEventListener("keydown", (event) => { +newExampleTextInput.addEventListener("keydown", (event) => { if (event.code === "Enter") { - exampleText.setHTML(newExampleText.value); + exampleText.setHTML(newExampleTextInput.value); } }); newExampleTextButton.addEventListener("click", () => { - exampleText.setHTML(newExampleText.value); + exampleText.setHTML(newExampleTextInput.value); }); diff --git a/style.css b/style.css index d5a0e57..9006f68 100644 --- a/style.css +++ b/style.css @@ -127,6 +127,10 @@ input.serious { color: #d4d4d4; } +.serious#newExampleTextInput { + height: 1.15em; +} + .serious.seriousOriginal { font-family: "Serious Sans"; }