Ab-Romia commited on
Commit
a2dba8d
·
verified ·
1 Parent(s): 3f7a921

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +183 -47
templates/index.html CHANGED
@@ -29,40 +29,139 @@
29
  }
30
  </script>
31
  <style>
32
- body { font-family: 'Inter', sans-serif; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
33
- .glass-effect { background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(12px); border: 1px solid rgba(148, 163, 184, 0.1); }
34
- .gradient-text { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  .typing-indicator { display: inline-flex; align-items: center; }
36
- .typing-dot { width: 6px; height: 6px; border-radius: 50%; background-color: #8b5cf6; animation: typing 1.4s infinite ease-in-out; margin-right: 4px; }
 
 
 
 
 
 
 
37
  .typing-dot:nth-child(1) { animation-delay: -0.32s; }
38
  .typing-dot:nth-child(2) { animation-delay: -0.16s; }
39
- @keyframes typing { 0%, 80%, 100% { transform: scale(0.8); opacity: 0.3; } 40% { transform: scale(1); opacity: 1; } }
40
- .scroll-container::-webkit-scrollbar { width: 6px; }
41
- .scroll-container::-webkit-scrollbar-track { background: transparent; }
42
- .scroll-container::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
43
- .markdown-content { word-wrap: break-word; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  .markdown-content p { margin-bottom: 0.75rem; }
45
  .markdown-content p:last-child { margin-bottom: 0; }
46
- .markdown-content pre { background-color: rgba(15, 23, 42, 0.5); padding: 0.75rem; border-radius: 0.375rem; overflow-x: auto; }
47
- .markdown-content code { font-family: monospace; background-color: rgba(15, 23, 42, 0.5); padding: 0.1rem 0.3rem; border-radius: 0.25rem; }
48
- .markdown-content pre code { padding: 0; background-color: transparent; }
49
- .markdown-content ul, .markdown-content ol { margin-left: 1.5rem; margin-bottom: 0.75rem; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  .markdown-content ul { list-style-type: disc; }
51
  .markdown-content ol { list-style-type: decimal; }
52
- .markdown-content table { border-collapse: collapse; width: 100%; margin-bottom: 0.75rem; }
53
- .markdown-content th, .markdown-content td { border: 1px solid rgba(148, 163, 184, 0.2); padding: 0.5rem; text-align: left; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  </style>
55
  </head>
56
- <body class="font-inter text-white overflow-hidden">
57
  <div class="fixed inset-0 -z-10">
58
  <div class="absolute -top-40 -right-40 w-80 h-80 bg-purple-500 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-pulse-slow"></div>
59
  <div class="absolute -bottom-40 -left-40 w-80 h-80 bg-blue-500 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-pulse-slow animation-delay-2000"></div>
60
  </div>
61
 
62
- <div class="relative z-10 flex items-center justify-center min-h-screen p-4">
63
- <div class="w-[98%] h-[95vh] glass-effect rounded-3xl shadow-2xl flex flex-col">
64
 
65
- <header class="flex items-center justify-between p-6 border-b border-slate-600/50">
66
  <div class="flex items-center space-x-4">
67
  <div class="w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center">
68
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>
@@ -81,26 +180,26 @@
81
  </header>
82
 
83
  <!-- API Key Configuration Section -->
84
- <div id="api-key-section" class="p-6 border-b border-slate-600/30 bg-slate-800/30">
85
- <div class="flex items-center justify-between mb-4">
86
  <div>
87
  <h3 class="text-lg font-semibold text-slate-200">🔑 API Configuration</h3>
88
  <p class="text-sm text-slate-400">Enter your OpenRouter API key to use the assistant</p>
89
  </div>
90
  <button id="toggle-api-section" class="text-slate-400 hover:text-slate-200 transition-colors">
91
- <svg id="toggle-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
92
  <path d="M6 9l6 6 6-6"/>
93
  </svg>
94
  </button>
95
  </div>
96
 
97
- <div id="api-key-content" class="space-y-4">
98
  <div class="flex space-x-3">
99
  <input
100
  type="password"
101
  id="api-key-input"
102
  placeholder="sk-or-your-openrouter-api-key-here"
103
- class="flex-1 bg-slate-900/50 border border-slate-600/50 rounded-lg p-3 text-slate-200 placeholder-slate-500 focus:ring-2 focus:ring-indigo-500 focus:outline-none transition"
104
  >
105
  <button id="test-api-key" class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
106
  Test Key
@@ -120,15 +219,27 @@
120
  </div>
121
  </div>
122
 
123
- <div class="flex-1 flex overflow-hidden">
124
- <div class="w-1/2 flex flex-col border-r border-slate-600/50">
125
- <div class="p-6 border-b border-slate-600/30">
 
 
126
  <h2 class="text-lg font-semibold text-slate-200">Knowledge Base</h2>
127
  <p class="text-sm text-slate-400 mt-1">Provide context for the AI to learn from.</p>
128
  </div>
129
- <div class="flex-1 p-6 flex flex-col">
130
- <textarea id="context-input" class="w-full h-full bg-slate-900/50 border border-slate-600/50 rounded-xl p-4 text-slate-200 placeholder-slate-500 focus:ring-2 focus:ring-indigo-500 focus:outline-none resize-none transition scroll-container" placeholder="Paste your documents, meeting notes, or any relevant context here..."></textarea>
131
- <div class="mt-4 flex items-center justify-between">
 
 
 
 
 
 
 
 
 
 
132
  <div class="text-xs text-slate-400">
133
  Chars: <span id="char-count">0</span> | Words: <span id="word-count">0</span>
134
  </div>
@@ -137,35 +248,60 @@
137
  <button id="index-context-btn" class="px-4 py-1.5 text-sm bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">Index Context</button>
138
  </div>
139
  </div>
140
- <div class="mt-4">
141
- <label for="task-select" class="block text-sm font-medium text-slate-300 mb-2">Choose an Action:</label>
142
- <select id="task-select" class="w-full bg-slate-900/50 border border-slate-600/50 rounded-lg p-2 text-slate-200 focus:ring-2 focus:ring-indigo-500">
143
- <option value="q_and_a">Question & Answer</option>
144
- <option value="summarize">Summarize</option>
145
- <option value="plan">Generate Action Plan</option>
146
- <option value="creative">Creative Writing</option>
147
- </select>
148
- </div>
 
 
149
  </div>
150
  </div>
151
 
152
- <div class="w-1/2 flex flex-col">
153
- <div class="p-6 border-b border-slate-600/30">
 
154
  <h2 class="text-lg font-semibold text-slate-200">AI Assistant</h2>
155
  <p class="text-sm text-slate-400 mt-1">Ask questions or select a task.</p>
156
  </div>
157
- <div id="chat-container" class="flex-1 overflow-y-auto scroll-container p-6 space-y-6">
158
- </div>
159
- <div class="p-6 border-t border-slate-600/30">
 
 
 
 
 
160
  <div class="relative">
161
- <textarea id="chat-input" rows="1" class="w-full bg-slate-900/50 border border-slate-600/50 rounded-xl p-3 pr-12 text-slate-200 placeholder-slate-500 focus:ring-2 focus:ring-indigo-500 focus:outline-none resize-none transition" placeholder="Ask a question or provide a prompt..." style="max-height: 120px;"></textarea>
 
 
 
 
 
 
162
  <button id="send-button" class="absolute right-2.5 bottom-2.5 p-2 bg-gradient-to-r from-indigo-500 to-purple-600 text-white rounded-lg hover:opacity-90 transition disabled:opacity-50 disabled:cursor-not-allowed">
163
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m22 2-7 20-4-9-9-4z"/><path d="M22 2 11 13"/></svg>
 
 
 
164
  </button>
165
  </div>
 
 
166
  <div class="flex items-center justify-between mt-3 text-xs text-slate-400 h-5">
167
- <div id="status-indicator" class="hidden">
 
 
 
 
168
  </div>
 
 
169
  </div>
170
  </div>
171
  </div>
 
29
  }
30
  </script>
31
  <style>
32
+ body {
33
+ font-family: 'Inter', sans-serif;
34
+ background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
35
+ overflow: hidden;
36
+ }
37
+ .glass-effect {
38
+ background: rgba(30, 41, 59, 0.7);
39
+ backdrop-filter: blur(12px);
40
+ border: 1px solid rgba(148, 163, 184, 0.1);
41
+ }
42
+ .gradient-text {
43
+ background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
44
+ -webkit-background-clip: text;
45
+ -webkit-text-fill-color: transparent;
46
+ background-clip: text;
47
+ }
48
  .typing-indicator { display: inline-flex; align-items: center; }
49
+ .typing-dot {
50
+ width: 6px;
51
+ height: 6px;
52
+ border-radius: 50%;
53
+ background-color: #8b5cf6;
54
+ animation: typing 1.4s infinite ease-in-out;
55
+ margin-right: 4px;
56
+ }
57
  .typing-dot:nth-child(1) { animation-delay: -0.32s; }
58
  .typing-dot:nth-child(2) { animation-delay: -0.16s; }
59
+ @keyframes typing {
60
+ 0%, 80%, 100% { transform: scale(0.8); opacity: 0.3; }
61
+ 40% { transform: scale(1); opacity: 1; }
62
+ }
63
+
64
+ /* Enhanced scrollbar styling */
65
+ .scroll-container {
66
+ scrollbar-width: thin;
67
+ scrollbar-color: #475569 transparent;
68
+ }
69
+ .scroll-container::-webkit-scrollbar {
70
+ width: 8px;
71
+ }
72
+ .scroll-container::-webkit-scrollbar-track {
73
+ background: rgba(15, 23, 42, 0.3);
74
+ border-radius: 4px;
75
+ }
76
+ .scroll-container::-webkit-scrollbar-thumb {
77
+ background: linear-gradient(180deg, #475569 0%, #64748b 100%);
78
+ border-radius: 4px;
79
+ border: 1px solid rgba(148, 163, 184, 0.1);
80
+ }
81
+ .scroll-container::-webkit-scrollbar-thumb:hover {
82
+ background: linear-gradient(180deg, #64748b 0%, #94a3b8 100%);
83
+ }
84
+
85
+ .markdown-content {
86
+ word-wrap: break-word;
87
+ line-height: 1.6;
88
+ }
89
  .markdown-content p { margin-bottom: 0.75rem; }
90
  .markdown-content p:last-child { margin-bottom: 0; }
91
+ .markdown-content pre {
92
+ background-color: rgba(15, 23, 42, 0.7);
93
+ padding: 0.75rem;
94
+ border-radius: 0.375rem;
95
+ overflow-x: auto;
96
+ border: 1px solid rgba(148, 163, 184, 0.1);
97
+ }
98
+ .markdown-content code {
99
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
100
+ background-color: rgba(15, 23, 42, 0.5);
101
+ padding: 0.1rem 0.3rem;
102
+ border-radius: 0.25rem;
103
+ font-size: 0.875em;
104
+ }
105
+ .markdown-content pre code {
106
+ padding: 0;
107
+ background-color: transparent;
108
+ }
109
+ .markdown-content ul, .markdown-content ol {
110
+ margin-left: 1.5rem;
111
+ margin-bottom: 0.75rem;
112
+ }
113
  .markdown-content ul { list-style-type: disc; }
114
  .markdown-content ol { list-style-type: decimal; }
115
+ .markdown-content table {
116
+ border-collapse: collapse;
117
+ width: 100%;
118
+ margin-bottom: 0.75rem;
119
+ }
120
+ .markdown-content th, .markdown-content td {
121
+ border: 1px solid rgba(148, 163, 184, 0.2);
122
+ padding: 0.5rem;
123
+ text-align: left;
124
+ }
125
+ .markdown-content blockquote {
126
+ border-left: 4px solid #6366f1;
127
+ padding-left: 1rem;
128
+ margin: 1rem 0;
129
+ color: #cbd5e1;
130
+ font-style: italic;
131
+ }
132
+ .markdown-content h1, .markdown-content h2, .markdown-content h3,
133
+ .markdown-content h4, .markdown-content h5, .markdown-content h6 {
134
+ margin-top: 1.5rem;
135
+ margin-bottom: 0.75rem;
136
+ font-weight: 600;
137
+ }
138
+ .markdown-content h1 { font-size: 1.5rem; }
139
+ .markdown-content h2 { font-size: 1.3rem; }
140
+ .markdown-content h3 { font-size: 1.1rem; }
141
+
142
+ /* Transition animations */
143
+ .api-section-transition {
144
+ transition: all 0.3s ease-in-out;
145
+ }
146
+
147
+ /* Better focus states */
148
+ .focus-ring:focus {
149
+ ring-width: 2px;
150
+ ring-color: rgb(99 102 241);
151
+ outline: none;
152
+ }
153
  </style>
154
  </head>
155
+ <body class="font-inter text-white h-screen overflow-hidden">
156
  <div class="fixed inset-0 -z-10">
157
  <div class="absolute -top-40 -right-40 w-80 h-80 bg-purple-500 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-pulse-slow"></div>
158
  <div class="absolute -bottom-40 -left-40 w-80 h-80 bg-blue-500 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-pulse-slow animation-delay-2000"></div>
159
  </div>
160
 
161
+ <div class="relative z-10 h-screen flex flex-col p-4">
162
+ <div class="flex-1 glass-effect rounded-3xl shadow-2xl flex flex-col overflow-hidden">
163
 
164
+ <header class="flex items-center justify-between p-6 border-b border-slate-600/50 flex-shrink-0">
165
  <div class="flex items-center space-x-4">
166
  <div class="w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center">
167
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>
 
180
  </header>
181
 
182
  <!-- API Key Configuration Section -->
183
+ <div id="api-key-section" class="border-b border-slate-600/30 bg-slate-800/30 flex-shrink-0 api-section-transition">
184
+ <div class="flex items-center justify-between p-4 cursor-pointer" id="api-section-header">
185
  <div>
186
  <h3 class="text-lg font-semibold text-slate-200">🔑 API Configuration</h3>
187
  <p class="text-sm text-slate-400">Enter your OpenRouter API key to use the assistant</p>
188
  </div>
189
  <button id="toggle-api-section" class="text-slate-400 hover:text-slate-200 transition-colors">
190
+ <svg id="toggle-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="transition-transform duration-300">
191
  <path d="M6 9l6 6 6-6"/>
192
  </svg>
193
  </button>
194
  </div>
195
 
196
+ <div id="api-key-content" class="px-4 pb-4 space-y-4">
197
  <div class="flex space-x-3">
198
  <input
199
  type="password"
200
  id="api-key-input"
201
  placeholder="sk-or-your-openrouter-api-key-here"
202
+ class="flex-1 bg-slate-900/50 border border-slate-600/50 rounded-lg p-3 text-slate-200 placeholder-slate-500 focus-ring transition"
203
  >
204
  <button id="test-api-key" class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
205
  Test Key
 
219
  </div>
220
  </div>
221
 
222
+ <!-- Main Content Area -->
223
+ <div class="flex-1 flex overflow-hidden min-h-0">
224
+ <!-- Left Panel - Knowledge Base -->
225
+ <div class="w-1/2 flex flex-col border-r border-slate-600/50 min-h-0">
226
+ <div class="p-4 border-b border-slate-600/30 flex-shrink-0">
227
  <h2 class="text-lg font-semibold text-slate-200">Knowledge Base</h2>
228
  <p class="text-sm text-slate-400 mt-1">Provide context for the AI to learn from.</p>
229
  </div>
230
+
231
+ <!-- Context Input Area -->
232
+ <div class="flex-1 p-4 flex flex-col min-h-0">
233
+ <div class="flex-1 mb-4 min-h-0">
234
+ <textarea
235
+ id="context-input"
236
+ class="w-full h-full bg-slate-900/50 border border-slate-600/50 rounded-xl p-4 text-slate-200 placeholder-slate-500 focus-ring resize-none transition scroll-container"
237
+ placeholder="Paste your documents, meeting notes, or any relevant context here..."
238
+ ></textarea>
239
+ </div>
240
+
241
+ <!-- Context Stats and Controls -->
242
+ <div class="flex items-center justify-between mb-4 flex-shrink-0">
243
  <div class="text-xs text-slate-400">
244
  Chars: <span id="char-count">0</span> | Words: <span id="word-count">0</span>
245
  </div>
 
248
  <button id="index-context-btn" class="px-4 py-1.5 text-sm bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed">Index Context</button>
249
  </div>
250
  </div>
251
+
252
+ <!-- Task Selection -->
253
+ <div class="flex-shrink-0">
254
+ <label for="task-select" class="block text-sm font-medium text-slate-300 mb-2">Choose an Action:</label>
255
+ <select id="task-select" class="w-full bg-slate-900/50 border border-slate-600/50 rounded-lg p-2 text-slate-200 focus-ring">
256
+ <option value="q_and_a">Question & Answer</option>
257
+ <option value="summarize">Summarize</option>
258
+ <option value="plan">Generate Action Plan</option>
259
+ <option value="creative">Creative Writing</option>
260
+ </select>
261
+ </div>
262
  </div>
263
  </div>
264
 
265
+ <!-- Right Panel - AI Assistant -->
266
+ <div class="w-1/2 flex flex-col min-h-0">
267
+ <div class="p-4 border-b border-slate-600/30 flex-shrink-0">
268
  <h2 class="text-lg font-semibold text-slate-200">AI Assistant</h2>
269
  <p class="text-sm text-slate-400 mt-1">Ask questions or select a task.</p>
270
  </div>
271
+
272
+ <!-- Chat Messages Container -->
273
+ <div id="chat-container" class="flex-1 overflow-y-auto scroll-container p-4 space-y-4 min-h-0">
274
+ <!-- Messages will be dynamically added here -->
275
+ </div>
276
+
277
+ <!-- Chat Input Area -->
278
+ <div class="p-4 border-t border-slate-600/30 flex-shrink-0">
279
  <div class="relative">
280
+ <textarea
281
+ id="chat-input"
282
+ rows="1"
283
+ class="w-full bg-slate-900/50 border border-slate-600/50 rounded-xl p-3 pr-12 text-slate-200 placeholder-slate-500 focus-ring resize-none transition"
284
+ placeholder="Ask a question or provide a prompt..."
285
+ style="max-height: 120px; min-height: 44px;"
286
+ ></textarea>
287
  <button id="send-button" class="absolute right-2.5 bottom-2.5 p-2 bg-gradient-to-r from-indigo-500 to-purple-600 text-white rounded-lg hover:opacity-90 transition disabled:opacity-50 disabled:cursor-not-allowed">
288
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
289
+ <path d="m22 2-7 20-4-9-9-4"/>
290
+ <path d="M22 2 11 13"/>
291
+ </svg>
292
  </button>
293
  </div>
294
+
295
+ <!-- Status Indicator -->
296
  <div class="flex items-center justify-between mt-3 text-xs text-slate-400 h-5">
297
+ <div id="status-indicator" class="hidden flex items-center space-x-2">
298
+ <div class="typing-indicator hidden" id="typing-indicator">
299
+ <div class="typing-dot"></div>
300
+ <div class="typing-dot"></div>
301
+ <div class="typing-dot"></div>
302
  </div>
303
+ <span id="status-text"></span>
304
+ </div>
305
  </div>
306
  </div>
307
  </div>