|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => { |
|
|
|
|
|
const isLoggedIn = localStorage.getItem('eveLoggedIn') === 'true'; |
|
|
|
|
|
if (isLoggedIn || window.location.pathname.includes('login.html')) { |
|
|
if (!window.location.pathname.includes('login.html')) { |
|
|
|
|
|
document.getElementById('main-content').style.display = 'block'; |
|
|
|
|
|
|
|
|
const app = document.createElement('gradio-app'); |
|
|
app.src = "https://huggingface.co/spaces/kirikir13/eve-2-d-syre-ai-companion-hub"; |
|
|
document.getElementById('gradio-app').appendChild(app); |
|
|
document.getElementById('gradio-app').classList.remove('hidden'); |
|
|
|
|
|
|
|
|
const chatInterface = document.querySelector('.bg-gray-800\\/80'); |
|
|
if (chatInterface) chatInterface.classList.add('hidden'); |
|
|
} |
|
|
} else { |
|
|
|
|
|
if (!window.location.pathname.includes('login.html')) { |
|
|
window.location.href = '/login.html'; |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
if (window.location.pathname.includes('login.html')) { |
|
|
const loginForm = document.querySelector('form'); |
|
|
if (loginForm) { |
|
|
loginForm.addEventListener('submit', (e) => { |
|
|
e.preventDefault(); |
|
|
localStorage.setItem('eveLoggedIn', 'true'); |
|
|
window.location.href = '/'; |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => { |
|
|
const ramMonitor = document.createElement('ram-monitor'); |
|
|
document.querySelector('.status-bar').appendChild(ramMonitor); |
|
|
}); |
|
|
|