class CustomFooter extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` `; this.init(); } init() { const backToTop = this.shadowRoot.getElementById('backToTop'); backToTop.addEventListener('click', () => { window.scrollTo({ top: 0, behavior: 'smooth' }); }); // Re-initialize feather icons for shadow DOM if (typeof feather !== 'undefined') { feather.replace(this.shadowRoot); } } } customElements.define('custom-footer', CustomFooter);