class GalleryGrid extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
No generations yet
Your creations will be saved here automatically
`;
}
}
updateCount(count) {
const countEl = this.shadowRoot.getElementById('gallery-count');
if (countEl) {
countEl.textContent = `${count} item${count !== 1 ? 's' : ''}`;
}
}
setContent(html) {
const grid = this.shadowRoot.getElementById('gallery-grid');
if (grid) {
grid.innerHTML = html;
}
}
}
customElements.define('gallery-grid', GalleryGrid);