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:
@@ -30,6 +30,7 @@
|
|||||||
<p>THE FIVE TALL BOXING WIZARDS JUMP QUICKLY!</p>
|
<p>THE FIVE TALL BOXING WIZARDS JUMP QUICKLY!</p>
|
||||||
<p>0123456789.:,;(*!?')</p>
|
<p>0123456789.:,;(*!?')</p>
|
||||||
</div>
|
</div>
|
||||||
|
<br />
|
||||||
<div id="previewButtons">
|
<div id="previewButtons">
|
||||||
<div class="flex column">
|
<div class="flex column">
|
||||||
<button id="seriousButton">Serious Sans</button>
|
<button id="seriousButton">Serious Sans</button>
|
||||||
@@ -45,6 +46,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
<form>
|
||||||
|
<label for="newExampleText">New Example Text:</label>
|
||||||
|
<input type="text" id="newExampleText" name="newExampleText" />
|
||||||
|
<input type="button" id="newExampleTextButton" value="Update" />
|
||||||
|
</form>
|
||||||
|
<br />
|
||||||
<h2>Downloads</h2>
|
<h2>Downloads</h2>
|
||||||
<div id="downloads">
|
<div id="downloads">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
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 seriousButton = document.getElementById("seriousButton");
|
||||||
const seriousItalicButton = document.getElementById("seriousItalicButton");
|
const seriousItalicButton = document.getElementById("seriousItalicButton");
|
||||||
const seriousBoldButton = document.getElementById("seriousBoldButton");
|
const seriousBoldButton = document.getElementById("seriousBoldButton");
|
||||||
@@ -10,6 +10,8 @@ const seriousLightButton = document.getElementById("seriousLightButton");
|
|||||||
const seriousLightItalicButton = document.getElementById(
|
const seriousLightItalicButton = document.getElementById(
|
||||||
"seriousLightItalicButton"
|
"seriousLightItalicButton"
|
||||||
);
|
);
|
||||||
|
const newExampleTextButton = document.getElementById("newExampleTextButton");
|
||||||
|
const newExampleText = document.getElementById("newExampleText");
|
||||||
|
|
||||||
seriousButton.addEventListener("click", function () {
|
seriousButton.addEventListener("click", function () {
|
||||||
this.classList.add("selected");
|
this.classList.add("selected");
|
||||||
@@ -100,3 +102,7 @@ seriousLightItalicButton.addEventListener("click", function () {
|
|||||||
exampleTextClasses.remove("seriousLight");
|
exampleTextClasses.remove("seriousLight");
|
||||||
exampleTextClasses.add("seriousLightItalic");
|
exampleTextClasses.add("seriousLightItalic");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
newExampleTextButton.addEventListener("click", function () {
|
||||||
|
exampleText.setHTML(newExampleText.value);
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user