class ModalImage extends HTMLElement { #src = null; #alt = null; #imgElem = null; constructor () { super(); this.attachShadow({ mode: "open" }); this.shadowRoot.innerHTML = ` `; this.#imgElem = this.shadowRoot.querySelector("img"); this.#imgElem.onclick = this.modalZoom.bind(this); } connectedCallback () { const src = this.getAttribute("src"); const alt = this.getAttribute("alt"); this.#src = src; this.#alt = alt; this.#imgElem.src = src; this.#imgElem.alt = alt; } modalZoom () { const modalBox = document.createElement("dialog"); modalBox.innerHTML = `