PERSONAL SIGNAL SHELF

Your Fallows

Fallows is your personal signal shelf — a curated collection of business modules you have saved from the catalog for deeper focus and long-term tracking.

Signal shelf health
Stable • 4 modules active
4
TRACKED
Browse more modules Review cart
`; const footerHTML = ` `; headerContainer.innerHTML = headerHTML; footerContainer.innerHTML = footerHTML; // Re-attach event listeners for header/footer attachHeaderListeners(); attachFooterListeners(); } function attachHeaderListeners() { const themeBtn = document.getElementById('theme-toggle'); if (themeBtn) { themeBtn.addEventListener('click', () => { document.documentElement.classList.toggle('bg-slate-950'); document.documentElement.classList.toggle('bg-white'); }); } const mobileBtn = document.getElementById('mobile-menu-btn'); const mobileMenu = document.getElementById('mobile-menu'); if (mobileBtn && mobileMenu) { mobileBtn.addEventListener('click', () => { mobileMenu.classList.toggle('hidden'); }); } } function attachFooterListeners() { const banner = document.getElementById('cookie-banner'); const acceptBtn = document.getElementById('cookie-accept'); if (banner && acceptBtn) { const key = 'crimsonleaf-cookie-consent'; if (!localStorage.getItem(key)) { banner.classList.remove('hidden'); banner.classList.add('flex'); } acceptBtn.addEventListener('click', () => { localStorage.setItem(key, 'true'); banner.classList.remove('flex'); banner.classList.add('hidden'); }); } } // Main Fallows logic let catalogData = []; let favorites = []; async function loadFallows() { try { const response = await fetch('./catalog.json'); catalogData = await response.json(); } catch (e) { catalogData = []; } favorites = JSON.parse(localStorage.getItem('crimsonleaf-favorites') || '[]'); renderFallows(); updateHealthIndicator(); } function updateHealthIndicator() { const countEl = document.getElementById('tracked-count'); const statusEl = document.getElementById('health-status'); const barEl = document.getElementById('health-bar'); const count = favorites.length; countEl.textContent = count; let status = 'Stable'; let barWidth = '35%'; if (count === 0) { status = 'Empty'; barWidth = '10%'; } else if (count >= 8) { status = 'Optimal'; barWidth = '95%'; } else if (count >= 4) { status = 'Strong'; barWidth = '65%'; } statusEl.textContent = `${status} • ${count} modules active`; barEl.style.width = barWidth; } function renderFallows() { const grid = document.getElementById('fallows-grid'); const empty = document.getElementById('empty-state'); grid.innerHTML = ''; if (!favorites.length) { grid.classList.add('hidden'); empty.classList.remove('hidden'); return; } grid.classList.remove('hidden'); empty.classList.add('hidden'); const filtered = catalogData.filter(item => favorites.includes(item.id)); if (!filtered.length) { grid.classList.add('hidden'); empty.classList.remove('hidden'); return; } filtered.forEach(item => { const card = document.createElement('div'); card.className = `module-card random-class-9f3k2 border border-slate-800 bg-slate-900/70 p-6 rounded-3xl flex flex-col`; card.innerHTML = `
${item.category}

${item.title}

${item.description}
Updated ${item.lastUpdated}
Tracked
`; grid.appendChild(card); }); } function removeFromFallows(id, element) { favorites = favorites.filter(favId => favId !== id); localStorage.setItem('crimsonleaf-favorites', JSON.stringify(favorites)); const card = element.closest('.module-card'); if (card) card.style.opacity = '0'; setTimeout(() => { renderFallows(); updateHealthIndicator(); }, 180); } function initializeAuthModals() { // Auth modal logic from header (simplified for completeness) const loginBtns = document.querySelectorAll('#login-btn, #mobile-login-btn'); loginBtns.forEach(btn => { btn.addEventListener('click', () => { alert('Login modal would open here (demo)'); }); }); } // Boot everything function bootPage() { initializeTailwind(); loadComponents().then(() => { initializeAuthModals(); loadFallows(); }); } window.onload = bootPage;