class Banner { constructor() { this.element = null; this.title = ""; this.text = ""; } updateText(newText) { this.text = newText; this.element.querySelector("#banner-text").innerText = this.text; } updateTitle(newTitle) { this.title = newTitle; this.element.querySelector("#banner-title").innerText = this.title; } mountOn(target) { if (this.element) return; // Already mounted this.element = document.createRange().createContextualFragment(`