File size: 2,458 Bytes
4d54963 81b4f93 4d54963 81b4f93 4d54963 81b4f93 4d54963 81b4f93 4d54963 81b4f93 4d54963 81b4f93 4d54963 81b4f93 4d54963 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
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 12px 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;
flex-shrink: 0;
}
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;
transition: all 0.15s;
}
.primary {
background: #3b82f6;
color: white;
border: none;
}
.primary:hover {
background: #2563eb;
}
.secondary {
background: white;
border: 1px solid #e5e7eb;
color: #4b5563;
}
.secondary:hover {
background: #f3f4f6;
}
</style>
<div class="card">
<div class="header">
<svg class="icon" viewBox="0 0 32 32" fill="none">
<rect width="32" height="32" rx="4" fill="#1e293b"/>
<path d="M10 10l6 4v8l-6-4v-8z" fill="#3b82f6"/>
<path d="M16 14l6 4v8l-6-4v-8z" fill="#64748b"/>
</svg>
<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);
|