mirror of
https://github.com/dtinth/comic-mono-font.git
synced 2026-02-21 22:43:59 +00:00
Adjust serious newExampleInput height
This commit is contained in:
@@ -71,8 +71,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div>
|
<div>
|
||||||
<label for="newExampleText">Example Text:</label>
|
<label for="newExampleTextInput">Example Text:</label>
|
||||||
<input type="text" id="newExampleText" name="newExampleText" />
|
<input
|
||||||
|
type="text"
|
||||||
|
id="newExampleTextInput"
|
||||||
|
name="newExampleTextInput"
|
||||||
|
/>
|
||||||
<input type="button" id="newExampleTextButton" value="Update" />
|
<input type="button" id="newExampleTextButton" value="Update" />
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
23
index.js
23
index.js
@@ -13,10 +13,10 @@ const seriousLightButton = document.getElementById("seriousLightButton");
|
|||||||
const seriousLightItalicButton = document.getElementById(
|
const seriousLightItalicButton = document.getElementById(
|
||||||
"seriousLightItalicButton"
|
"seriousLightItalicButton"
|
||||||
);
|
);
|
||||||
const newExampleText = document.getElementById("newExampleText");
|
const newExampleTextInput = document.getElementById("newExampleTextInput");
|
||||||
const newExampleTextButton = document.getElementById("newExampleTextButton");
|
const newExampleTextButton = document.getElementById("newExampleTextButton");
|
||||||
|
|
||||||
const buttons = [
|
const seriousElements = [
|
||||||
seriousOriginalButton,
|
seriousOriginalButton,
|
||||||
seriousItalicButton,
|
seriousItalicButton,
|
||||||
seriousBoldButton,
|
seriousBoldButton,
|
||||||
@@ -24,6 +24,7 @@ const buttons = [
|
|||||||
seriousLightButton,
|
seriousLightButton,
|
||||||
seriousLightItalicButton,
|
seriousLightItalicButton,
|
||||||
newExampleTextButton,
|
newExampleTextButton,
|
||||||
|
newExampleTextInput,
|
||||||
];
|
];
|
||||||
|
|
||||||
const seriousStyles = [
|
const seriousStyles = [
|
||||||
@@ -40,8 +41,8 @@ const clearClasses = () => {
|
|||||||
exampleTextClassList.remove(seriousStyle);
|
exampleTextClassList.remove(seriousStyle);
|
||||||
mainClassList.remove(seriousStyle);
|
mainClassList.remove(seriousStyle);
|
||||||
}
|
}
|
||||||
for (seriousButton of buttons) {
|
for (seriousElement of seriousElements) {
|
||||||
seriousButton.classList.remove("selected");
|
seriousElement.classList.remove("selected");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -52,15 +53,15 @@ const clearClassesAndSelectThisButton = (button) => {
|
|||||||
|
|
||||||
entirePageRadio.addEventListener("click", () => {
|
entirePageRadio.addEventListener("click", () => {
|
||||||
mainClassList.add("serious");
|
mainClassList.add("serious");
|
||||||
for (seriousButton of buttons) {
|
for (seriousElement of seriousElements) {
|
||||||
seriousButton.classList.add("serious");
|
seriousElement.classList.add("serious");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
exampleTextOnlyRadio.addEventListener("click", () => {
|
exampleTextOnlyRadio.addEventListener("click", () => {
|
||||||
mainClassList.remove("serious");
|
mainClassList.remove("serious");
|
||||||
for (seriousButton of buttons) {
|
for (seriousElement of seriousElements) {
|
||||||
seriousButton.classList.remove("serious");
|
seriousElement.classList.remove("serious");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -100,12 +101,12 @@ seriousLightItalicButton.addEventListener("click", function () {
|
|||||||
mainClassList.add("seriousLightItalic");
|
mainClassList.add("seriousLightItalic");
|
||||||
});
|
});
|
||||||
|
|
||||||
newExampleText.addEventListener("keydown", (event) => {
|
newExampleTextInput.addEventListener("keydown", (event) => {
|
||||||
if (event.code === "Enter") {
|
if (event.code === "Enter") {
|
||||||
exampleText.setHTML(newExampleText.value);
|
exampleText.setHTML(newExampleTextInput.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
newExampleTextButton.addEventListener("click", () => {
|
newExampleTextButton.addEventListener("click", () => {
|
||||||
exampleText.setHTML(newExampleText.value);
|
exampleText.setHTML(newExampleTextInput.value);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user