Spaces:
Running
Running
Update index.html
Browse files- index.html +52 -15
index.html
CHANGED
|
@@ -1302,14 +1302,15 @@
|
|
| 1302 |
/* --- Premium Message Layout Overhaul --- */
|
| 1303 |
.message-actions {
|
| 1304 |
display: flex;
|
| 1305 |
-
gap:
|
| 1306 |
-
margin-top:
|
| 1307 |
-
opacity: 0.
|
| 1308 |
-
transition:
|
| 1309 |
}
|
| 1310 |
|
| 1311 |
.message:hover .message-actions {
|
| 1312 |
opacity: 1;
|
|
|
|
| 1313 |
}
|
| 1314 |
|
| 1315 |
.action-icon-btn {
|
|
@@ -1337,9 +1338,29 @@
|
|
| 1337 |
transform: scale(0.95);
|
| 1338 |
}
|
| 1339 |
|
| 1340 |
-
.action-icon-btn i
|
| 1341 |
-
|
| 1342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1343 |
}
|
| 1344 |
|
| 1345 |
/* Consistent Blinking Emoji Logo */
|
|
@@ -5991,7 +6012,7 @@
|
|
| 5991 |
messageDiv.appendChild(messageContent);
|
| 5992 |
chatHistory.appendChild(messageDiv);
|
| 5993 |
|
| 5994 |
-
|
| 5995 |
|
| 5996 |
if (type === 'ai' && isStreaming) {
|
| 5997 |
typeWordByWord(content, messageContent);
|
|
@@ -6259,6 +6280,10 @@
|
|
| 6259 |
const badge = (toolsUsed.includes('search')) ? '<div class="compiled-search-badge"><i data-lucide="brain"></i> Synthesized Research Report</div>' : '';
|
| 6260 |
aiContentEl.innerHTML = badge + marked.parse(fullResponse);
|
| 6261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6262 |
// If backend used video tool, call video API and append to message
|
| 6263 |
if (toolsUsed.includes('video')) {
|
| 6264 |
const videoContainer = document.createElement('div');
|
|
@@ -6354,9 +6379,8 @@
|
|
| 6354 |
if (window.lucide) lucide.createIcons();
|
| 6355 |
}
|
| 6356 |
|
| 6357 |
-
addMessageActions(aiContentEl, fullResponse);
|
| 6358 |
addMessageToConversation(currentConversationId, fullResponse, 'ai');
|
| 6359 |
-
if (window.lucide) lucide.createIcons({ attrs: { 'stroke-width': 2 } });
|
| 6360 |
}
|
| 6361 |
|
| 6362 |
} catch (e) {
|
|
@@ -7370,6 +7394,17 @@
|
|
| 7370 |
renderConversations();
|
| 7371 |
}
|
| 7372 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7373 |
async function init() {
|
| 7374 |
// Assign Selectors
|
| 7375 |
sidebar = document.getElementById('sidebar');
|
|
@@ -7460,6 +7495,8 @@
|
|
| 7460 |
} else {
|
| 7461 |
startNewChat();
|
| 7462 |
}
|
|
|
|
|
|
|
| 7463 |
}
|
| 7464 |
|
| 7465 |
// --- SPA Routing Logic ---
|
|
@@ -7918,9 +7955,9 @@
|
|
| 7918 |
copyBtn.innerHTML = '<i data-lucide="check"></i>';
|
| 7919 |
setTimeout(() => {
|
| 7920 |
copyBtn.innerHTML = originalContent;
|
| 7921 |
-
|
| 7922 |
}, 2000);
|
| 7923 |
-
|
| 7924 |
};
|
| 7925 |
|
| 7926 |
// Like Button
|
|
@@ -7972,7 +8009,7 @@
|
|
| 7972 |
speakBtn.style.display = 'flex';
|
| 7973 |
stopBtn.style.display = 'none';
|
| 7974 |
stopBtn.classList.remove('speaking-stop');
|
| 7975 |
-
|
| 7976 |
}
|
| 7977 |
});
|
| 7978 |
};
|
|
@@ -7982,7 +8019,7 @@
|
|
| 7982 |
speakBtn.style.display = 'flex';
|
| 7983 |
stopBtn.style.display = 'none';
|
| 7984 |
stopBtn.classList.remove('speaking-stop');
|
| 7985 |
-
|
| 7986 |
};
|
| 7987 |
|
| 7988 |
// Export Button
|
|
@@ -8502,7 +8539,7 @@
|
|
| 8502 |
setTimeout(typeEffect, 1000);
|
| 8503 |
setTimeout(triggerLightning, 3000);
|
| 8504 |
|
| 8505 |
-
|
| 8506 |
|
| 8507 |
// 4. Server Check
|
| 8508 |
fetch('/api/chat', {
|
|
|
|
| 1302 |
/* --- Premium Message Layout Overhaul --- */
|
| 1303 |
.message-actions {
|
| 1304 |
display: flex;
|
| 1305 |
+
gap: 10px;
|
| 1306 |
+
margin-top: 14px;
|
| 1307 |
+
opacity: 0.8; /* Increased default visibility */
|
| 1308 |
+
transition: all 0.2s ease;
|
| 1309 |
}
|
| 1310 |
|
| 1311 |
.message:hover .message-actions {
|
| 1312 |
opacity: 1;
|
| 1313 |
+
transform: translateY(-2px);
|
| 1314 |
}
|
| 1315 |
|
| 1316 |
.action-icon-btn {
|
|
|
|
| 1338 |
transform: scale(0.95);
|
| 1339 |
}
|
| 1340 |
|
| 1341 |
+
.action-icon-btn i, .action-icon-btn svg,
|
| 1342 |
+
.action-btn i, .action-btn svg,
|
| 1343 |
+
.send-button i, .send-button svg,
|
| 1344 |
+
.stop-button i, .stop-button svg {
|
| 1345 |
+
display: block !important;
|
| 1346 |
+
width: 18px !important;
|
| 1347 |
+
height: 18px !important;
|
| 1348 |
+
stroke-width: 2.5px !important;
|
| 1349 |
+
}
|
| 1350 |
+
|
| 1351 |
+
.send-button svg, .stop-button svg, .send-button i, .stop-button i {
|
| 1352 |
+
color: white !important;
|
| 1353 |
+
stroke: white !important;
|
| 1354 |
+
}
|
| 1355 |
+
|
| 1356 |
+
.action-btn svg, .action-btn i {
|
| 1357 |
+
color: var(--text-secondary) !important;
|
| 1358 |
+
stroke: var(--text-secondary) !important;
|
| 1359 |
+
}
|
| 1360 |
+
|
| 1361 |
+
.action-btn:hover svg, .action-btn:hover i {
|
| 1362 |
+
color: var(--text-primary) !important;
|
| 1363 |
+
stroke: var(--text-primary) !important;
|
| 1364 |
}
|
| 1365 |
|
| 1366 |
/* Consistent Blinking Emoji Logo */
|
|
|
|
| 6012 |
messageDiv.appendChild(messageContent);
|
| 6013 |
chatHistory.appendChild(messageDiv);
|
| 6014 |
|
| 6015 |
+
refreshIcons();
|
| 6016 |
|
| 6017 |
if (type === 'ai' && isStreaming) {
|
| 6018 |
typeWordByWord(content, messageContent);
|
|
|
|
| 6280 |
const badge = (toolsUsed.includes('search')) ? '<div class="compiled-search-badge"><i data-lucide="brain"></i> Synthesized Research Report</div>' : '';
|
| 6281 |
aiContentEl.innerHTML = badge + marked.parse(fullResponse);
|
| 6282 |
|
| 6283 |
+
// Add actions immediately after content is parsed
|
| 6284 |
+
addMessageActions(aiContentEl, fullResponse);
|
| 6285 |
+
refreshIcons();
|
| 6286 |
+
|
| 6287 |
// If backend used video tool, call video API and append to message
|
| 6288 |
if (toolsUsed.includes('video')) {
|
| 6289 |
const videoContainer = document.createElement('div');
|
|
|
|
| 6379 |
if (window.lucide) lucide.createIcons();
|
| 6380 |
}
|
| 6381 |
|
|
|
|
| 6382 |
addMessageToConversation(currentConversationId, fullResponse, 'ai');
|
| 6383 |
+
if (window.lucide) lucide.createIcons({ attrs: { 'stroke-width': 2.5 } });
|
| 6384 |
}
|
| 6385 |
|
| 6386 |
} catch (e) {
|
|
|
|
| 7394 |
renderConversations();
|
| 7395 |
}
|
| 7396 |
|
| 7397 |
+
function refreshIcons() {
|
| 7398 |
+
if (typeof lucide !== 'undefined') {
|
| 7399 |
+
lucide.createIcons({
|
| 7400 |
+
attrs: {
|
| 7401 |
+
'stroke-width': 2.5,
|
| 7402 |
+
'class': 'lucide-icon'
|
| 7403 |
+
}
|
| 7404 |
+
});
|
| 7405 |
+
}
|
| 7406 |
+
}
|
| 7407 |
+
|
| 7408 |
async function init() {
|
| 7409 |
// Assign Selectors
|
| 7410 |
sidebar = document.getElementById('sidebar');
|
|
|
|
| 7495 |
} else {
|
| 7496 |
startNewChat();
|
| 7497 |
}
|
| 7498 |
+
|
| 7499 |
+
refreshIcons();
|
| 7500 |
}
|
| 7501 |
|
| 7502 |
// --- SPA Routing Logic ---
|
|
|
|
| 7955 |
copyBtn.innerHTML = '<i data-lucide="check"></i>';
|
| 7956 |
setTimeout(() => {
|
| 7957 |
copyBtn.innerHTML = originalContent;
|
| 7958 |
+
refreshIcons();
|
| 7959 |
}, 2000);
|
| 7960 |
+
refreshIcons();
|
| 7961 |
};
|
| 7962 |
|
| 7963 |
// Like Button
|
|
|
|
| 8009 |
speakBtn.style.display = 'flex';
|
| 8010 |
stopBtn.style.display = 'none';
|
| 8011 |
stopBtn.classList.remove('speaking-stop');
|
| 8012 |
+
refreshIcons();
|
| 8013 |
}
|
| 8014 |
});
|
| 8015 |
};
|
|
|
|
| 8019 |
speakBtn.style.display = 'flex';
|
| 8020 |
stopBtn.style.display = 'none';
|
| 8021 |
stopBtn.classList.remove('speaking-stop');
|
| 8022 |
+
refreshIcons();
|
| 8023 |
};
|
| 8024 |
|
| 8025 |
// Export Button
|
|
|
|
| 8539 |
setTimeout(typeEffect, 1000);
|
| 8540 |
setTimeout(triggerLightning, 3000);
|
| 8541 |
|
| 8542 |
+
refreshIcons();
|
| 8543 |
|
| 8544 |
// 4. Server Check
|
| 8545 |
fetch('/api/chat', {
|