VedikaAmodiya commited on
Commit
5853662
·
verified ·
1 Parent(s): 6cd3fff

Delete chat.html

Browse files
Files changed (1) hide show
  1. chat.html +0 -454
chat.html DELETED
@@ -1,454 +0,0 @@
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>AI Assistant | ChatGPT + Google</title>
7
- <style>
8
- :root {
9
- --primary-color: #4285f4;
10
- --secondary-color: #34a853;
11
- --background-color: #f8f9fa;
12
- --text-color: #202124;
13
- --light-gray: #dadce0;
14
- --chat-user-bg: #e3f2fd;
15
- --chat-ai-bg: #f1f3f4;
16
- }
17
-
18
- * {
19
- margin: 0;
20
- padding: 0;
21
- box-sizing: border-box;
22
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
23
- }
24
-
25
- body {
26
- background-color: var(--background-color);
27
- color: var(--text-color);
28
- display: flex;
29
- flex-direction: column;
30
- height: 100vh;
31
- }
32
-
33
- header {
34
- background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
35
- color: white;
36
- padding: 1rem;
37
- text-align: center;
38
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
39
- }
40
-
41
- .container {
42
- display: flex;
43
- flex: 1;
44
- overflow: hidden;
45
- }
46
-
47
- .sidebar {
48
- width: 250px;
49
- background-color: white;
50
- padding: 1rem;
51
- border-right: 1px solid var(--light-gray);
52
- overflow-y: auto;
53
- }
54
-
55
- .main-content {
56
- flex: 1;
57
- display: flex;
58
- flex-direction: column;
59
- overflow: hidden;
60
- }
61
-
62
- .search-container {
63
- padding: 1rem;
64
- background-color: white;
65
- border-bottom: 1px solid var(--light-gray);
66
- }
67
-
68
- .search-box {
69
- display: flex;
70
- gap: 0.5rem;
71
- }
72
-
73
- input[type="text"] {
74
- flex: 1;
75
- padding: 0.75rem;
76
- border: 1px solid var(--light-gray);
77
- border-radius: 24px;
78
- font-size: 1rem;
79
- outline: none;
80
- }
81
-
82
- input[type="text"]:focus {
83
- border-color: var(--primary-color);
84
- box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
85
- }
86
-
87
- button {
88
- background-color: var(--primary-color);
89
- color: white;
90
- border: none;
91
- border-radius: 24px;
92
- padding: 0.75rem 1.5rem;
93
- cursor: pointer;
94
- font-weight: 500;
95
- transition: background-color 0.2s;
96
- }
97
-
98
- button:hover {
99
- background-color: #3367d6;
100
- }
101
-
102
- .chat-container {
103
- flex: 1;
104
- overflow-y: auto;
105
- padding: 1rem;
106
- background-color: white;
107
- }
108
-
109
- .message {
110
- margin-bottom: 1rem;
111
- padding: 0.75rem 1rem;
112
- border-radius: 12px;
113
- max-width: 80%;
114
- line-height: 1.5;
115
- }
116
-
117
- .user-message {
118
- background-color: var(--chat-user-bg);
119
- margin-left: auto;
120
- border-bottom-right-radius: 4px;
121
- }
122
-
123
- .ai-message {
124
- background-color: var(--chat-ai-bg);
125
- margin-right: auto;
126
- border-bottom-left-radius: 4px;
127
- }
128
-
129
- .message-content {
130
- margin-bottom: 0.5rem;
131
- }
132
-
133
- .message-timestamp {
134
- font-size: 0.75rem;
135
- color: #70757a;
136
- text-align: right;
137
- }
138
-
139
- .search-options {
140
- display: flex;
141
- gap: 1rem;
142
- margin-top: 0.5rem;
143
- flex-wrap: wrap;
144
- }
145
-
146
- .option-button {
147
- background-color: transparent;
148
- color: var(--primary-color);
149
- border: 1px solid var(--light-gray);
150
- padding: 0.5rem 1rem;
151
- }
152
-
153
- .option-button.active {
154
- background-color: var(--primary-color);
155
- color: white;
156
- }
157
-
158
- .search-results {
159
- margin-top: 1rem;
160
- padding: 1rem;
161
- background-color: white;
162
- border-top: 1px solid var(--light-gray);
163
- overflow-y: auto;
164
- max-height: 200px;
165
- }
166
-
167
- .result-item {
168
- margin-bottom: 0.75rem;
169
- padding-bottom: 0.75rem;
170
- border-bottom: 1px solid var(--light-gray);
171
- }
172
-
173
- .result-item:last-child {
174
- border-bottom: none;
175
- }
176
-
177
- .result-title {
178
- font-weight: 500;
179
- color: var(--primary-color);
180
- margin-bottom: 0.25rem;
181
- }
182
-
183
- .result-url {
184
- font-size: 0.75rem;
185
- color: var(--secondary-color);
186
- margin-bottom: 0.25rem;
187
- }
188
-
189
- .result-snippet {
190
- font-size: 0.9rem;
191
- color: var(--text-color);
192
- }
193
-
194
- .typing-indicator {
195
- display: inline-block;
196
- padding: 0.5rem 1rem;
197
- background-color: var(--chat-ai-bg);
198
- border-radius: 12px;
199
- margin-bottom: 1rem;
200
- }
201
-
202
- .typing-dot {
203
- display: inline-block;
204
- width: 8px;
205
- height: 8px;
206
- border-radius: 50%;
207
- background-color: #70757a;
208
- margin-right: 4px;
209
- animation: typing-animation 1.4s infinite both;
210
- }
211
-
212
- .typing-dot:nth-child(2) {
213
- animation-delay: 0.2s;
214
- }
215
-
216
- .typing-dot:nth-child(3) {
217
- animation-delay: 0.4s;
218
- }
219
-
220
- @keyframes typing-animation {
221
- 0%, 60%, 100% {
222
- transform: translateY(0);
223
- }
224
- 30% {
225
- transform: translateY(-5px);
226
- }
227
- }
228
-
229
- @media (max-width: 768px) {
230
- .container {
231
- flex-direction: column;
232
- }
233
-
234
- .sidebar {
235
- width: 100%;
236
- border-right: none;
237
- border-bottom: 1px solid var(--light-gray);
238
- }
239
-
240
- .message {
241
- max-width: 90%;
242
- }
243
- }
244
- </style>
245
- </head>
246
- <body>
247
- <header>
248
- <h1>AI Assistant</h1>
249
- <p>Combining conversational AI with web search capabilities</p>
250
- </header>
251
-
252
- <div class="container">
253
- <div class="sidebar">
254
- <h2>Recent Conversations</h2>
255
- <p>Your conversation history will appear here</p>
256
- <!-- Conversation history would be dynamically populated -->
257
- </div>
258
-
259
- <div class="main-content">
260
- <div class="search-container">
261
- <div class="search-box">
262
- <input type="text" id="query-input" placeholder="Ask me anything or search the web...">
263
- <button id="search-button">Ask</button>
264
- </div>
265
-
266
- <div class="search-options">
267
- <button class="option-button active" data-mode="chat">Chat Only</button>
268
- <button class="option-button" data-mode="search">Web Search</button>
269
- <button class="option-button" data-mode="both">Chat + Search</button>
270
- </div>
271
- </div>
272
-
273
- <div class="chat-container" id="chat-container">
274
- <div class="message ai-message">
275
- <div class="message-content">
276
- Hello! I'm your AI assistant. I can answer questions conversationally like ChatGPT,
277
- or I can search the web for information like Google. How can I help you today?
278
- </div>
279
- <div class="message-timestamp">Just now</div>
280
- </div>
281
- </div>
282
-
283
- <div class="search-results" id="search-results">
284
- <h3>Web Results</h3>
285
- <p>Web search results will appear here when enabled</p>
286
- <!-- Search results would be dynamically populated -->
287
- </div>
288
- </div>
289
- </div>
290
-
291
- <script>
292
- document.addEventListener('DOMContentLoaded', function() {
293
- const queryInput = document.getElementById('query-input');
294
- const searchButton = document.getElementById('search-button');
295
- const chatContainer = document.getElementById('chat-container');
296
- const searchResults = document.getElementById('search-results');
297
- const optionButtons = document.querySelectorAll('.option-button');
298
-
299
- let currentMode = 'chat';
300
-
301
- // Set active mode
302
- optionButtons.forEach(button => {
303
- button.addEventListener('click', function() {
304
- optionButtons.forEach(btn => btn.classList.remove('active'));
305
- this.classList.add('active');
306
- currentMode = this.dataset.mode;
307
-
308
- if (currentMode === 'chat') {
309
- searchResults.style.display = 'none';
310
- } else {
311
- searchResults.style.display = 'block';
312
- }
313
- });
314
- });
315
-
316
- // Add message to chat
317
- function addMessage(text, isUser = false) {
318
- const messageDiv = document.createElement('div');
319
- messageDiv.className = isUser ? 'message user-message' : 'message ai-message';
320
-
321
- const messageContent = document.createElement('div');
322
- messageContent.className = 'message-content';
323
- messageContent.textContent = text;
324
-
325
- const timestamp = document.createElement('div');
326
- timestamp.className = 'message-timestamp';
327
- timestamp.textContent = new Date().toLocaleTimeString();
328
-
329
- messageDiv.appendChild(messageContent);
330
- messageDiv.appendChild(timestamp);
331
-
332
- chatContainer.appendChild(messageDiv);
333
- chatContainer.scrollTop = chatContainer.scrollHeight;
334
- }
335
-
336
- // Show typing indicator
337
- function showTypingIndicator() {
338
- const typingDiv = document.createElement('div');
339
- typingDiv.className = 'typing-indicator';
340
- typingDiv.id = 'typing-indicator';
341
-
342
- for (let i = 0; i < 3; i++) {
343
- const dot = document.createElement('span');
344
- dot.className = 'typing-dot';
345
- typingDiv.appendChild(dot);
346
- }
347
-
348
- chatContainer.appendChild(typingDiv);
349
- chatContainer.scrollTop = chatContainer.scrollHeight;
350
-
351
- return typingDiv;
352
- }
353
-
354
- // Simulate AI response
355
- function simulateAIResponse(userQuery) {
356
- const typingIndicator = showTypingIndicator();
357
-
358
- // Simulate processing delay
359
- setTimeout(() => {
360
- typingIndicator.remove();
361
-
362
- // Simple response logic - in a real implementation, this would call an API
363
- let response = "";
364
-
365
- if (userQuery.toLowerCase().includes('hello') || userQuery.toLowerCase().includes('hi')) {
366
- response = "Hello there! How can I assist you today?";
367
- } else if (userQuery.toLowerCase().includes('weather')) {
368
- response = "I don't have real-time weather data access in this demo. In a full implementation, I would fetch current weather information for you.";
369
- } else if (userQuery.toLowerCase().includes('time')) {
370
- response = `The current time is ${new Date().toLocaleTimeString()}.`;
371
- } else {
372
- response = `I understand that you're asking about "${userQuery}". In a complete implementation, I would provide a detailed answer based on my knowledge and web search results if enabled.`;
373
- }
374
-
375
- addMessage(response);
376
-
377
- // If in search mode, simulate web results
378
- if (currentMode !== 'chat') {
379
- simulateWebResults(userQuery);
380
- }
381
- }, 1500);
382
- }
383
-
384
- // Simulate web search results
385
- function simulateWebResults(query) {
386
- searchResults.innerHTML = `<h3>Web Results for "${query}"</h3>`;
387
-
388
- // Create mock results
389
- const mockResults = [
390
- {
391
- title: `Understanding ${query} - Wikipedia`,
392
- url: `https://en.wikipedia.org/wiki/${encodeURIComponent(query)}`,
393
- snippet: `Comprehensive information about ${query} from Wikipedia, the free encyclopedia.`
394
- },
395
- {
396
- title: `${query} - Latest News & Updates`,
397
- url: `https://news.google.com/search?q=${encodeURIComponent(query)}`,
398
- snippet: `Latest news articles and updates related to ${query} from various sources.`
399
- },
400
- {
401
- title: `Expert Guide to ${query}`,
402
- url: `https://www.example.com/guide/${encodeURIComponent(query)}`,
403
- snippet: `A detailed guide covering everything you need to know about ${query}.`
404
- }
405
- ];
406
-
407
- mockResults.forEach(result => {
408
- const resultItem = document.createElement('div');
409
- resultItem.className = 'result-item';
410
-
411
- const title = document.createElement('div');
412
- title.className = 'result-title';
413
- title.textContent = result.title;
414
-
415
- const url = document.createElement('div');
416
- url.className = 'result-url';
417
- url.textContent = result.url;
418
-
419
- const snippet = document.createElement('div');
420
- snippet.className = 'result-snippet';
421
- snippet.textContent = result.snippet;
422
-
423
- resultItem.appendChild(title);
424
- resultItem.appendChild(url);
425
- resultItem.appendChild(snippet);
426
-
427
- searchResults.appendChild(resultItem);
428
- });
429
- }
430
-
431
- // Handle search/query submission
432
- function handleQuery() {
433
- const query = queryInput.value.trim();
434
-
435
- if (query) {
436
- addMessage(query, true);
437
- queryInput.value = '';
438
-
439
- simulateAIResponse(query);
440
- }
441
- }
442
-
443
- // Event listeners
444
- searchButton.addEventListener('click', handleQuery);
445
-
446
- queryInput.addEventListener('keypress', function(e) {
447
- if (e.key === 'Enter') {
448
- handleQuery();
449
- }
450
- });
451
- });
452
- </script>
453
- </body>
454
- </html>