class CustomCodeExplanation extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { this.render(); } static get observedAttributes() { return ['explanation', 'generated-code']; } attributeChangedCallback(name, oldValue, newValue) { if (oldValue !== newValue) { this.render(); } } render() { const explanation = this.getAttribute('explanation') || 'Select a tool to generate code and see explanations'; const generatedCode = this.getAttribute('generated-code') || '// No code generated yet'; this.shadowRoot.innerHTML = `

Explication du Code

${explanation}
CSS
HTML
JS
${generatedCode}
`; feather.replace(); } } customElements.define('custom-code-explanation', CustomCodeExplanation);