index.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. <!-- New Visual Food Search Component -->
  30. <div class="search-module" id="food-search-module">
  31. <div class="search-input-wrapper">
  32. <svg class="search-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
  33. <input type="text" id="food-search-input" placeholder="Search for standard foods or raw ingredients..." autocomplete="off">
  34. <button id="clear-search-btn" style="display: none;" title="Clear search">
  35. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
  36. </button>
  37. </div>
  38. <div class="search-results-dropdown" id="search-results-dropdown" style="display: none;">
  39. <!-- Dynamically populated by JS fetch -->
  40. </div>
  41. </div>
  42. <main class="chat-container" id="chat-container">
  43. <div class="message system">
  44. <div class="avatar">🤖</div>
  45. <div class="message-content">
  46. <p>Hello! I am LocalFoodAI, your completely local nutrition and menu assistant. How can I help you today?</p>
  47. </div>
  48. </div>
  49. </main>
  50. <footer class="chat-input-area">
  51. <form id="chat-form" class="input-form">
  52. <textarea id="user-input" placeholder="Ask about recipes, nutrition, menus..." rows="1" required></textarea>
  53. <button type="submit" id="send-btn" class="send-btn" aria-label="Send message">
  54. <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>
  55. </button>
  56. </form>
  57. <div class="footer-note">Powered by Llama 3.1 8B running locally on Ubuntu 24.04 via Ollama</div>
  58. </footer>
  59. </div>
  60. <!-- Authentication Gateway -->
  61. <div class="auth-container" id="auth-screen">
  62. <div class="auth-header">
  63. <div class="logo" style="margin-bottom: 10px;">🍳</div>
  64. <h2>Welcome to LocalFoodAI</h2>
  65. <p>Please log in or create an account to continue.</p>
  66. </div>
  67. <!-- Login Form -->
  68. <form id="login-form">
  69. <div class="input-group">
  70. <label for="login-username">Username</label>
  71. <input type="text" id="login-username" required>
  72. </div>
  73. <div class="input-group">
  74. <label for="login-password">Password</label>
  75. <input type="password" id="login-password" required>
  76. </div>
  77. <div id="login-error" class="error-text"></div>
  78. <button type="submit" class="primary-btn" id="login-submit-btn">Login</button>
  79. <p class="auth-toggle">Don't have an account? <a href="#" id="show-register">Register here</a></p>
  80. </form>
  81. <!-- Registration Form (Hidden by default) -->
  82. <form id="register-form" style="display: none;">
  83. <div class="input-group">
  84. <label for="reg-username">Username</label>
  85. <input type="text" id="reg-username" required minlength="3">
  86. </div>
  87. <div class="input-group">
  88. <label for="reg-password">Password</label>
  89. <input type="password" id="reg-password" required minlength="6">
  90. </div>
  91. <div class="input-group">
  92. <label for="reg-confirm">Confirm Password</label>
  93. <input type="password" id="reg-confirm" required minlength="6">
  94. </div>
  95. <div id="reg-error" class="error-text"></div>
  96. <div id="reg-success" class="success-text"></div>
  97. <button type="submit" class="primary-btn" id="reg-submit-btn">Register</button>
  98. <p class="auth-toggle">Already have an account? <a href="#" id="show-login">Login here</a></p>
  99. </form>
  100. </div>
  101. <script src="/static/script.js"></script>
  102. </body>
  103. </html>