document.addEventListener('DOMContentLoaded', () => { fetch('manifest.json') .then(response => response.json()) .then(data => renderAppList(data)); document.getElementById('browse-button').addEventListener('click', () => { const detailView = document.getElementById('app-detail'); if (detailView) { detailView.remove(); } fetch('manifest.json') .then(response => response.json()) .then(data => renderAppList(data)); }); }); function renderAppList(manifest) { const listContainer = document.getElementById('app-list-container'); listContainer.innerHTML = ''; manifest.forEach((app, index) => { const item = document.createElement('div'); item.className = 'grid-item'; item.style.setProperty('--gradient', app.gradient); item.innerHTML = ` ${app.name}

${app.name}

`; item.addEventListener('click', () => showAppDetail(app)); listContainer.appendChild(item); }); } function showAppDetail(app) { const detailView = document.createElement('div'); detailView.className = 'detail-view'; detailView.id = 'app-detail'; detailView.innerHTML = `

${app.name}

${app.name}

${app.description}

Screenshot 1 Screenshot 2
`; document.getElementById('app').appendChild(detailView); document.getElementById('install-button').addEventListener('click', () => { window.location.href = app.installUrl; }); }