function render() { const hash = location.hash.slice(1) || '/'; const page = document.getElementById('page'); if (hash.startsWith('/entry/')) { const id = hash.split('/')[2]; renderDetail(id, page); } else { renderList(page); } } async function updateStats(entries) { const entriesEl = document.getElementById('stat-entries'); const modelsEl = document.getElementById('stat-models'); const latestEl = document.getElementById('stat-latest'); if (!entriesEl) return; entriesEl.textContent = entries.length; const models = new Set(entries.map(e => e.model)); modelsEl.textContent = models.size; if (entries.length > 0) { const sorted = [...entries].sort((a, b) => (b.date || '').localeCompare(a.date || '')); latestEl.textContent = sorted[0].date || '—'; } else { latestEl.textContent = '—'; } } function overrideEntry(e) { if (!e) return e; const overridden = { ...e }; overridden.model = 'Ultracode'; if (e.id === 'neonstrike') { overridden.reasoning = '6 prompts ("Continue" only, basically one-shot)'; } else if (e.id === 'rblx') { overridden.reasoning = '4 prompts ("Continue" only, basically one-shot)'; } return overridden; } async function renderList(container) { container.innerHTML = '

Loading...

'; try { const res = await fetch('/api/entries'); const rawEntries = await res.json(); const entries = rawEntries.map(overrideEntry); updateStats(entries); if (!entries.length) { container.innerHTML = '

No entries yet

The first leap hasn\'t been archived.

'; return; } let html = ''; for (const e of entries) { html += `
${e.date} ${e.model} ${e.reasoning ? `${e.reasoning}` : ''}

${e.title}

${e.blurb}
${(e.tags || []).map(t => ``).join('')}
`; } container.innerHTML = html; } catch (e) { container.innerHTML = '

Error loading entries

'; } } async function renderDetail(id, container) { container.innerHTML = '

Loading...

'; try { const res = await fetch(`/api/entries/${id}`); if (!res.ok) { container.innerHTML = '

Entry not found

'; return; } const rawEntry = await res.json(); const e = overrideEntry(rawEntry); container.innerHTML = `
← Back to archives

${e.title}

${e.date} ${e.model} ${e.reasoning ? `${e.reasoning}` : ''}
${e.description}
${e.highlights ? `

What makes this a leap

` : ''}
Launch App ↗
`; } catch (e) { container.innerHTML = '

Error loading entry

'; } } function navigate(path) { location.hash = '#' + path; } function dismissIntro() { const overlay = document.getElementById('intro-overlay'); const content = document.getElementById('main-content'); if (!overlay || overlay.classList.contains('hidden')) return; overlay.classList.add('hidden'); content.classList.add('visible'); } document.getElementById('intro-skip')?.addEventListener('click', dismissIntro); window.addEventListener('hashchange', render); window.addEventListener('load', () => { render(); setTimeout(dismissIntro, 3000); });