asd1asd1 commited on
Commit
6777b26
·
verified ·
1 Parent(s): 0bbae40

es muy basica debe ser mas potente trata de igual y mejorar a grok

Browse files
Files changed (5) hide show
  1. components/navbar.js +6 -2
  2. index.html +70 -282
  3. script.js +180 -10
  4. style.css +65 -5
  5. templates.html +129 -0
components/navbar.js CHANGED
@@ -60,9 +60,13 @@ class CustomNavbar extends HTMLElement {
60
  <ul>
61
  <li><a href="/">Home</a></li>
62
  <li><a href="/research.html">Research</a></li>
63
- <li><a href="/settings.html">Settings</a></li>
 
 
 
 
64
  </ul>
65
- </nav>
66
  `;
67
  }
68
  }
 
60
  <ul>
61
  <li><a href="/">Home</a></li>
62
  <li><a href="/research.html">Research</a></li>
63
+ <li><a href="/templates.html">Templates</a></li>
64
+ <li><a href="/settings.html">
65
+ <i data-feather="settings" class="w-4 h-4 mr-1 inline"></i>
66
+ Settings
67
+ </a></li>
68
  </ul>
69
+ </nav>
70
  `;
71
  }
72
  }
index.html CHANGED
@@ -1,131 +1,79 @@
1
-
2
  <!DOCTYPE html>
3
  <html lang="en">
4
  <head>
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>DeepChat Explorer - Advanced AI Research Assistant</title>
8
  <link rel="stylesheet" href="style.css">
9
  <script src="https://cdn.tailwindcss.com"></script>
10
  <script src="https://unpkg.com/feather-icons"></script>
11
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
12
  </head>
13
- <body class="bg-gradient-to-br from-gray-900 via-purple-900 to-gray-900 min-h-screen">
14
  <custom-navbar></custom-navbar>
15
-
16
  <div class="container mx-auto px-4 py-8">
17
- <!-- Advanced Chat Interface -->
18
- <div class="max-w-6xl mx-auto bg-gray-800/50 backdrop-blur-lg rounded-2xl shadow-2xl overflow-hidden border border-gray-700">
19
- <!-- Enhanced Chat Header -->
20
- <div class="bg-gradient-to-r from-purple-600 via-blue-600 to-indigo-600 px-6 py-4 flex items-center justify-between">
21
  <div class="flex items-center">
22
- <i data-feather="zap" class="text-white mr-3 w-6 h-6"></i>
23
- <h1 class="text-2xl font-bold text-white">DeepChat Explorer Pro</h1>
24
  </div>
25
- <div class="flex items-center space-x-4">
26
- <div class="flex items-center text-sm text-white/80">
27
- <div class="w-2 h-2 bg-green-400 rounded-full mr-2 animate-pulse"></div>
28
- <span>Online</span>
29
- </div>
30
- <div class="flex space-x-2">
31
- <button class="p-2 rounded-lg bg-white/10 hover:bg-white/20 transition-all">
32
- <i data-feather="settings" class="w-4 h-4 text-white"></i>
33
- </button>
34
- <button class="p-2 rounded-lg bg-white/10 hover:bg-white/20 transition-all">
35
- <i data-feather="maximize" class="w-4 h-4 text-white"></i>
36
- </button>
37
- </div>
38
  </div>
39
  </div>
40
 
41
- <!-- Advanced Chat Container -->
42
- <div class="h-[500px] overflow-y-auto p-6 bg-gradient-to-b from-gray-900/80 to-gray-800/80" id="chat-container">
43
- <!-- Welcome Message -->
44
- <div class="text-center py-8">
45
- <div class="inline-flex items-center justify-center w-16 h-16 bg-gradient-to-r from-purple-500 to-blue-500 rounded-full mb-4">
46
- <i data-feather="brain" class="w-8 h-8 text-white"></i>
47
- </div>
48
- <h2 class="text-2xl font-bold text-white mb-2">Welcome to DeepChat Explorer Pro</h2>
49
- <p class="text-gray-300">I'm your advanced AI research assistant. I can help you with:</p>
50
- <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mt-6 max-w-2xl mx-auto">
51
- <div class="bg-gray-700/50 p-4 rounded-lg border border-gray-600">
52
- <i data-feather="search" class="w-6 h-6 text-blue-400 mb-2"></i>
53
- <h3 class="font-semibold text-white">Deep Research</h3>
54
- <p class="text-sm text-gray-300">Multi-source analysis with citations</p>
55
- </div>
56
- <div class="bg-gray-700/50 p-4 rounded-lg border border-gray-600">
57
- <i data-feather="trending-up" class="w-6 h-6 text-green-400 mb-2"></i>
58
- <h3 class="font-semibold text-white">Real-time Data</h3>
59
- <p class="text-sm text-gray-300">Latest information and trends</p>
60
- </div>
61
- <div class="bg-gray-700/50 p-4 rounded-lg border border-gray-600">
62
- <i data-feather="code" class="w-6 h-6 text-purple-400 mb-2"></i>
63
- <h3 class="font-semibold text-white">Code Generation</h3>
64
- <p class="text-sm text-gray-300">Programming assistance</p>
65
- </div>
66
- </div>
67
  </div>
68
  </div>
69
 
70
- <!-- Enhanced Input Area -->
71
- <div class="border-t border-gray-700 p-6 bg-gray-800/80">
72
- <div class="flex flex-col space-y-4">
73
- <!-- Quick Actions -->
74
- <div class="flex flex-wrap gap-2 justify-center">
75
- <button class="quick-action-btn" data-action="research">
76
- <i data-feather="search" class="w-4 h-4"></i>
77
- Research Topic
78
- </button>
79
- <button class="quick-action-btn" data-action="summarize">
80
- <i data-feather="file-text" class="w-4 h-4"></i>
81
- Summarize
82
- </button>
83
- <button class="quick-action-btn" data-action="code">
84
- <i data-feather="code" class="w-4 h-4"></i>
85
- Write Code
86
- </button>
87
- <button class="quick-action-btn" data-action="analyze">
88
- <i data-feather="bar-chart" class="w-4 h-4"></i>
89
- Analyze Data
90
- </button>
91
- </div>
92
-
93
- <!-- Advanced Input Form -->
94
- <form id="chat-form" class="flex gap-3">
95
- <div class="flex-1 relative">
96
- <input
97
- type="text"
98
- id="message-input"
99
- placeholder="Ask me anything... I can research, code, analyze, and more!"
100
- class="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-white placeholder-gray-400 pr-12"
101
- autocomplete="off"
102
- >
103
- <button type="button" class="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-white">
104
- <i data-feather="mic" class="w-5 h-5"></i>
105
- </button>
106
- </div>
107
- <button
108
- type="submit"
109
- class="px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white rounded-xl hover:from-blue-700 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-800 transition-all duration-200 flex items-center space-x-2"
110
  >
111
- <i data-feather="send" class="w-4 h-4"></i>
112
- <span>Send</span>
113
  </button>
114
- </form>
115
-
116
- <!-- Model Status -->
117
- <div class="text-center text-sm text-gray-400">
118
- <div class="inline-flex items-center space-x-2 bg-gray-900/50 px-3 py-1 rounded-full">
119
- <div class="w-2 h-2 bg-green-400 rounded-full animate-pulse"></div>
120
- <span>DeepChat Pro v2.0 • Real-time Processing • Multi-modal Support</span>
121
- </div>
122
  </div>
123
- </div>
 
 
 
 
 
 
124
  </div>
125
  </div>
126
  </div>
127
-
128
- <custom-footer></custom-footer>
129
 
130
  <script src="components/navbar.js"></script>
131
  <script src="components/footer.js"></script>
@@ -133,199 +81,39 @@
133
  <script>
134
  feather.replace();
135
 
136
- // Enhanced Chat Functionality
137
- const chatForm = document.getElementById('chat-form');
138
- const messageInput = document.getElementById('message-input');
139
- const chatContainer = document.getElementById('chat-container');
140
-
141
- // Quick action buttons
142
- document.querySelectorAll('.quick-action-btn').forEach(btn => {
143
- btn.addEventListener('click', function() {
144
- const action = this.getAttribute('data-action');
145
- const prompts = {
146
- research: "Research the latest developments in artificial intelligence and provide a comprehensive analysis with sources.",
147
- summarize: "Please summarize the key points from this research paper or article.",
148
- code: "Write a Python function to analyze and visualize data trends.",
149
- analyze: "Analyze the current market trends and provide insights with data visualization."
150
- };
151
- messageInput.value = prompts[action];
152
- messageInput.focus();
153
- });
154
- });
155
-
156
- chatForm.addEventListener('submit', function(e) {
157
  e.preventDefault();
158
- const message = messageInput.value.trim();
 
159
 
160
  if (message) {
161
  addMessage(message, 'user');
162
- messageInput.value = '';
163
-
164
- // Show typing indicator
165
- showTypingIndicator();
166
 
167
- // Simulate advanced AI response with multiple message types
168
  setTimeout(() => {
169
- removeTypingIndicator();
170
-
171
- // Advanced response with multiple message types
172
- const responses = generateAdvancedResponse(message);
173
- responses.forEach((response, index) => {
174
- setTimeout(() => {
175
- addMessage(response.text, 'ai', response.type);
176
- }, index * 800);
177
- });
178
- }, 2000);
179
  }
180
  });
181
 
182
- function showTypingIndicator() {
183
- const typingDiv = document.createElement('div');
184
- typingDiv.className = 'mb-4 flex justify-start';
185
- typingDiv.id = 'typing-indicator';
186
- typingDiv.innerHTML = `
187
- <div class="bg-gray-700 rounded-lg py-3 px-4 max-w-xs">
188
- <div class="flex space-x-1">
189
- <div class="w-2 h-2 bg-gray-400 rounded-full animate-bounce"></div>
190
- <div class="w-2 h-2 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.1s"></div>
191
- <div class="w-2 h-2 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.2s"></div>
192
- </div>
193
- </div>
194
- `;
195
- chatContainer.appendChild(typingDiv);
196
- chatContainer.scrollTop = chatContainer.scrollHeight;
197
- }
198
-
199
- function removeTypingIndicator() {
200
- const indicator = document.getElementById('typing-indicator');
201
- if (indicator) indicator.remove();
202
- }
203
-
204
- function addMessage(text, sender, type = 'text') {
205
  const messageDiv = document.createElement('div');
206
- messageDiv.className = `mb-4 flex ${sender === 'user' ? 'justify-end' : 'justify-start'} animate-fade-in`;
207
-
208
- let messageContent = '';
209
-
210
- if (sender === 'user') {
211
- messageContent = `
212
- <div class="bg-gradient-to-r from-blue-600 to-purple-600 text-white rounded-2xl py-3 px-4 max-w-lg shadow-lg">
213
- <p class="text-sm">${text}</p>
214
- </div>
215
- `;
216
- } else {
217
- switch(type) {
218
- case 'code':
219
- messageContent = `
220
- <div class="bg-gray-900 border border-gray-700 rounded-2xl p-4 max-w-2xl shadow-lg">
221
- <div class="flex items-center justify-between mb-2">
222
- <div class="flex items-center space-x-2">
223
- <i data-feather="code" class="w-4 h-4 text-green-400"></i>
224
- <span class="text-sm font-medium text-green-400">CODE GENERATED</span>
225
- </div>
226
- <button class="text-gray-400 hover:text-white">
227
- <i data-feather="copy" class="w-4 h-4"></i>
228
- </button>
229
- </div>
230
- <pre class="text-sm text-gray-200 overflow-x-auto"><code>${text}</code></pre>
231
- </div>
232
- `;
233
- break;
234
- case 'analysis':
235
- messageContent = `
236
- <div class="bg-gray-900 border border-gray-700 rounded-2xl p-4 max-w-2xl shadow-lg">
237
- <div class="flex items-center space-x-2 mb-2">
238
- <i data-feather="bar-chart" class="w-4 h-4 text-blue-400"></i>
239
- <span class="text-sm font-medium text-blue-400">DATA ANALYSIS</span>
240
- </div>
241
- <div class="text-sm text-gray-200">${text}</div>
242
- <div class="mt-3 p-3 bg-gray-800 rounded-lg">
243
- <div class="flex justify-between text-xs text-gray-400">
244
- <span>Confidence: 92%</span>
245
- <span>Sources: 5 verified</span>
246
- </div>
247
- </div>
248
- </div>
249
- `;
250
- break;
251
- default:
252
- messageContent = `
253
- <div class="bg-gray-700 rounded-2xl py-3 px-4 max-w-2xl shadow-lg">
254
- <p class="text-sm text-gray-100">${text}</p>
255
- <div class="mt-2 flex items-center space-x-4 text-xs text-gray-400">
256
- <span>✓ Verified Sources</span>
257
- <span>•</span>
258
- <span>Real-time Data</span>
259
- </div>
260
- </div>
261
- `;
262
- }
263
- }
264
-
265
- messageDiv.innerHTML = messageContent;
266
- chatContainer.appendChild(messageDiv);
267
- chatContainer.scrollTop = chatContainer.scrollHeight;
268
 
269
- // Re-initialize feather icons for new content
270
- feather.replace();
271
- }
272
-
273
- function generateAdvancedResponse(userMessage) {
274
- const lowerMessage = userMessage.toLowerCase();
275
- const responses = [];
276
-
277
- // Research-related responses
278
- if (lowerMessage.includes('research') || lowerMessage.includes('analyze') || lowerMessage.includes('study')) {
279
- responses.push({
280
- text: "🔍 I'm conducting a comprehensive research analysis on your topic...",
281
- type: 'text'
282
- });
283
- responses.push({
284
- text: "📊 I've gathered data from 12+ sources including academic papers, news articles, and real-time databases.",
285
- type: 'text'
286
- });
287
- responses.push({
288
- text: "**Key Findings:**\n• Recent studies show significant advancements\n• Market trends indicate 35% growth potential\n• Emerging technologies are disrupting traditional approaches\n\n**Sources Verified:**\n✓ IEEE Research Papers\n✓ Google Scholar\n✓ Industry Reports",
289
- type: 'analysis'
290
- });
291
- }
292
- // Code-related responses
293
- else if (lowerMessage.includes('code') || lowerMessage.includes('program') || lowerMessage.includes('function')) {
294
- responses.push({
295
- text: "```python\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef analyze_trends(data):\n \"\"\"Advanced data analysis function\"\"\"\n df = pd.DataFrame(data)\n trends = df.rolling(window=7).mean()\n \n plt.figure(figsize=(12, 6))\n plt.plot(df.index, df.values, alpha=0.5, label='Original')\n plt.plot(trends.index, trends.values, label='7-day Trend', linewidth=2)\n plt.legend()\n plt.title('Advanced Trend Analysis')\n plt.show()\n \n return trends\n```",
296
- type: 'code'
297
- });
298
- responses.push({
299
- text: "This Python function provides real-time trend analysis with visualization. Would you like me to explain any specific part or modify it for your use case?",
300
- type: 'text'
301
- });
302
- }
303
- // Default advanced response
304
- else {
305
- responses.push({
306
- text: "🤖 I understand you're asking about: " + userMessage,
307
- type: 'text'
308
- });
309
- responses.push({
310
- text: "I'm processing this through multiple AI models to provide you with the most accurate and up-to-date information.",
311
- type: 'text'
312
- });
313
- responses.push({
314
- text: "**Comprehensive Analysis Complete:**\n• Cross-referenced with current databases\n• Verified against multiple sources\n• Real-time data integration applied\n• Confidence level: 94%",
315
- type: 'analysis'
316
- });
317
- responses.push({
318
- text: "Would you like me to dive deeper into any specific aspect or provide additional resources?",
319
- type: 'text'
320
- });
321
- }
322
 
323
- return responses;
 
324
  }
325
-
326
- // Auto-focus input
327
- messageInput.focus();
328
  </script>
329
  <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
330
  </body>
331
- </html>
 
 
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>DeepChat Explorer</title>
7
  <link rel="stylesheet" href="style.css">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script src="https://unpkg.com/feather-icons"></script>
10
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
  </head>
12
+ <body class="bg-gray-100">
13
  <custom-navbar></custom-navbar>
 
14
  <div class="container mx-auto px-4 py-8">
15
+ <div class="max-w-4xl mx-auto bg-white rounded-xl shadow-md overflow-hidden">
16
+ <!-- Chat header with model selector -->
17
+ <div class="bg-indigo-600 px-6 py-4 flex items-center justify-between">
 
18
  <div class="flex items-center">
19
+ <i data-feather="message-square" class="text-white mr-2"></i>
20
+ <h1 class="text-xl font-bold text-white">DeepChat Explorer</h1>
21
  </div>
22
+ <div class="relative">
23
+ <select id="model-selector" class="bg-indigo-700 text-white rounded-lg px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-white">
24
+ <option value="grok-1">Grok-1 (Default)</option>
25
+ <option value="llama-3">Llama-3</option>
26
+ <option value="mixtral">Mixtral</option>
27
+ <option value="gpt-4">GPT-4</option>
28
+ </select>
 
 
 
 
 
 
29
  </div>
30
  </div>
31
 
32
+ <!-- Chat container with typing indicator -->
33
+ <div class="h-[32rem] overflow-y-auto p-4" id="chat-container">
34
+ <div class="text-center text-gray-500 py-10">
35
+ <i data-feather="send" class="w-12 h-12 mx-auto mb-4"></i>
36
+ <p>Start chatting with your AI research assistant</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  </div>
38
  </div>
39
 
40
+ <!-- Enhanced input area with features -->
41
+ <div class="border-t border-gray-200 p-4 bg-gray-50">
42
+ <div class="flex mb-2 gap-2">
43
+ <button class="px-3 py-1 text-xs bg-indigo-100 text-indigo-700 rounded-full hover:bg-indigo-200">
44
+ <i data-feather="search" class="w-3 h-3 mr-1 inline"></i> Web Search
45
+ </button>
46
+ <button class="px-3 py-1 text-xs bg-indigo-100 text-indigo-700 rounded-full hover:bg-indigo-200">
47
+ <i data-feather="file-text" class="w-3 h-3 mr-1 inline"></i> Document
48
+ </button>
49
+ <button class="px-3 py-1 text-xs bg-indigo-100 text-indigo-700 rounded-full hover:bg-indigo-200">
50
+ <i data-feather="code" class="w-3 h-3 mr-1 inline"></i> Code
51
+ </button>
52
+ </div>
53
+ <form id="chat-form" class="flex gap-2">
54
+ <div class="flex-1 relative">
55
+ <input
56
+ type="text"
57
+ id="message-input"
58
+ placeholder="Ask something to research..."
59
+ class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 pr-10"
60
+ autocomplete="off"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  >
62
+ <button type="button" class="absolute right-2 top-2.5 text-gray-400 hover:text-indigo-600">
63
+ <i data-feather="mic" class="w-5 h-5"></i>
64
  </button>
 
 
 
 
 
 
 
 
65
  </div>
66
+ <button
67
+ type="submit"
68
+ class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 flex items-center"
69
+ >
70
+ <i data-feather="send" class="inline mr-1"></i> Send
71
+ </button>
72
+ </form>
73
  </div>
74
  </div>
75
  </div>
76
+ <custom-footer></custom-footer>
 
77
 
78
  <script src="components/navbar.js"></script>
79
  <script src="components/footer.js"></script>
 
81
  <script>
82
  feather.replace();
83
 
84
+ // Chat functionality
85
+ document.getElementById('chat-form').addEventListener('submit', function(e) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  e.preventDefault();
87
+ const input = document.getElementById('message-input');
88
+ const message = input.value.trim();
89
 
90
  if (message) {
91
  addMessage(message, 'user');
92
+ input.value = '';
 
 
 
93
 
94
+ // Simulate AI response (in a real app, this would call your backend)
95
  setTimeout(() => {
96
+ addMessage("I'm researching: " + message, 'ai');
97
+ addMessage("Found 3 relevant sources about this topic. Would you like me to summarize them?", 'ai');
98
+ }, 1000);
 
 
 
 
 
 
 
99
  }
100
  });
101
 
102
+ function addMessage(text, sender) {
103
+ const container = document.getElementById('chat-container');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  const messageDiv = document.createElement('div');
105
+ messageDiv.className = `mb-4 flex ${sender === 'user' ? 'justify-end' : 'justify-start'}`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
+ messageDiv.innerHTML = `
108
+ <div class="${sender === 'user' ? 'bg-indigo-100' : 'bg-gray-200'} rounded-lg py-2 px-4 max-w-xs md:max-w-md">
109
+ <p>${text}</p>
110
+ </div>
111
+ `;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
+ container.appendChild(messageDiv);
114
+ container.scrollTop = container.scrollHeight;
115
  }
 
 
 
116
  </script>
117
  <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
118
  </body>
119
+ </html>
script.js CHANGED
@@ -1,10 +1,180 @@
1
- // Shared JavaScript across all pages
2
- console.log('DeepChat Explorer loaded');
3
-
4
- // Initialize tooltips for icons
5
- document.addEventListener('DOMContentLoaded', function() {
6
- const icons = document.querySelectorAll('[data-feather]');
7
- icons.forEach(icon => {
8
- icon.setAttribute('title', icon.getAttribute('data-feather'));
9
- });
10
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ // Enhanced JavaScript with Grok-like features
3
+ console.log('DeepChat Explorer Pro loaded');
4
+
5
+ class DeepChat {
6
+ constructor() {
7
+ this.currentModel = 'grok-1';
8
+ this.conversationId = this.generateId();
9
+ this.isTyping = false;
10
+ this.init();
11
+ }
12
+
13
+ init() {
14
+ document.addEventListener('DOMContentLoaded', () => {
15
+ this.setupUI();
16
+ this.setupEventListeners();
17
+ });
18
+ }
19
+
20
+ setupUI() {
21
+ // Initialize tooltips for icons
22
+ const icons = document.querySelectorAll('[data-feather]');
23
+ icons.forEach(icon => {
24
+ icon.setAttribute('title', icon.getAttribute('data-feather'));
25
+ });
26
+
27
+ // Initialize model selector
28
+ const modelSelector = document.getElementById('model-selector');
29
+ if (modelSelector) {
30
+ modelSelector.addEventListener('change', (e) => {
31
+ this.currentModel = e.target.value;
32
+ this.addSystemMessage(`Model changed to ${e.target.options[e.target.selectedIndex].text}`);
33
+ });
34
+ }
35
+ }
36
+
37
+ setupEventListeners() {
38
+ const chatForm = document.getElementById('chat-form');
39
+ if (chatForm) {
40
+ chatForm.addEventListener('submit', (e) => {
41
+ e.preventDefault();
42
+ this.handleUserMessage();
43
+ });
44
+ }
45
+ }
46
+
47
+ handleUserMessage() {
48
+ const input = document.getElementById('message-input');
49
+ const message = input.value.trim();
50
+
51
+ if (message) {
52
+ this.addMessage(message, 'user');
53
+ input.value = '';
54
+
55
+ this.showTypingIndicator();
56
+
57
+ // Simulate API call with different model behaviors
58
+ setTimeout(() => {
59
+ this.hideTypingIndicator();
60
+ this.generateAIResponse(message);
61
+ }, 1000 + Math.random() * 2000);
62
+ }
63
+ }
64
+
65
+ generateAIResponse(userMessage) {
66
+ const responses = {
67
+ 'grok-1': [
68
+ `I've analyzed your query about "${userMessage}" with Grok-1's real-time knowledge.`,
69
+ `Here are the key insights from 5 authoritative sources:`,
70
+ `1. Recent research shows...`,
71
+ `2. Industry trends indicate...`,
72
+ `Would you like me to dive deeper into any specific aspect?`
73
+ ],
74
+ 'llama-3': [
75
+ `Based on Llama-3's comprehensive training data about "${userMessage}":`,
76
+ `- First important point...`,
77
+ `- Second key finding...`,
78
+ `- Additional context...`,
79
+ `I can provide references if needed.`
80
+ ],
81
+ 'mixtral': [
82
+ `Mixtral's analysis of "${userMessage}" reveals:`,
83
+ `• Perspective 1 (Technical)...`,
84
+ `• Perspective 2 (Business)...`,
85
+ `• Perspective 3 (Ethical)...`,
86
+ `Which perspective would you like to explore further?`
87
+ ],
88
+ 'gpt-4': [
89
+ `GPT-4's detailed response to "${userMessage}":`,
90
+ `1. Comprehensive overview...`,
91
+ `2. Critical analysis...`,
92
+ `3. Future implications...`,
93
+ `4. Recommended actions...`,
94
+ `Would you like me to format this as a report?`
95
+ ]
96
+ };
97
+
98
+ const modelResponses = responses[this.currentModel] || responses['grok-1'];
99
+ modelResponses.forEach((line, index) => {
100
+ setTimeout(() => {
101
+ this.addMessage(line, 'ai');
102
+ }, 300 * index);
103
+ });
104
+ }
105
+
106
+ showTypingIndicator() {
107
+ if (this.isTyping) return;
108
+
109
+ this.isTyping = true;
110
+ const container = document.getElementById('chat-container');
111
+ const typingDiv = document.createElement('div');
112
+ typingDiv.id = 'typing-indicator';
113
+ typingDiv.className = 'mb-4 flex justify-start';
114
+ typingDiv.innerHTML = `
115
+ <div class="bg-gray-200 rounded-lg py-2 px-4 max-w-xs">
116
+ <div class="flex space-x-1">
117
+ <div class="w-2 h-2 bg-gray-400 rounded-full animate-bounce"></div>
118
+ <div class="w-2 h-2 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.2s"></div>
119
+ <div class="w-2 h-2 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.4s"></div>
120
+ </div>
121
+ </div>
122
+ `;
123
+ container.appendChild(typingDiv);
124
+ container.scrollTop = container.scrollHeight;
125
+ }
126
+
127
+ hideTypingIndicator() {
128
+ this.isTyping = false;
129
+ const indicator = document.getElementById('typing-indicator');
130
+ if (indicator) indicator.remove();
131
+ }
132
+
133
+ addMessage(text, sender) {
134
+ const container = document.getElementById('chat-container');
135
+
136
+ // Remove initial empty state if present
137
+ if (container.children.length === 1 && container.children[0].classList.contains('text-center')) {
138
+ container.innerHTML = '';
139
+ }
140
+
141
+ // Remove typing indicator if present
142
+ if (this.isTyping) {
143
+ this.hideTypingIndicator();
144
+ }
145
+
146
+ const messageDiv = document.createElement('div');
147
+ messageDiv.className = `mb-4 flex ${sender === 'user' ? 'justify-end' : 'justify-start'}`;
148
+
149
+ messageDiv.innerHTML = `
150
+ <div class="${sender === 'user' ? 'bg-indigo-100' : 'bg-gray-200'} rounded-lg py-2 px-4 max-w-xs md:max-w-md">
151
+ ${sender === 'ai' ? `<div class="text-xs text-gray-500 mb-1">${this.currentModel.toUpperCase()}</div>` : ''}
152
+ <p class="${sender === 'ai' ? 'text-gray-800' : ''}">${text}</p>
153
+ <div class="text-xs text-gray-500 mt-1 text-right">${new Date().toLocaleTimeString()}</div>
154
+ </div>
155
+ `;
156
+
157
+ container.appendChild(messageDiv);
158
+ container.scrollTop = container.scrollHeight;
159
+ }
160
+
161
+ addSystemMessage(text) {
162
+ const container = document.getElementById('chat-container');
163
+ const messageDiv = document.createElement('div');
164
+ messageDiv.className = 'mb-4 flex justify-center';
165
+ messageDiv.innerHTML = `
166
+ <div class="bg-yellow-100 text-yellow-800 text-xs px-3 py-1 rounded-full">
167
+ ${text}
168
+ </div>
169
+ `;
170
+ container.appendChild(messageDiv);
171
+ container.scrollTop = container.scrollHeight;
172
+ }
173
+
174
+ generateId() {
175
+ return 'conv-' + Math.random().toString(36).substr(2, 9);
176
+ }
177
+ }
178
+
179
+ // Initialize the chat system
180
+ new DeepChat();
style.css CHANGED
@@ -1,12 +1,19 @@
1
- /* Shared styles across all pages */
 
2
  body {
3
- font-family: 'Inter', sans-serif;
4
  min-height: 100vh;
5
  display: flex;
6
  flex-direction: column;
 
 
 
 
 
 
 
7
  }
8
 
9
- /* Chat container scrollbar */
10
  #chat-container::-webkit-scrollbar {
11
  width: 8px;
12
  }
@@ -25,12 +32,65 @@ body {
25
  background: #a5b4fc;
26
  }
27
 
28
- /* Animation for messages */
29
  @keyframes fadeIn {
30
  from { opacity: 0; transform: translateY(10px); }
31
  to { opacity: 1; transform: translateY(0); }
32
  }
33
 
 
 
 
 
 
34
  #chat-container div {
35
  animation: fadeIn 0.3s ease-out;
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Enhanced styles for Grok-like interface */
3
  body {
4
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
5
  min-height: 100vh;
6
  display: flex;
7
  flex-direction: column;
8
+ background-color: #f8fafc;
9
+ }
10
+
11
+ /* Chat container improvements */
12
+ #chat-container {
13
+ scroll-behavior: smooth;
14
+ background-color: #f9fafb;
15
  }
16
 
 
17
  #chat-container::-webkit-scrollbar {
18
  width: 8px;
19
  }
 
32
  background: #a5b4fc;
33
  }
34
 
35
+ /* Message animations and styles */
36
  @keyframes fadeIn {
37
  from { opacity: 0; transform: translateY(10px); }
38
  to { opacity: 1; transform: translateY(0); }
39
  }
40
 
41
+ @keyframes pulse {
42
+ 0%, 100% { opacity: 1; }
43
+ 50% { opacity: 0.5; }
44
+ }
45
+
46
  #chat-container div {
47
  animation: fadeIn 0.3s ease-out;
48
+ }
49
+
50
+ /* Typing indicator animation */
51
+ .animate-bounce {
52
+ animation: bounce 1.5s infinite;
53
+ }
54
+
55
+ @keyframes bounce {
56
+ 0%, 100% { transform: translateY(0); }
57
+ 50% { transform: translateY(-5px); }
58
+ }
59
+
60
+ /* Model selector styles */
61
+ #model-selector {
62
+ appearance: none;
63
+ background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
64
+ background-repeat: no-repeat;
65
+ background-position: right 0.5rem center;
66
+ background-size: 1rem;
67
+ padding-right: 1.5rem;
68
+ }
69
+
70
+ /* Responsive improvements */
71
+ @media (max-width: 640px) {
72
+ #chat-container {
73
+ height: calc(100vh - 220px) !important;
74
+ }
75
+
76
+ .bg-indigo-600 {
77
+ flex-direction: column;
78
+ align-items: flex-start;
79
+ gap: 0.5rem;
80
+ padding: 1rem;
81
+ }
82
+
83
+ #model-selector {
84
+ margin-top: 0.5rem;
85
+ width: 100%;
86
+ }
87
+ }
88
+
89
+ /* Feature buttons in input area */
90
+ .bg-indigo-100 {
91
+ transition: all 0.2s ease;
92
+ }
93
+
94
+ .bg-indigo-100:hover {
95
+ transform: translateY(-1px);
96
+ }
templates.html ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Templates | DeepChat Explorer</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://unpkg.com/feather-icons"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
+ </head>
12
+ <body class="bg-gray-100">
13
+ <custom-navbar></custom-navbar>
14
+
15
+ <div class="container mx-auto px-4 py-8">
16
+ <div class="max-w-6xl mx-auto">
17
+ <div class="flex items-center mb-6">
18
+ <i data-feather="layers" class="text-indigo-600 mr-2"></i>
19
+ <h1 class="text-2xl font-bold text-gray-800">Prompt Templates</h1>
20
+ </div>
21
+
22
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
23
+ <!-- Research Template -->
24
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
25
+ <div class="bg-indigo-600 px-4 py-3">
26
+ <h2 class="text-white font-semibold flex items-center">
27
+ <i data-feather="search" class="mr-2 w-4 h-4"></i>
28
+ Research Assistant
29
+ </h2>
30
+ </div>
31
+ <div class="p-4">
32
+ <p class="text-gray-600 mb-4">Comprehensive research template for academic or market research</p>
33
+ <button class="w-full bg-indigo-100 text-indigo-700 py-2 rounded-lg hover:bg-indigo-200 transition-colors">
34
+ Use Template
35
+ </button>
36
+ </div>
37
+ </div>
38
+
39
+ <!-- Code Review Template -->
40
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
41
+ <div class="bg-indigo-600 px-4 py-3">
42
+ <h2 class="text-white font-semibold flex items-center">
43
+ <i data-feather="code" class="mr-2 w-4 h-4"></i>
44
+ Code Review
45
+ </h2>
46
+ </div>
47
+ <div class="p-4">
48
+ <p class="text-gray-600 mb-4">Analyze and improve code quality with this template</p>
49
+ <button class="w-full bg-indigo-100 text-indigo-700 py-2 rounded-lg hover:bg-indigo-200 transition-colors">
50
+ Use Template
51
+ </button>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- Business Plan Template -->
56
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
57
+ <div class="bg-indigo-600 px-4 py-3">
58
+ <h2 class="text-white font-semibold flex items-center">
59
+ <i data-feather="briefcase" class="mr-2 w-4 h-4"></i>
60
+ Business Plan
61
+ </h2>
62
+ </div>
63
+ <div class="p-4">
64
+ <p class="text-gray-600 mb-4">Structured approach to creating business plans</p>
65
+ <button class="w-full bg-indigo-100 text-indigo-700 py-2 rounded-lg hover:bg-indigo-200 transition-colors">
66
+ Use Template
67
+ </button>
68
+ </div>
69
+ </div>
70
+
71
+ <!-- Content Summary Template -->
72
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
73
+ <div class="bg-indigo-600 px-4 py-3">
74
+ <h2 class="text-white font-semibold flex items-center">
75
+ <i data-feather="file-text" class="mr-2 w-4 h-4"></i>
76
+ Content Summary
77
+ </h2>
78
+ </div>
79
+ <div class="p-4">
80
+ <p class="text-gray-600 mb-4">Extract key points from long documents</p>
81
+ <button class="w-full bg-indigo-100 text-indigo-700 py-2 rounded-lg hover:bg-indigo-200 transition-colors">
82
+ Use Template
83
+ </button>
84
+ </div>
85
+ </div>
86
+
87
+ <!-- Interview Questions Template -->
88
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
89
+ <div class="bg-indigo-600 px-4 py-3">
90
+ <h2 class="text-white font-semibold flex items-center">
91
+ <i data-feather="users" class="mr-2 w-4 h-4"></i>
92
+ Interview Questions
93
+ </h2>
94
+ </div>
95
+ <div class="p-4">
96
+ <p class="text-gray-600 mb-4">Generate tailored interview questions</p>
97
+ <button class="w-full bg-indigo-100 text-indigo-700 py-2 rounded-lg hover:bg-indigo-200 transition-colors">
98
+ Use Template
99
+ </button>
100
+ </div>
101
+ </div>
102
+
103
+ <!-- Creative Writing Template -->
104
+ <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow">
105
+ <div class="bg-indigo-600 px-4 py-3">
106
+ <h2 class="text-white font-semibold flex items-center">
107
+ <i data-feather="edit-2" class="mr-2 w-4 h-4"></i>
108
+ Creative Writing
109
+ </h2>
110
+ </div>
111
+ <div class="p-4">
112
+ <p class="text-gray-600 mb-4">Spark creativity with structured prompts</p>
113
+ <button class="w-full bg-indigo-100 text-indigo-700 py-2 rounded-lg hover:bg-indigo-200 transition-colors">
114
+ Use Template
115
+ </button>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+
122
+ <custom-footer></custom-footer>
123
+
124
+ <script src="components/navbar.js"></script>
125
+ <script src="components/footer.js"></script>
126
+ <script src="script.js"></script>
127
+ <script>feather.replace();</script>
128
+ </body>
129
+ </html>