do not show pictures in a dialog, show them in a message bubble - Follow Up Deployment
Browse files- index.html +301 -350
index.html
CHANGED
@@ -3,433 +3,384 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Liquid Glass AI
|
7 |
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
<style>
|
10 |
-
@
|
11 |
-
|
12 |
-
|
13 |
-
font-family: 'Poppins', sans-serif;
|
14 |
-
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
15 |
-
min-height: 100vh;
|
16 |
-
margin: 0;
|
17 |
-
padding: 0;
|
18 |
}
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
-webkit-backdrop-filter: blur(10px);
|
24 |
-
border-radius: 20px;
|
25 |
-
border: 1px solid rgba(255, 255, 255, 0.18);
|
26 |
-
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
|
27 |
}
|
28 |
|
29 |
-
.
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
}
|
37 |
|
38 |
-
.
|
39 |
-
background:
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
border-bottom-right-radius: 4px;
|
44 |
}
|
45 |
|
46 |
-
.
|
47 |
-
background: rgba(
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
border-bottom-left-radius: 4px;
|
52 |
}
|
53 |
|
54 |
-
.
|
55 |
-
|
56 |
-
padding: 12px 16px;
|
57 |
-
background: rgba(255, 255, 255, 0.9);
|
58 |
-
border-radius: 18px;
|
59 |
-
width: fit-content;
|
60 |
-
margin-bottom: 8px;
|
61 |
}
|
62 |
|
63 |
-
.
|
64 |
-
|
65 |
-
|
66 |
-
background-color: #667eea;
|
67 |
-
border-radius: 50%;
|
68 |
-
margin: 0 2px;
|
69 |
-
animation: typingAnimation 1.4s infinite ease-in-out;
|
70 |
}
|
71 |
|
72 |
-
.
|
73 |
-
|
74 |
-
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
|
75 |
-
|
76 |
-
@keyframes typingAnimation {
|
77 |
-
0%, 60%, 100% { transform: translateY(0); }
|
78 |
-
30% { transform: translateY(-5px); }
|
79 |
}
|
80 |
|
81 |
@keyframes fadeIn {
|
82 |
from { opacity: 0; transform: translateY(10px); }
|
83 |
to { opacity: 1; transform: translateY(0); }
|
84 |
}
|
85 |
-
|
86 |
-
.gallery {
|
87 |
-
display: grid;
|
88 |
-
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
89 |
-
gap: 10px;
|
90 |
-
margin-top: 10px;
|
91 |
-
}
|
92 |
-
|
93 |
-
.gallery img {
|
94 |
-
width: 100%;
|
95 |
-
height: 120px;
|
96 |
-
object-fit: cover;
|
97 |
-
border-radius: 8px;
|
98 |
-
cursor: pointer;
|
99 |
-
transition: transform 0.3s;
|
100 |
-
}
|
101 |
-
|
102 |
-
.gallery img:hover {
|
103 |
-
transform: scale(1.05);
|
104 |
-
}
|
105 |
-
|
106 |
-
.modal {
|
107 |
-
position: fixed;
|
108 |
-
top: 0;
|
109 |
-
left: 0;
|
110 |
-
width: 100%;
|
111 |
-
height: 100%;
|
112 |
-
background: rgba(0, 0, 0, 0.8);
|
113 |
-
display: flex;
|
114 |
-
justify-content: center;
|
115 |
-
align-items: center;
|
116 |
-
z-index: 1000;
|
117 |
-
opacity: 0;
|
118 |
-
pointer-events: none;
|
119 |
-
transition: opacity 0.3s;
|
120 |
-
}
|
121 |
-
|
122 |
-
.modal.active {
|
123 |
-
opacity: 1;
|
124 |
-
pointer-events: all;
|
125 |
-
}
|
126 |
-
|
127 |
-
.modal-content {
|
128 |
-
max-width: 90%;
|
129 |
-
max-height: 90%;
|
130 |
-
}
|
131 |
-
|
132 |
-
.modal-content img {
|
133 |
-
max-width: 100%;
|
134 |
-
max-height: 90vh;
|
135 |
-
border-radius: 10px;
|
136 |
-
}
|
137 |
-
|
138 |
-
.close-modal {
|
139 |
-
position: absolute;
|
140 |
-
top: 20px;
|
141 |
-
right: 20px;
|
142 |
-
color: white;
|
143 |
-
font-size: 24px;
|
144 |
-
cursor: pointer;
|
145 |
-
}
|
146 |
-
|
147 |
-
.specs-table {
|
148 |
-
width: 100%;
|
149 |
-
border-collapse: collapse;
|
150 |
-
margin-top: 10px;
|
151 |
-
}
|
152 |
-
|
153 |
-
.specs-table tr:nth-child(even) {
|
154 |
-
background-color: rgba(0, 0, 0, 0.05);
|
155 |
-
}
|
156 |
-
|
157 |
-
.specs-table td {
|
158 |
-
padding: 8px 12px;
|
159 |
-
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
160 |
-
}
|
161 |
-
|
162 |
-
.specs-table td:first-child {
|
163 |
-
font-weight: 500;
|
164 |
-
}
|
165 |
</style>
|
166 |
</head>
|
167 |
-
<body class="
|
168 |
-
<div class="
|
169 |
-
|
170 |
-
|
171 |
-
<
|
172 |
-
<div class="ml-3">
|
173 |
-
<h2 class="font-semibold text-lg">Tech Sales Assistant</h2>
|
174 |
-
<p class="text-xs text-gray-600">Online</p>
|
175 |
-
</div>
|
176 |
-
<div class="ml-auto flex space-x-2">
|
177 |
-
<button class="w-8 h-8 rounded-full bg-white/20 flex items-center justify-center text-gray-700 hover:bg-white/30 transition">
|
178 |
-
<i class="fas fa-phone-alt text-sm"></i>
|
179 |
-
</button>
|
180 |
-
<button class="w-8 h-8 rounded-full bg-white/20 flex items-center justify-center text-gray-700 hover:bg-white/30 transition">
|
181 |
-
<i class="fas fa-ellipsis-v text-sm"></i>
|
182 |
-
</button>
|
183 |
-
</div>
|
184 |
</div>
|
185 |
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
<div class="message-bubble ai-bubble">
|
190 |
-
<p>Hello! I'm your technical sales assistant. How can I help you today? I can recommend products, compare specifications, or answer technical questions.</p>
|
191 |
-
</div>
|
192 |
-
|
193 |
-
<!-- User message 1 -->
|
194 |
-
<div class="message-bubble user-bubble">
|
195 |
-
<p>Hi! I'm looking for a high-performance laptop for video editing and 3D rendering. What would you recommend?</p>
|
196 |
-
</div>
|
197 |
-
|
198 |
-
<!-- AI typing indicator -->
|
199 |
-
<div id="typing-indicator" class="typing-indicator hidden">
|
200 |
-
<div class="typing-dot"></div>
|
201 |
-
<div class="typing-dot"></div>
|
202 |
-
<div class="typing-dot"></div>
|
203 |
</div>
|
204 |
</div>
|
205 |
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
<i class="fas fa-paper-plane"></i>
|
212 |
</button>
|
213 |
</div>
|
214 |
-
<p class="text-xs text-center text-gray-500 mt-2">AI Assistant may produce inaccurate information</p>
|
215 |
</div>
|
216 |
</div>
|
217 |
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
221 |
</button>
|
222 |
|
223 |
-
<!-- Image modal -->
|
224 |
-
<div id="image-modal" class="modal">
|
225 |
-
<span class="close-modal"><i class="fas fa-times"></i></span>
|
226 |
-
<div class="modal-content">
|
227 |
-
<img id="modal-image" src="" alt="Enlarged view">
|
228 |
-
</div>
|
229 |
-
</div>
|
230 |
-
|
231 |
<script>
|
232 |
-
// Conversation
|
233 |
const conversation = [
|
234 |
{
|
235 |
-
|
236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
},
|
238 |
{
|
239 |
-
|
240 |
-
|
|
|
241 |
},
|
242 |
{
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
<tr><td></td><td class="font-semibold">ProStudio X9000</td><td class="font-semibold">CreatorPro V700</td></tr>
|
247 |
-
<tr><td>Processor</td><td>i9-13900HX (24 cores)</td><td>i7-13700H (14 cores)</td></tr>
|
248 |
-
<tr><td>GPU</td><td>RTX 4090 (16GB)</td><td>RTX 4070 (8GB)</td></tr>
|
249 |
-
<tr><td>RAM</td><td>64GB DDR5</td><td>32GB DDR5</td></tr>
|
250 |
-
<tr><td>Storage</td><td>2TB NVMe SSD</td><td>1TB NVMe SSD</td></tr>
|
251 |
-
<tr><td>Display</td><td>17.3" 4K 120Hz</td><td>15.6" 4K 60Hz</td></tr>
|
252 |
-
<tr><td>Color Gamut</td><td>100% Adobe RGB</td><td>95% DCI-P3</td></tr>
|
253 |
-
<tr><td>Battery</td><td>94Wh (≈6hrs)</td><td>80Wh (≈8hrs)</td></tr>
|
254 |
-
<tr><td>Weight</td><td>3.2kg</td><td>2.1kg</td></tr>
|
255 |
-
<tr><td>Price</td><td>$3,999</td><td>$2,299</td></tr>
|
256 |
-
</table>`
|
257 |
},
|
258 |
{
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
<img src="https://images.unsplash.com/photo-1593642632823-8f785ba67e45?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80" alt="V700 Front View" class="gallery-img">
|
263 |
-
<img src="https://images.unsplash.com/photo-1593642634524-b40b5baae6bb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80" alt="V700 Keyboard" class="gallery-img">
|
264 |
-
<img src="https://images.unsplash.com/photo-1593642702749-b7d2a804fbcf?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80" alt="V700 Side View" class="gallery-img">
|
265 |
-
<img src="https://images.unsplash.com/photo-1593642702821-8f15c2a49cd4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80" alt="V700 Display" class="gallery-img">
|
266 |
-
</div>`
|
267 |
},
|
268 |
{
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
- Dual 4K display output<br>
|
273 |
-
- 100W power delivery<br>
|
274 |
-
- PCIe tunneling for external GPUs<br><br>
|
275 |
-
The RAM is user-upgradeable, but opening the case voids the warranty unless done by authorized service centers.`
|
276 |
},
|
277 |
{
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
}
|
289 |
];
|
290 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
// DOM elements
|
292 |
-
const
|
293 |
const userInput = document.getElementById('user-input');
|
294 |
const sendBtn = document.getElementById('send-btn');
|
295 |
-
const
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
|
300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
|
|
|
|
|
|
|
|
|
|
306 |
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
if (message === '') return;
|
311 |
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
|
318 |
-
|
319 |
-
|
320 |
-
userInput.value = '';
|
321 |
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
|
|
|
|
|
|
|
|
327 |
|
328 |
-
|
|
|
|
|
329 |
|
330 |
-
//
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
simulateAIResponse();
|
336 |
-
}, 500);
|
337 |
}
|
338 |
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
|
|
344 |
|
345 |
-
|
346 |
-
messageDiv.innerHTML = message;
|
347 |
-
chatContainer.scrollTop = chatContainer.scrollHeight;
|
348 |
-
typingIndicator.classList.add('hidden');
|
349 |
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
});
|
359 |
-
|
360 |
-
|
|
|
361 |
}
|
362 |
}
|
363 |
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
addMessage("Is there anything else I can help you with today?", 'ai');
|
373 |
-
}
|
374 |
-
}, 500 + Math.random() * 2000);
|
375 |
}
|
376 |
|
377 |
// Event listeners
|
378 |
-
|
379 |
-
userInput.addEventListener('keypress', (e) => {
|
380 |
-
if (e.key === 'Enter') sendMessage();
|
381 |
-
});
|
382 |
-
|
383 |
-
closeModal.addEventListener('click', () => {
|
384 |
-
imageModal.classList.remove('active');
|
385 |
-
});
|
386 |
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
}
|
391 |
-
});
|
392 |
-
|
393 |
-
// Replay conversation handler
|
394 |
-
document.getElementById('replay-btn').addEventListener('click', () => {
|
395 |
-
// Clear chat
|
396 |
-
chatContainer.innerHTML = `
|
397 |
-
<div class="message-bubble ai-bubble">
|
398 |
-
<p>Hello! I'm your technical sales assistant. How can I help you today? I can recommend products, compare specifications, or answer technical questions.</p>
|
399 |
-
</div>
|
400 |
-
`;
|
401 |
-
|
402 |
-
// Reset to beginning
|
403 |
-
currentStep = 0;
|
404 |
-
|
405 |
-
// Animate through conversation with delays
|
406 |
-
let delay = 2000; // Initial delay
|
407 |
-
|
408 |
-
conversation.forEach((step, index) => {
|
409 |
-
// User message
|
410 |
-
setTimeout(() => {
|
411 |
-
const userBubble = document.createElement('div');
|
412 |
-
userBubble.className = 'message-bubble user-bubble';
|
413 |
-
userBubble.textContent = step.user;
|
414 |
-
chatContainer.appendChild(userBubble);
|
415 |
-
|
416 |
-
// Show AI typing
|
417 |
-
typingIndicator.classList.remove('hidden');
|
418 |
-
chatContainer.scrollTop = chatContainer.scrollHeight;
|
419 |
-
|
420 |
-
// AI response after delay
|
421 |
-
setTimeout(() => {
|
422 |
-
typingIndicator.classList.add('hidden');
|
423 |
-
const aiBubble = document.createElement('div');
|
424 |
-
aiBubble.className = 'message-bubble ai-bubble';
|
425 |
-
aiBubble.innerHTML = step.ai;
|
426 |
-
chatContainer.appendChild(aiBubble);
|
427 |
-
}, 1000);
|
428 |
-
}, delay);
|
429 |
-
|
430 |
-
delay += 2000; // Increment delay for next pair
|
431 |
-
});
|
432 |
-
});
|
433 |
</script>
|
434 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=michalkichal/tech-sales-assistant" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
435 |
</html>
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Liquid Glass AI Chat</title>
|
7 |
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<script>
|
10 |
+
tailwind.config = {
|
11 |
+
theme: {
|
12 |
+
extend: {
|
13 |
+
colors: {
|
14 |
+
dark: '#0f172a',
|
15 |
+
darker: '#020617',
|
16 |
+
primary: '#3b82f6',
|
17 |
+
neon: '#00f5d4',
|
18 |
+
neonPink: '#f72585',
|
19 |
+
glass: 'rgba(255, 255, 255, 0.05)'
|
20 |
+
},
|
21 |
+
boxShadow: {
|
22 |
+
'neon': '0 0 10px #00f5d4, 0 0 20px #00f5d4',
|
23 |
+
'neon-pink': '0 0 10px #f72585, 0 0 20px #f72585',
|
24 |
+
'neon-blue': '0 0 10px #3b82f6, 0 0 20px #3b82f6'
|
25 |
+
},
|
26 |
+
backdropBlur: {
|
27 |
+
'glass': '12px'
|
28 |
+
}
|
29 |
+
}
|
30 |
+
}
|
31 |
+
}
|
32 |
+
</script>
|
33 |
<style>
|
34 |
+
@keyframes typing {
|
35 |
+
from { width: 0 }
|
36 |
+
to { width: 100% }
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
|
39 |
+
@keyframes blink-caret {
|
40 |
+
from, to { border-color: transparent }
|
41 |
+
50% { border-color: #00f5d4 }
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
+
.typing-animation {
|
45 |
+
overflow: hidden;
|
46 |
+
border-right: .15em solid #00f5d4;
|
47 |
+
white-space: nowrap;
|
48 |
+
animation:
|
49 |
+
typing 3.5s steps(40, end),
|
50 |
+
blink-caret .75s step-end infinite;
|
51 |
}
|
52 |
|
53 |
+
.glass-effect {
|
54 |
+
background: rgba(15, 23, 42, 0.7);
|
55 |
+
backdrop-filter: blur(12px);
|
56 |
+
-webkit-backdrop-filter: blur(12px);
|
57 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
58 |
}
|
59 |
|
60 |
+
.message-glass {
|
61 |
+
background: rgba(15, 23, 42, 0.5);
|
62 |
+
backdrop-filter: blur(8px);
|
63 |
+
-webkit-backdrop-filter: blur(8px);
|
64 |
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
|
65 |
}
|
66 |
|
67 |
+
.gallery-item {
|
68 |
+
transition: all 0.3s ease;
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
|
71 |
+
.gallery-item:hover {
|
72 |
+
transform: scale(1.05);
|
73 |
+
box-shadow: 0 0 15px rgba(0, 245, 212, 0.5);
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
|
76 |
+
.fade-in {
|
77 |
+
animation: fadeIn 0.5s ease-in-out;
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
@keyframes fadeIn {
|
81 |
from { opacity: 0; transform: translateY(10px); }
|
82 |
to { opacity: 1; transform: translateY(0); }
|
83 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
</style>
|
85 |
</head>
|
86 |
+
<body class="bg-darker text-gray-200 min-h-screen flex flex-col">
|
87 |
+
<div class="container mx-auto px-4 py-8 flex-1 flex flex-col max-w-4xl">
|
88 |
+
<div class="glass-effect rounded-2xl p-6 shadow-lg shadow-primary/10 mb-6">
|
89 |
+
<h1 class="text-3xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-neon to-primary mb-2">TechSales AI</h1>
|
90 |
+
<p class="text-gray-400">Your personal technical sales assistant</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
</div>
|
92 |
|
93 |
+
<div id="chat-container" class="flex-1 glass-effect rounded-2xl p-4 overflow-y-auto mb-4">
|
94 |
+
<div id="chat-messages" class="space-y-4">
|
95 |
+
<!-- Messages will appear here -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
</div>
|
97 |
</div>
|
98 |
|
99 |
+
<div class="glass-effect rounded-2xl p-4">
|
100 |
+
<div class="flex space-x-2">
|
101 |
+
<input
|
102 |
+
id="user-input"
|
103 |
+
type="text"
|
104 |
+
placeholder="Ask about our products..."
|
105 |
+
class="flex-1 bg-dark/70 border border-gray-700 rounded-xl px-4 py-3 focus:outline-none focus:ring-2 focus:ring-neon focus:border-transparent text-white"
|
106 |
+
disabled
|
107 |
+
>
|
108 |
+
<button
|
109 |
+
id="send-btn"
|
110 |
+
class="bg-gradient-to-r from-primary to-neon text-white px-6 py-3 rounded-xl font-medium hover:shadow-neon transition-all disabled:opacity-50"
|
111 |
+
disabled
|
112 |
+
>
|
113 |
<i class="fas fa-paper-plane"></i>
|
114 |
</button>
|
115 |
</div>
|
|
|
116 |
</div>
|
117 |
</div>
|
118 |
|
119 |
+
<button
|
120 |
+
id="play-conversation"
|
121 |
+
class="fixed bottom-6 right-6 bg-gradient-to-r from-neonPink to-primary text-white w-14 h-14 rounded-full flex items-center justify-center shadow-neon-pink hover:shadow-neon-blue transition-all z-10"
|
122 |
+
title="Play conversation"
|
123 |
+
>
|
124 |
+
<i class="fas fa-play text-xl"></i>
|
125 |
</button>
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
<script>
|
128 |
+
// Conversation script
|
129 |
const conversation = [
|
130 |
{
|
131 |
+
sender: 'ai',
|
132 |
+
text: 'Hello! I\'m your TechSales AI assistant. How can I help you today?',
|
133 |
+
delay: 1000
|
134 |
+
},
|
135 |
+
{
|
136 |
+
sender: 'user',
|
137 |
+
text: 'Hi! I\'m looking for a high-performance gaming laptop. Can you recommend something?',
|
138 |
+
delay: 2000
|
139 |
+
},
|
140 |
+
{
|
141 |
+
sender: 'ai',
|
142 |
+
text: 'Certainly! Based on your interest in gaming, I\'d recommend our Quantum X9 Pro. It features an Intel i9-13900HX processor, RTX 4090 GPU, 32GB DDR5 RAM, and a 240Hz QHD display. Would you like more details?',
|
143 |
+
delay: 3000
|
144 |
+
},
|
145 |
+
{
|
146 |
+
sender: 'user',
|
147 |
+
text: 'That sounds great, but my budget is around $2000. Do you have options in that range?',
|
148 |
+
delay: 2500
|
149 |
},
|
150 |
{
|
151 |
+
sender: 'ai',
|
152 |
+
text: 'Understood! For $2000, I\'d suggest the Quantum X7. It has an i7-13700H, RTX 4070, 16GB RAM, and 165Hz FHD display. Nearly identical build quality with slightly scaled-back specs to hit that price point.',
|
153 |
+
delay: 3500
|
154 |
},
|
155 |
{
|
156 |
+
sender: 'user',
|
157 |
+
text: 'How does the X7 compare to the Alienware m16?',
|
158 |
+
delay: 2200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
},
|
160 |
{
|
161 |
+
sender: 'ai',
|
162 |
+
text: 'Great question! The Quantum X7 offers better cooling (our liquid metal thermal system keeps temps 10-15°C lower), 20% better battery life, and our signature mechanical keyboard. The m16 has slightly better speakers and more RGB lighting zones. Performance is nearly identical.',
|
163 |
+
delay: 4000
|
|
|
|
|
|
|
|
|
|
|
164 |
},
|
165 |
{
|
166 |
+
sender: 'user',
|
167 |
+
text: 'Can you show me some pictures of the X7?',
|
168 |
+
delay: 1800
|
|
|
|
|
|
|
|
|
169 |
},
|
170 |
{
|
171 |
+
sender: 'ai',
|
172 |
+
text: 'gallery:quantum_x7',
|
173 |
+
delay: 2000
|
174 |
+
},
|
175 |
+
{
|
176 |
+
sender: 'user',
|
177 |
+
text: 'What about the ports? I need Thunderbolt 4 and HDMI 2.1',
|
178 |
+
delay: 2300
|
179 |
+
},
|
180 |
+
{
|
181 |
+
sender: 'ai',
|
182 |
+
text: 'The X7 has:\n- 2x Thunderbolt 4 (USB-C)\n- HDMI 2.1\n- 3x USB-A 3.2 Gen2\n- SD card reader\n- Ethernet\n- 3.5mm combo jack\nAll ports are on the rear for clean cable management.',
|
183 |
+
delay: 3500
|
184 |
+
},
|
185 |
+
{
|
186 |
+
sender: 'user',
|
187 |
+
text: 'Perfect! What about warranty options?',
|
188 |
+
delay: 2000
|
189 |
+
},
|
190 |
+
{
|
191 |
+
sender: 'ai',
|
192 |
+
text: 'Standard warranty is 2 years parts/labor. We offer:\n1. Basic: +1 year ($99)\n2. Premium: +2 years with accidental damage coverage ($199)\n3. Ultimate: +3 years with on-site service ($299)\nAll extend the battery coverage which normally is 1 year.',
|
193 |
+
delay: 4000
|
194 |
+
},
|
195 |
+
{
|
196 |
+
sender: 'user',
|
197 |
+
text: 'Thanks! I think I\'ll go with the X7 with Premium warranty.',
|
198 |
+
delay: 2500
|
199 |
+
},
|
200 |
+
{
|
201 |
+
sender: 'ai',
|
202 |
+
text: 'Excellent choice! Your total comes to $2,199. Would you like to proceed to checkout or need any final details?',
|
203 |
+
delay: 3000
|
204 |
}
|
205 |
];
|
206 |
|
207 |
+
// Gallery images
|
208 |
+
const galleries = {
|
209 |
+
quantum_x7: [
|
210 |
+
{ url: 'https://images.unsplash.com/photo-1593642632823-8f785ba67e45?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80', alt: 'Quantum X7 front view' },
|
211 |
+
{ url: 'https://images.unsplash.com/photo-1629131726692-1accd0df53e0?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80', alt: 'Quantum X7 keyboard' },
|
212 |
+
{ url: 'https://images.unsplash.com/photo-1629131726692-1accd0df53e0?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80', alt: 'Quantum X7 ports' },
|
213 |
+
{ url: 'https://images.unsplash.com/photo-1593642632823-8f785ba67e45?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80', alt: 'Quantum X7 side view' },
|
214 |
+
{ url: 'https://images.unsplash.com/photo-1629131726692-1accd0df53e0?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80', alt: 'Quantum X7 display' }
|
215 |
+
]
|
216 |
+
};
|
217 |
+
|
218 |
// DOM elements
|
219 |
+
const chatMessages = document.getElementById('chat-messages');
|
220 |
const userInput = document.getElementById('user-input');
|
221 |
const sendBtn = document.getElementById('send-btn');
|
222 |
+
const playBtn = document.getElementById('play-conversation');
|
223 |
+
// State
|
224 |
+
let isPlaying = false;
|
225 |
+
let currentMessageIndex = 0;
|
226 |
|
227 |
+
// Functions
|
228 |
+
function addMessage(sender, text, isTyping = false) {
|
229 |
+
const messageDiv = document.createElement('div');
|
230 |
+
messageDiv.className = `flex ${sender === 'user' ? 'justify-end' : 'justify-start'} fade-in`;
|
231 |
+
|
232 |
+
const messageBubble = document.createElement('div');
|
233 |
+
messageBubble.className = `message-glass rounded-2xl px-4 py-3 max-w-xs md:max-w-md lg:max-w-lg ${
|
234 |
+
sender === 'user'
|
235 |
+
? 'bg-gradient-to-r from-primary/30 to-primary/10 border border-primary/20 shadow-neon-blue'
|
236 |
+
: 'bg-gradient-to-r from-dark/70 to-dark/50 border border-gray-700'
|
237 |
+
}`;
|
238 |
+
|
239 |
+
if (isTyping) {
|
240 |
+
messageBubble.innerHTML = `
|
241 |
+
<div class="flex space-x-2 items-center">
|
242 |
+
<div class="w-2 h-2 rounded-full bg-neon animate-pulse"></div>
|
243 |
+
<div class="w-2 h-2 rounded-full bg-neon animate-pulse delay-100"></div>
|
244 |
+
<div class="w-2 h-2 rounded-full bg-neon animate-pulse delay-200"></div>
|
245 |
+
</div>
|
246 |
+
`;
|
247 |
+
} else {
|
248 |
+
if (text.includes('\n')) {
|
249 |
+
messageBubble.innerHTML = text.split('\n').map(line => `<p class="mb-1 last:mb-0">${line}</p>`).join('');
|
250 |
+
} else {
|
251 |
+
messageBubble.textContent = text;
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
messageDiv.appendChild(messageBubble);
|
256 |
+
chatMessages.appendChild(messageDiv);
|
257 |
+
|
258 |
+
// Smooth scroll to bottom
|
259 |
+
chatMessages.scrollTo({
|
260 |
+
top: chatMessages.scrollHeight,
|
261 |
+
behavior: 'smooth'
|
262 |
+
});
|
263 |
+
|
264 |
+
return messageBubble;
|
265 |
+
}
|
266 |
|
267 |
+
function simulateTyping(text, element, delay, callback) {
|
268 |
+
element.textContent = text;
|
269 |
+
// Smooth scroll to bottom
|
270 |
+
chatMessages.scrollTo({
|
271 |
+
top: chatMessages.scrollHeight,
|
272 |
+
behavior: 'smooth'
|
273 |
+
});
|
274 |
+
if (callback) callback();
|
275 |
+
}
|
276 |
|
277 |
+
function showGallery(galleryId) {
|
278 |
+
const gallery = galleries[galleryId];
|
279 |
+
if (!gallery) return;
|
|
|
280 |
|
281 |
+
const messageDiv = document.createElement('div');
|
282 |
+
messageDiv.className = 'flex justify-start fade-in';
|
283 |
+
|
284 |
+
const galleryBubble = document.createElement('div');
|
285 |
+
galleryBubble.className = 'message-glass rounded-2xl px-4 py-3 max-w-xs md:max-w-md lg:max-w-lg bg-gradient-to-r from-dark/70 to-dark/50 border border-gray-700';
|
286 |
|
287 |
+
const galleryGrid = document.createElement('div');
|
288 |
+
galleryGrid.className = 'grid grid-cols-2 gap-2';
|
|
|
289 |
|
290 |
+
gallery.forEach(img => {
|
291 |
+
const imgDiv = document.createElement('div');
|
292 |
+
imgDiv.className = 'gallery-item rounded-lg overflow-hidden';
|
293 |
+
imgDiv.innerHTML = `
|
294 |
+
<img src="${img.url}" alt="${img.alt}" class="w-full h-auto object-cover">
|
295 |
+
<p class="text-xs text-gray-400 mt-1">${img.alt}</p>
|
296 |
+
`;
|
297 |
+
galleryGrid.appendChild(imgDiv);
|
298 |
+
});
|
299 |
|
300 |
+
galleryBubble.appendChild(galleryGrid);
|
301 |
+
messageDiv.appendChild(galleryBubble);
|
302 |
+
chatMessages.appendChild(messageDiv);
|
303 |
|
304 |
+
// Smooth scroll to bottom
|
305 |
+
chatMessages.scrollTo({
|
306 |
+
top: chatMessages.scrollHeight,
|
307 |
+
behavior: 'smooth'
|
308 |
+
});
|
|
|
|
|
309 |
}
|
310 |
|
311 |
+
function playNextMessage() {
|
312 |
+
if (currentMessageIndex >= conversation.length) {
|
313 |
+
isPlaying = false;
|
314 |
+
playBtn.innerHTML = '<i class="fas fa-redo"></i>';
|
315 |
+
return;
|
316 |
+
}
|
317 |
|
318 |
+
const message = conversation[currentMessageIndex];
|
|
|
|
|
|
|
319 |
|
320 |
+
if (message.sender === 'user') {
|
321 |
+
// Simulate user typing in input
|
322 |
+
userInput.disabled = false;
|
323 |
+
sendBtn.disabled = false;
|
324 |
+
|
325 |
+
let typedSoFar = '';
|
326 |
+
const typingInterval = setInterval(() => {
|
327 |
+
if (typedSoFar.length < message.text.length) {
|
328 |
+
typedSoFar = message.text.substring(0, typedSoFar.length + 1);
|
329 |
+
userInput.value = typedSoFar;
|
330 |
+
} else {
|
331 |
+
clearInterval(typingInterval);
|
332 |
+
|
333 |
+
// Add to chat and clear input
|
334 |
+
addMessage('user', message.text);
|
335 |
+
userInput.value = '';
|
336 |
+
userInput.disabled = true;
|
337 |
+
sendBtn.disabled = true;
|
338 |
+
|
339 |
+
// Process next message after delay
|
340 |
+
setTimeout(playNextMessage, 1000);
|
341 |
+
currentMessageIndex++;
|
342 |
+
}
|
343 |
+
}, 50);
|
344 |
+
} else {
|
345 |
+
// AI response
|
346 |
+
if (message.text.startsWith('gallery:')) {
|
347 |
+
const galleryId = message.text.split(':')[1];
|
348 |
+
setTimeout(() => {
|
349 |
+
showGallery(galleryId);
|
350 |
+
setTimeout(playNextMessage, 1000);
|
351 |
+
currentMessageIndex++;
|
352 |
+
}, message.delay);
|
353 |
+
} else {
|
354 |
+
const typingBubble = addMessage('ai', '', true);
|
355 |
+
|
356 |
+
setTimeout(() => {
|
357 |
+
typingBubble.classList.remove('flex', 'space-x-2', 'items-center');
|
358 |
+
typingBubble.classList.add('whitespace-pre-wrap');
|
359 |
+
simulateTyping(message.text, typingBubble, 0, () => {
|
360 |
+
setTimeout(playNextMessage, 1000);
|
361 |
});
|
362 |
+
currentMessageIndex++;
|
363 |
+
}, message.delay);
|
364 |
+
}
|
365 |
}
|
366 |
}
|
367 |
|
368 |
+
function playConversation() {
|
369 |
+
if (isPlaying) return;
|
370 |
+
|
371 |
+
isPlaying = true;
|
372 |
+
currentMessageIndex = 0;
|
373 |
+
chatMessages.innerHTML = '';
|
374 |
+
playBtn.innerHTML = '<i class="fas fa-pause"></i>';
|
375 |
+
playNextMessage();
|
|
|
|
|
|
|
376 |
}
|
377 |
|
378 |
// Event listeners
|
379 |
+
playBtn.addEventListener('click', playConversation);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
|
381 |
+
// Initial state
|
382 |
+
userInput.disabled = true;
|
383 |
+
sendBtn.disabled = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
</script>
|
385 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=michalkichal/tech-sales-assistant" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
386 |
</html>
|