Update public/index.html
Browse files- public/index.html +6 -11
public/index.html
CHANGED
|
@@ -13,12 +13,8 @@
|
|
| 13 |
.chat-container { background-color: #111; border: 1px solid #333; border-radius: 8px; padding: 16px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 8px; }
|
| 14 |
.input-field { background-color: #000; color: #fff; border: 1px solid #333; padding: 8px; width: 100%; border-radius: 4px; }
|
| 15 |
.message { padding: 6px 12px; border-radius: 12px; max-width: 75%; word-wrap: break-word; }
|
| 16 |
-
.message.user { background-color: #005eff; align-self: flex-end; }
|
| 17 |
-
.message.bot { background-color: #222; align-self: flex-start; }
|
| 18 |
-
.reasoning { color: #888; font-style: italic; }
|
| 19 |
-
.bold { font-weight: bold; }
|
| 20 |
-
.large-text { font-size: 1.2rem; font-weight: bold; }
|
| 21 |
-
.monospace { font-family: monospace; color: #fff; background-color: #333; padding: 2px 4px; border-radius: 4px; }
|
| 22 |
.code-block { background-color: #222; padding: 8px; border-radius: 4px; font-family: monospace; white-space: pre-wrap; position: relative; }
|
| 23 |
.copy-btn { position: absolute; top: 4px; right: 4px; background: #444; color: #fff; border: none; padding: 2px 6px; cursor: pointer; font-size: 0.8rem; border-radius: 4px; }
|
| 24 |
pre code { display: block; padding: 10px; border-radius: 5px; }
|
|
@@ -77,14 +73,13 @@
|
|
| 77 |
|
| 78 |
function formatMessage(text) {
|
| 79 |
return text
|
| 80 |
-
.replace(/\*\*(.*?)\*\*/g, '<
|
| 81 |
-
.replace(/### (.*?)\n/g, '<
|
| 82 |
-
.replace(/`([^`]+)`/g, '<
|
| 83 |
.replace(/```([\s\S]*?)```/g, (match, code) => {
|
| 84 |
const escapedCode = code.replace(/</g, '<').replace(/>/g, '>');
|
| 85 |
return `<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code class="language-javascript">${escapedCode}</code></pre></div>`;
|
| 86 |
-
})
|
| 87 |
-
.replace(/<think>(.*?)<\/think>/g, '<span class="reasoning">$1</span>');
|
| 88 |
}
|
| 89 |
|
| 90 |
function copyCode(button) {
|
|
|
|
| 13 |
.chat-container { background-color: #111; border: 1px solid #333; border-radius: 8px; padding: 16px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 8px; }
|
| 14 |
.input-field { background-color: #000; color: #fff; border: 1px solid #333; padding: 8px; width: 100%; border-radius: 4px; }
|
| 15 |
.message { padding: 6px 12px; border-radius: 12px; max-width: 75%; word-wrap: break-word; }
|
| 16 |
+
.message.user { background-color: #005eff; align-self: flex-end; text-align: right; }
|
| 17 |
+
.message.bot { background-color: #222; align-self: flex-start; text-align: left; }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
.code-block { background-color: #222; padding: 8px; border-radius: 4px; font-family: monospace; white-space: pre-wrap; position: relative; }
|
| 19 |
.copy-btn { position: absolute; top: 4px; right: 4px; background: #444; color: #fff; border: none; padding: 2px 6px; cursor: pointer; font-size: 0.8rem; border-radius: 4px; }
|
| 20 |
pre code { display: block; padding: 10px; border-radius: 5px; }
|
|
|
|
| 73 |
|
| 74 |
function formatMessage(text) {
|
| 75 |
return text
|
| 76 |
+
.replace(/\*\*(.*?)\*\*/g, '<b>$1</b>')
|
| 77 |
+
.replace(/### (.*?)\n/g, '<h3>$1</h3>')
|
| 78 |
+
.replace(/`([^`]+)`/g, '<code>$1</code>')
|
| 79 |
.replace(/```([\s\S]*?)```/g, (match, code) => {
|
| 80 |
const escapedCode = code.replace(/</g, '<').replace(/>/g, '>');
|
| 81 |
return `<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code class="language-javascript">${escapedCode}</code></pre></div>`;
|
| 82 |
+
});
|
|
|
|
| 83 |
}
|
| 84 |
|
| 85 |
function copyCode(button) {
|