class GameControls extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
Controls
`;
this.shadowRoot.getElementById('startBtn').addEventListener('click', () => {
this.dispatchEvent(new CustomEvent('start-game'));
});
this.shadowRoot.getElementById('resetBtn').addEventListener('click', () => {
this.dispatchEvent(new CustomEvent('reset-game'));
});
feather.replace();
}
}
customElements.define('custom-game-controls', GameControls);