class CustomNavbar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = `
`; // Add event listener for train button this.shadowRoot.getElementById('train-btn').addEventListener('click', () => { const event = new CustomEvent('train-clicked', { bubbles: true, composed: true }); this.dispatchEvent(event); }); } } customElements.define('custom-navbar', CustomNavbar);