class GameOver extends HTMLElement { static get observedAttributes() { return ['visible']; } constructor() { super(); this.attachShadow({ mode: 'open' }); this.visible = 'false'; } connectedCallback() { this.render(); } attributeChangedCallback(name, oldValue, newValue) { if (name === 'visible') { this.visible = newValue; this.render(); } } render() { this.shadowRoot.innerHTML = `