webinterface/client/welcome.html

88 lines
4.1 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Chat Interface</title>
<!-- Google Font -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<!-- Link to CSS -->
<link rel="stylesheet" href="css/styles.css">
<!-- Add any necessary CSS for loading indicator here or ensure it's in styles.css -->
<style>
/* Basic Loading Spinner (if not already in styles.css) */
.loading-spinner {
border: 4px solid var(--bg-tertiary);
border-top: 4px solid var(--primary-color);
border-radius: 50%;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
margin: 0 8px; /* Adjust spacing */
flex-shrink: 0;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
</style>
</head>
<body id="chat-page"> <!-- ****** ADD THIS ID ****** -->
<!-- Fixed Header -->
<header class="header">
<div class="header-logo">AI Chat</div>
<div class="header-user-info">
<p><strong>User:</strong> <span id="username">Laden...</span></p> <!-- Indicate Loading -->
<p><strong>Admin:</strong> <span id="isAdmin">Laden...</span></p> <!-- Indicate Loading -->
</div>
<div class="header-buttons">
<button id="themeToggleBtn" class="header-btn theme-toggle" aria-label="Toggle Theme">☀️</button>
<button id="adminPermissionsBtn" class="header-btn" style="display: none;">Admin</button>
<button id="logoutBtn" class="header-btn">Abmelden</button>
</div>
</header>
<!-- Main Content Area -->
<div class="main-container">
<!-- Sidebar -->
<aside class="sidebar" id="chatSidebar">
<h3>Chats</h3>
<button id="newChatButton" class="sidebar-btn new-chat-btn">Neuer Chat</button>
<div id="chatList"></div>
</aside>
<!-- Main Chat Area -->
<main class="chat-container">
<!-- Progress Bar -->
<div id="progress-main-div">
<div id="progress-container"><div id="progress-bar"></div></div>
<p id="usage-text">Token Usage: 0 / 0</p>
</div>
<!-- Chat Box -->
<div class="chat-box" id="chatBox" aria-live="polite">
<div class="chat-message assistant">Wähle einen Chat oder starte einen neuen.</div>
</div>
<!-- Input Area -->
<div class="chat-input-container">
<textarea id="chatInput" class="chat-input" placeholder="Schreibe eine Nachricht..." rows="1" aria-label="Chat message input"></textarea>
<div id="loadingIndicator" class="loading-spinner" style="display: none;"></div>
<button id="sendButton" class="chat-send-button" aria-label="Send message"></button>
</div>
</main>
</div>
<!-- Modals (ensure these are correctly defined) -->
<div id="custom-alert" class="custom-alert"><div class="alert-content"><span id="alert-message"></span><button id="close-alert" class="close-btn">OK</button></div></div>
<div id="custom-alert-confirm" class="custom-alert-confirm"><div class="alert-content"><p id="alert-message-confirm"></p><div style="display: flex; gap: 10px; margin-top: 10px;"><button id="confirm-alert-confirm">Bestätigen</button><button id="close-alert-confirm">Abbrechen</button></div></div></div>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.0.6/dist/purify.min.js"></script>
<script type="module" src="js/config.js"></script>
<script type="module" src="js/shared_functions.js"></script>
<script type="module" src="js/api_service.js"></script>
<script type="module" src="js/chat_ui.js"></script>
<script type="module" src="js/chat_manager.js"></script>
<script type="module" src="js/main.js"></script> <!-- main.js should be last for setup -->
</body>
</html>