froublot's picture
integre toutes les formations du json ameliore le visuel
f493344 verified
Raw
History Blame Contribute Delete
863 Bytes
class CardLoader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.loader {
display: flex;
flex-direction: column;
gap: 1rem;
}
.skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
border-radius: 0.5rem;
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
</style>
<div class="loader">
${Array(3).fill().map(() => `
<div class="skeleton" style="height: 120px;"></div>
`).join('')}
</div>
`;
}
}
customElements.define('card-loader', CardLoader);