File size: 1,442 Bytes
2460793 | 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 | class ProgramStep extends HTMLElement {
connectedCallback() {
const week = this.getAttribute('week') || '';
const title = this.getAttribute('title') || '';
const description = this.getAttribute('description') || '';
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.step-card {
background: white;
border-radius: 0.5rem;
padding: 1.5rem;
border-left: 4px solid #10b981;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
height: 100%;
transition: transform 0.2s;
}
.step-card:hover {
transform: translateY(-2px);
}
.week {
display: inline-block;
background-color: #10b981;
color: white;
font-weight: 600;
padding: 0.25rem 0.75rem;
border-radius: 9999px;
margin-bottom: 0.75rem;
font-size: 0.875rem;
}
.title {
font-size: 1.25rem;
font-weight: 600;
color: #1f2937;
margin-bottom: 0.5rem;
}
.description {
color: #6b7280;
line-height: 1.5;
}
</style>
<div class="step-card">
<div class="week">Week ${week}</div>
<h3 class="title">${title}</h3>
<p class="description">${description}</p>
</div>
`;
}
}
customElements.define('program-step', ProgramStep); |