mirror of
https://github.com/dtinth/comic-mono-font.git
synced 2026-02-21 22:43:59 +00:00
Add ability to input custom example text
This commit is contained in:
10
index.js
10
index.js
@@ -1,5 +1,5 @@
|
||||
const exampleTextClasses = document.getElementById("exampleText").classList;
|
||||
|
||||
const exampleText = document.getElementById("exampleText");
|
||||
const exampleTextClasses = exampleText.classList;
|
||||
const seriousButton = document.getElementById("seriousButton");
|
||||
const seriousItalicButton = document.getElementById("seriousItalicButton");
|
||||
const seriousBoldButton = document.getElementById("seriousBoldButton");
|
||||
@@ -10,6 +10,8 @@ const seriousLightButton = document.getElementById("seriousLightButton");
|
||||
const seriousLightItalicButton = document.getElementById(
|
||||
"seriousLightItalicButton"
|
||||
);
|
||||
const newExampleTextButton = document.getElementById("newExampleTextButton");
|
||||
const newExampleText = document.getElementById("newExampleText");
|
||||
|
||||
seriousButton.addEventListener("click", function () {
|
||||
this.classList.add("selected");
|
||||
@@ -100,3 +102,7 @@ seriousLightItalicButton.addEventListener("click", function () {
|
||||
exampleTextClasses.remove("seriousLight");
|
||||
exampleTextClasses.add("seriousLightItalic");
|
||||
});
|
||||
|
||||
newExampleTextButton.addEventListener("click", function () {
|
||||
exampleText.setHTML(newExampleText.value);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user