Refactor UI auth flow, remove uploads app files

Rework client UI state: move and update showLogin/showApp in public/app.js to explicitly set display styles when toggling screens and ensure user info and file load on app show. Remove the theme toggle from public/index.html and simplify CSS by collapsing color variable definitions (dark-theme-focused) in public/style.css. Add a VS Code workspace file. Remove the old uploads/Think app (Dockerfile, package.json, server.js and associated lockfile).
This commit is contained in:
Toni
2026-02-09 11:08:59 +01:00
parent 9f23fd42fa
commit 3fc28af508
8 changed files with 31 additions and 2296 deletions

View File

@@ -65,18 +65,7 @@ document.getElementById('logout-btn').addEventListener('click', async () => {
window.location.reload();
});
function showLogin() {
loginScreen.classList.remove('hidden');
appScreen.classList.add('hidden');
}
function showApp() {
loginScreen.classList.add('hidden');
appScreen.classList.remove('hidden');
document.getElementById('user-display').textContent = currentUser.username;
loadFiles();
updateViewIcon();
}
// --- View Mode ---
function toggleView() {
@@ -94,6 +83,27 @@ function updateViewIcon() {
}
viewToggleBtn.addEventListener('click', toggleView);
// --- Auth / UI State ---
function showLogin() {
// Force style to ensure hidden/visible
loginScreen.classList.remove('hidden');
loginScreen.style.display = 'flex';
appScreen.classList.add('hidden');
}
function showApp() {
loginScreen.classList.add('hidden');
loginScreen.style.display = 'none'; // Force hide
appScreen.classList.remove('hidden');
document.getElementById('user-display').textContent = currentUser.username;
loadFiles();
updateViewIcon();
}
// --- Files ---
async function loadFiles(path = currentPath) {
try {

View File

@@ -40,9 +40,7 @@
</div>
<div class="controls">
<span id="user-display"></span>
<button id="theme-toggle" class="btn secondary" aria-label="Toggle Dark Mode">
<span class="icon">🌓</span>
</button>
<button id="logout-btn" class="btn secondary">Logout</button>
</div>
</header>

View File

@@ -1,17 +1,4 @@
:root {
--bg-color: #f8f9fa;
--card-bg: #ffffff;
--text-color: #1f2937;
--text-secondary: #6b7280;
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--border-color: #e5e7eb;
--danger-color: #ef4444;
--modal-bg: rgba(0, 0, 0, 0.8);
}
/* Dark Mode Variables */
[data-theme="dark"] {
--bg-color: #111827;
--card-bg: #1f2937;
--text-color: #f9fafb;
@@ -19,22 +6,10 @@
--primary-color: #60a5fa;
--primary-hover: #3b82f6;
--border-color: #374151;
--danger-color: #ef4444;
--modal-bg: rgba(0, 0, 0, 0.9);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg-color: #111827;
--card-bg: #1f2937;
--text-color: #f9fafb;
--text-secondary: #9ca3af;
--primary-color: #60a5fa;
--primary-hover: #3b82f6;
--border-color: #374151;
--modal-bg: rgba(0, 0, 0, 0.9);
}
}
body {
font-family: 'Inter', sans-serif;
background-color: var(--bg-color);