index.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>LocalFoodAI Chat</title>
  7. <meta name="description" content="LocalFoodAI Assistant for Nutritional Information and Menu Proposals">
  8. <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
  9. <link rel="stylesheet" href="/static/style.css">
  10. </head>
  11. <body>
  12. <div class="app-container" id="chat-app" style="display: none;">
  13. <header class="chat-header">
  14. <div class="brand">
  15. <div class="logo">🍳</div>
  16. <div>
  17. <h1>LocalFoodAI</h1>
  18. <span class="status-indicator" id="status-dot"></span><span class="status-text" id="status-text">Local LLM Ready</span>
  19. </div>
  20. </div>
  21. <div class="actions">
  22. <span id="user-greeting" style="margin-right:15px; font-size: 0.9rem; color: var(--text-muted);"></span>
  23. <button id="nav-logout-btn" class="nav-btn">Logout</button>
  24. <button id="clear-chat" title="Clear Chat">
  25. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"></path></svg>
  26. </button>
  27. </div>
  28. </header>
  29. <main class="chat-container" id="chat-container">
  30. <div class="message system">
  31. <div class="avatar">🤖</div>
  32. <div class="message-content">
  33. <p>Hello! I am LocalFoodAI, your completely local nutrition and menu assistant. How can I help you today?</p>
  34. </div>
  35. </div>
  36. </main>
  37. <footer class="chat-input-area">
  38. <form id="chat-form" class="input-form">
  39. <textarea id="user-input" placeholder="Ask about recipes, nutrition, menus..." rows="1" required></textarea>
  40. <button type="submit" id="send-btn" class="send-btn" aria-label="Send message">
  41. <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>
  42. </button>
  43. </form>
  44. <div class="footer-note">Powered by Llama 3.1 8B running locally on Ubuntu 24.04 via Ollama</div>
  45. </footer>
  46. </div>
  47. <!-- Authentication Gateway -->
  48. <div class="auth-container" id="auth-screen">
  49. <div class="auth-header">
  50. <div class="logo" style="margin-bottom: 10px;">🍳</div>
  51. <h2>Welcome to LocalFoodAI</h2>
  52. <p>Please log in or create an account to continue.</p>
  53. </div>
  54. <!-- Login Form -->
  55. <form id="login-form">
  56. <div class="input-group">
  57. <label for="login-username">Username</label>
  58. <input type="text" id="login-username" required>
  59. </div>
  60. <div class="input-group">
  61. <label for="login-password">Password</label>
  62. <input type="password" id="login-password" required>
  63. </div>
  64. <div id="login-error" class="error-text"></div>
  65. <button type="submit" class="primary-btn" id="login-submit-btn">Login</button>
  66. <p class="auth-toggle">Don't have an account? <a href="#" id="show-register">Register here</a></p>
  67. </form>
  68. <!-- Registration Form (Hidden by default) -->
  69. <form id="register-form" style="display: none;">
  70. <div class="input-group">
  71. <label for="reg-username">Username</label>
  72. <input type="text" id="reg-username" required minlength="3">
  73. </div>
  74. <div class="input-group">
  75. <label for="reg-password">Password</label>
  76. <input type="password" id="reg-password" required minlength="6">
  77. </div>
  78. <div class="input-group">
  79. <label for="reg-confirm">Confirm Password</label>
  80. <input type="password" id="reg-confirm" required minlength="6">
  81. </div>
  82. <div id="reg-error" class="error-text"></div>
  83. <div id="reg-success" class="success-text"></div>
  84. <button type="submit" class="primary-btn" id="reg-submit-btn">Register</button>
  85. <p class="auth-toggle">Already have an account? <a href="#" id="show-login">Login here</a></p>
  86. </form>
  87. </div>
  88. <script src="/static/script.js"></script>
  89. </body>
  90. </html>