216 lines
8.3 KiB
HTML
216 lines
8.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>General Bots</title>
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
<meta
|
|
name="description"
|
|
content="General Bots - AI-powered workspace"
|
|
/>
|
|
<meta name="theme-color" content="#3b82f6" />
|
|
|
|
<!-- Styles -->
|
|
<link rel="stylesheet" href="css/app.css" />
|
|
|
|
<!-- External Libraries -->
|
|
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
|
|
<script src="https://unpkg.com/htmx.org/dist/ext/ws.js"></script>
|
|
<script src="https://unpkg.com/htmx.org/dist/ext/json-enc.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<!-- Loading overlay -->
|
|
<div class="loading-overlay" id="loadingOverlay">
|
|
<div class="loading-spinner"></div>
|
|
</div>
|
|
|
|
<!-- Floating header -->
|
|
<header class="float-header" role="banner">
|
|
<!-- Left: General Bots logo -->
|
|
<div class="header-left">
|
|
<button
|
|
class="logo-wrapper"
|
|
onclick="window.location.reload()"
|
|
title="General Bots - Reload"
|
|
aria-label="General Bots - Reload application"
|
|
>
|
|
<div
|
|
class="logo-icon"
|
|
role="img"
|
|
aria-label="General Bots logo"
|
|
></div>
|
|
<span class="logo-text">General Bots</span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Right: Theme selector, Apps menu and user avatar -->
|
|
<div class="header-right">
|
|
<!-- Theme dropdown selector -->
|
|
<div
|
|
id="themeSelectorContainer"
|
|
aria-label="Theme selector"
|
|
></div>
|
|
|
|
<!-- Apps menu button -->
|
|
<button
|
|
class="icon-button apps-button"
|
|
id="appsButton"
|
|
title="Applications"
|
|
aria-label="Open applications menu"
|
|
aria-expanded="false"
|
|
aria-haspopup="true"
|
|
>
|
|
<svg
|
|
width="24"
|
|
height="24"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
aria-hidden="true"
|
|
hx-get="/api/apps"
|
|
hx-target="#appsDropdown"
|
|
hx-trigger="click"
|
|
>
|
|
<circle cx="5" cy="5" r="2"></circle>
|
|
<circle cx="12" cy="5" r="2"></circle>
|
|
<circle cx="19" cy="5" r="2"></circle>
|
|
<circle cx="5" cy="12" r="2"></circle>
|
|
<circle cx="12" cy="12" r="2"></circle>
|
|
<circle cx="19" cy="12" r="2"></circle>
|
|
<circle cx="5" cy="19" r="2"></circle>
|
|
<circle cx="12" cy="19" r="2"></circle>
|
|
<circle cx="19" cy="19" r="2"></circle>
|
|
</svg>
|
|
</button>
|
|
|
|
<!-- Apps dropdown menu -->
|
|
<nav
|
|
class="apps-dropdown"
|
|
id="appsDropdown"
|
|
role="menu"
|
|
aria-label="Applications"
|
|
>
|
|
<div class="apps-dropdown-title">Applications</div>
|
|
<div class="app-grid" role="group">
|
|
<a
|
|
class="app-item active"
|
|
href="#chat"
|
|
data-section="chat"
|
|
role="menuitem"
|
|
aria-label="Chat application"
|
|
hx-get="/api/chat"
|
|
hx-target="#main-content"
|
|
hx-push-url="true"
|
|
>
|
|
<div class="app-icon" aria-hidden="true">💬</div>
|
|
<span>Chat</span>
|
|
</a>
|
|
<a
|
|
class="app-item"
|
|
href="#drive"
|
|
data-section="drive"
|
|
role="menuitem"
|
|
aria-label="Drive application"
|
|
hx-get="/api/drive/list"
|
|
hx-target="#main-content"
|
|
hx-push-url="true"
|
|
>
|
|
<div class="app-icon" aria-hidden="true">📁</div>
|
|
<span>Drive</span>
|
|
</a>
|
|
<a
|
|
class="app-item"
|
|
href="#tasks"
|
|
data-section="tasks"
|
|
role="menuitem"
|
|
aria-label="Tasks application"
|
|
hx-get="/api/tasks"
|
|
hx-target="#main-content"
|
|
hx-push-url="true"
|
|
>
|
|
<div class="app-icon" aria-hidden="true">✓</div>
|
|
<span>Tasks</span>
|
|
</a>
|
|
<a
|
|
class="app-item"
|
|
href="#mail"
|
|
data-section="mail"
|
|
role="menuitem"
|
|
aria-label="Mail application"
|
|
hx-get="/api/email/latest"
|
|
hx-target="#main-content"
|
|
hx-push-url="true"
|
|
>
|
|
<div class="app-icon" aria-hidden="true">✉</div>
|
|
<span>Mail</span>
|
|
</a>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- User avatar -->
|
|
<button
|
|
class="user-avatar"
|
|
id="userAvatar"
|
|
title="User Account"
|
|
aria-label="User account menu"
|
|
>
|
|
<span aria-hidden="true">U</span>
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Main content area -->
|
|
<main
|
|
id="main-content"
|
|
role="main"
|
|
hx-ext="ws"
|
|
ws-connect="/ws/notifications"
|
|
>
|
|
<!-- Sections will be loaded dynamically -->
|
|
</main>
|
|
|
|
<!-- Core scripts -->
|
|
<script src="js/theme-manager.js"></script>
|
|
<script src="js/htmx-app.js"></script>
|
|
|
|
<!-- Application initialization -->
|
|
<script>
|
|
// Simple initialization for HTMX app
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
console.log("🚀 Initializing General Bots with HTMX...");
|
|
|
|
// Hide loading overlay
|
|
setTimeout(() => {
|
|
const loadingOverlay =
|
|
document.getElementById("loadingOverlay");
|
|
if (loadingOverlay) {
|
|
loadingOverlay.classList.add("hidden");
|
|
}
|
|
}, 500);
|
|
|
|
// Simple apps menu handling
|
|
const appsBtn = document.getElementById("appsButton");
|
|
const appsDropdown = document.getElementById("appsDropdown");
|
|
|
|
if (appsBtn && appsDropdown) {
|
|
appsBtn.addEventListener("click", (e) => {
|
|
e.stopPropagation();
|
|
const isOpen = appsDropdown.classList.toggle("show");
|
|
appsBtn.setAttribute("aria-expanded", isOpen);
|
|
});
|
|
|
|
document.addEventListener("click", (e) => {
|
|
if (
|
|
!appsDropdown.contains(e.target) &&
|
|
!appsBtn.contains(e.target)
|
|
) {
|
|
appsDropdown.classList.remove("show");
|
|
appsBtn.setAttribute("aria-expanded", "false");
|
|
}
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|