// Class Of Learners Global Router & Banner System ;(async function () { if (window._colRouterRunning) return window._colRouterRunning = true try { // Fetch global config from GitHub/Vercel const res = await fetch('config.json?t=' + new Date().getTime()) if (!res.ok) return const config = await res.json() // Determine current page basename let page = window.location.pathname.split('/').pop() if (!page) page = 'home' // Default // 1. Check Routing Overrides if (config.pages && config.pages[page]) { const status = config.pages[page] if (status !== '200') { renderErrorScreen(status) return // Stop execution, don't render banner if page is dead } } // 2. Render Global Banner if (config.banner && config.banner.active && config.banner.text) { renderBanner(config.banner.text) } } catch (e) {} function renderErrorScreen(code) { document.head.innerHTML = `
${info.desc}
Return to Base ` } function renderBanner(text) { if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => injectBanner(text)) } else { injectBanner(text) } } function injectBanner(text) { const b = document.createElement('div') b.style.cssText = "background: linear-gradient(90deg, #38bdf8, #818cf8); color: #fff; text-align: center; padding: 12px 20px; font-weight: bold; font-family: 'Inter', sans-serif; font-size: 14px; position: relative; z-index: 999999; box-shadow: 0 4px 15px rgba(0,0,0,0.2); line-height: 1.5;" b.innerHTML = `🚀 ${text} ×` document.body.insertBefore(b, document.body.firstChild) } })()