class CustomCreatorCard extends HTMLElement { connectedCallback() { const name = this.getAttribute('name') || 'Creator Name'; const category = this.getAttribute('category') || 'Category'; const skills = this.getAttribute('skills') || 'Skills not specified'; const image = this.getAttribute('image') || 'http://static.photos/people/640x360/10'; const rating = parseFloat(this.getAttribute('rating')) || 0; this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = `
${name}

${name}

${category}
${this.renderStars(rating)} ${rating.toFixed(1)}
DFW

${skills}

View profile
`; setTimeout(() => { feather.replace(); }, 0); } renderStars(rating) { let stars = ''; for (let i = 1; i <= 5; i++) { if (i <= Math.floor(rating)) { stars += ''; } else if (i - 0.5 <= rating) { stars += ''; } else { stars += ''; } } return stars; } } customElements.define('custom-creator-card', CustomCreatorCard);