stylescape
Version:
Stylescape is a visual identity framework developed by Scape Agency.
22 lines • 809 B
JavaScript
export class FontPreview {
constructor(inputSelector, previewSelector) {
const input = document.querySelector(inputSelector);
if (!input)
throw new Error(`Input element "${inputSelector}" not found`);
this.inputElement = input;
this.previewElements = Array.from(document.querySelectorAll(previewSelector));
this.initialize();
}
initialize() {
this.inputElement.addEventListener("input", () => this.updatePreviewText());
this.updatePreviewText();
}
updatePreviewText() {
const value = this.inputElement.value ||
"The quick brown fox jumps over the lazy dog.";
this.previewElements.forEach((el) => {
el.textContent = value;
});
}
}
//# sourceMappingURL=FontPreview.js.map