class CustomFeatureCard extends HTMLElement { static get observedAttributes() { return ['type', 'title', 'description', 'icon', 'color']; } connectedCallback() { this.attachShadow({ mode: 'open' }); this.render(); } getColors(color) { const colors = { primary: { from: '#0ea5e9', to: '#0284c7', glow: 'rgba(14, 165, 233, 0.3)' }, secondary: { from: '#d946ef', to: '#c026d3', glow: 'rgba(217, 70, 239, 0.3)' }, accent: { from: '#f97316', to: '#ea580c', glow: 'rgba(249, 115, 22, 0.3)' } }; return colors[color] || colors.primary; } render() { const type = this.getAttribute('type') || 'image'; const title = this.getAttribute('title') || 'Feature'; const description = this.getAttribute('description') || ''; const icon = this.getAttribute('icon') || 'star'; const colorKey = this.getAttribute('color') || 'primary'; const colors = this.getColors(colorKey); this.shadowRoot.innerHTML = `
${type}

${title}

${description}

${this.getFeatureItems(type, colors.from)}
4K 8K 16K 20K+
`; } getFeatureItems(type, color) { const features = { image: [ { icon: 'maximize', text: 'Up to 20K resolution' }, { icon: 'layers', text: 'AI Upscaling 4x' }, { icon: 'sliders', text: 'Pro color grading' } ], video: [ { icon: 'clock', text: 'Up to 8K 120fps' }, { icon: 'repeat', text: 'HDR10+ support' }, { icon: 'film', text: 'Cinema quality' } ], gif: [ { icon: 'loader', text: '4K 60fps loops' }, { icon: 'palette', text: 'Lossless encoding' }, { icon: 'share-2', text: 'Web optimized' } ], '3d': [ { icon: 'box', text: '8K texture maps' }, { icon: 'grid', text: 'PBR 4K materials' }, { icon: 'printer', text: 'Micron precision' } ] }; return (features[type] || features.image).map(f => `
${f.text}
`).join(''); } } customElements.define('custom-feature-card', CustomFeatureCard);