| class IdeCard extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| margin: 1rem 0; | |
| } | |
| .card { | |
| border: 1px solid #e5e7eb; | |
| border-radius: 8px; | |
| padding: 1rem; | |
| background: #f9fafb; | |
| transition: all 0.2s; | |
| } | |
| .card:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); | |
| } | |
| .header { | |
| display: flex; | |
| align-items: center; | |
| margin-bottom: 0.5rem; | |
| } | |
| .icon { | |
| width: 32px; | |
| height: 32px; | |
| margin-right: 0.5rem; | |
| border-radius: 4px; | |
| } | |
| h3 { | |
| margin: 0; | |
| font-size: 1rem; | |
| font-weight: 600; | |
| } | |
| .description { | |
| color: #6b7280; | |
| font-size: 0.875rem; | |
| margin: 0.5rem 0; | |
| } | |
| .actions { | |
| display: flex; | |
| gap: 0.5rem; | |
| margin-top: 0.75rem; | |
| } | |
| a { | |
| padding: 0.25rem 0.5rem; | |
| font-size: 0.875rem; | |
| border-radius: 4px; | |
| text-decoration: none; | |
| display: inline-block; | |
| } | |
| .primary { | |
| background: #3b82f6; | |
| color: white; | |
| border: none; | |
| } | |
| .secondary { | |
| background: white; | |
| border: 1px solid #e5e7eb; | |
| color: #4b5563; | |
| } | |
| </style> | |
| <div class="card"> | |
| <div class="header"> | |
| <img src="http://static.photos/technology/200x200/${Math.floor(Math.random() * 100)}" class="icon"> | |
| <h3><slot name="name">IDE</slot></h3> | |
| </div> | |
| <div class="description"><slot name="description">Development environment</slot></div> | |
| <div class="actions"> | |
| <a href="#" class="primary" target="_blank">Download</a> | |
| <a href="#" class="secondary" target="_blank">Docs</a> | |
| </div> | |
| </div> | |
| `; | |
| } | |
| } | |
| customElements.define('ide-card', IdeCard); |