Spaces:
Running
Running
muralipala1504 commited on
Commit ·
5078dae
1
Parent(s): 596438d
feat: UI overhaul - full width layout, user bubble contrast, green status dot, warmer dark theme
Browse files- app.js +1 -0
- index.html +54 -27
app.js
CHANGED
|
@@ -137,6 +137,7 @@
|
|
| 137 |
function appendMessage(container, sender, message, useMarkdown = false, isError = false) {
|
| 138 |
const msgDiv = document.createElement("div");
|
| 139 |
msgDiv.classList.add("message");
|
|
|
|
| 140 |
if (isError) msgDiv.classList.add("error");
|
| 141 |
|
| 142 |
const commands = extractExecuteTags(message);
|
|
|
|
| 137 |
function appendMessage(container, sender, message, useMarkdown = false, isError = false) {
|
| 138 |
const msgDiv = document.createElement("div");
|
| 139 |
msgDiv.classList.add("message");
|
| 140 |
+
if (sender === "You") msgDiv.classList.add("user-msg");
|
| 141 |
if (isError) msgDiv.classList.add("error");
|
| 142 |
|
| 143 |
const commands = extractExecuteTags(message);
|
index.html
CHANGED
|
@@ -19,13 +19,13 @@
|
|
| 19 |
|
| 20 |
<style>
|
| 21 |
:root {
|
| 22 |
-
--bg: #
|
| 23 |
-
--panel: #
|
| 24 |
-
--border: #
|
| 25 |
-
--text: #
|
| 26 |
-
--muted: #
|
| 27 |
--accent: #22c55e;
|
| 28 |
-
--accent-2: #
|
| 29 |
}
|
| 30 |
* { box-sizing: border-box; }
|
| 31 |
body {
|
|
@@ -35,9 +35,9 @@
|
|
| 35 |
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
|
| 36 |
}
|
| 37 |
.container {
|
| 38 |
-
max-width:
|
| 39 |
-
margin:
|
| 40 |
-
padding:
|
| 41 |
}
|
| 42 |
header {
|
| 43 |
display: flex;
|
|
@@ -51,8 +51,22 @@
|
|
| 51 |
letter-spacing: 0.4px;
|
| 52 |
}
|
| 53 |
.status {
|
| 54 |
-
font-size:
|
| 55 |
color: var(--muted);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
.header-btn {
|
| 58 |
padding: 6px 12px;
|
|
@@ -77,20 +91,26 @@
|
|
| 77 |
padding: 12px;
|
| 78 |
}
|
| 79 |
#chat-output {
|
| 80 |
-
height:
|
| 81 |
overflow-y: auto;
|
| 82 |
-
padding:
|
| 83 |
-
background: #
|
| 84 |
border: 1px solid var(--border);
|
| 85 |
border-radius: 8px;
|
| 86 |
}
|
| 87 |
.message {
|
| 88 |
-
margin:
|
| 89 |
-
padding:
|
| 90 |
-
background: #
|
| 91 |
border: 1px solid var(--border);
|
| 92 |
-
border-radius:
|
| 93 |
-
line-height: 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
}
|
| 95 |
.message strong {
|
| 96 |
display: inline-block;
|
|
@@ -117,10 +137,10 @@
|
|
| 117 |
word-break: break-word;
|
| 118 |
}
|
| 119 |
.composer {
|
| 120 |
-
margin-top:
|
| 121 |
display: grid;
|
| 122 |
grid-template-columns: 1fr auto;
|
| 123 |
-
gap:
|
| 124 |
align-items: start;
|
| 125 |
}
|
| 126 |
#chat-input {
|
|
@@ -128,13 +148,18 @@
|
|
| 128 |
resize: vertical;
|
| 129 |
min-height: 80px;
|
| 130 |
max-height: 240px;
|
| 131 |
-
padding:
|
| 132 |
-
border-radius:
|
| 133 |
border: 1px solid var(--border);
|
| 134 |
-
background: #
|
| 135 |
color: var(--text);
|
| 136 |
font-family: inherit;
|
| 137 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
}
|
| 139 |
#chat-send {
|
| 140 |
height: 40px;
|
|
@@ -205,7 +230,7 @@
|
|
| 205 |
/* Command execution styles */
|
| 206 |
.command-wrapper {
|
| 207 |
margin: 10px 0;
|
| 208 |
-
background: #
|
| 209 |
border: 1px solid var(--border);
|
| 210 |
border-radius: 8px;
|
| 211 |
padding: 12px;
|
|
@@ -255,7 +280,7 @@
|
|
| 255 |
<button id="clear-btn" class="header-btn" title="Clear conversation">
|
| 256 |
🗑️ Clear
|
| 257 |
</button>
|
| 258 |
-
<div class="status">Backend: <span id="status">checking…</span></div>
|
| 259 |
</div>
|
| 260 |
</header>
|
| 261 |
|
|
@@ -281,7 +306,9 @@
|
|
| 281 |
try {
|
| 282 |
const r = await fetch('/chat/ready');
|
| 283 |
const j = await r.json().catch(() => ({}));
|
| 284 |
-
|
|
|
|
|
|
|
| 285 |
} catch {
|
| 286 |
el.textContent = 'offline';
|
| 287 |
}
|
|
|
|
| 19 |
|
| 20 |
<style>
|
| 21 |
:root {
|
| 22 |
+
--bg: #0d0f14;
|
| 23 |
+
--panel: #13161d;
|
| 24 |
+
--border: #232830;
|
| 25 |
+
--text: #dde3ed;
|
| 26 |
+
--muted: #7a8799;
|
| 27 |
--accent: #22c55e;
|
| 28 |
+
--accent-2: #4f9eff;
|
| 29 |
}
|
| 30 |
* { box-sizing: border-box; }
|
| 31 |
body {
|
|
|
|
| 35 |
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
|
| 36 |
}
|
| 37 |
.container {
|
| 38 |
+
max-width: 1400px;
|
| 39 |
+
margin: 0 auto;
|
| 40 |
+
padding: 24px 40px;
|
| 41 |
}
|
| 42 |
header {
|
| 43 |
display: flex;
|
|
|
|
| 51 |
letter-spacing: 0.4px;
|
| 52 |
}
|
| 53 |
.status {
|
| 54 |
+
font-size: 13px;
|
| 55 |
color: var(--muted);
|
| 56 |
+
display: flex;
|
| 57 |
+
align-items: center;
|
| 58 |
+
gap: 6px;
|
| 59 |
+
}
|
| 60 |
+
.status-dot {
|
| 61 |
+
width: 8px;
|
| 62 |
+
height: 8px;
|
| 63 |
+
border-radius: 50%;
|
| 64 |
+
background: #ef4444;
|
| 65 |
+
display: inline-block;
|
| 66 |
+
}
|
| 67 |
+
.status-dot.ok {
|
| 68 |
+
background: #22c55e;
|
| 69 |
+
box-shadow: 0 0 6px #22c55e88;
|
| 70 |
}
|
| 71 |
.header-btn {
|
| 72 |
padding: 6px 12px;
|
|
|
|
| 91 |
padding: 12px;
|
| 92 |
}
|
| 93 |
#chat-output {
|
| 94 |
+
height: 70vh;
|
| 95 |
overflow-y: auto;
|
| 96 |
+
padding: 16px;
|
| 97 |
+
background: #0d0f14;
|
| 98 |
border: 1px solid var(--border);
|
| 99 |
border-radius: 8px;
|
| 100 |
}
|
| 101 |
.message {
|
| 102 |
+
margin: 12px 0;
|
| 103 |
+
padding: 14px 18px;
|
| 104 |
+
background: #0d1626;
|
| 105 |
border: 1px solid var(--border);
|
| 106 |
+
border-radius: 10px;
|
| 107 |
+
line-height: 1.7;
|
| 108 |
+
font-size: 15px;
|
| 109 |
+
}
|
| 110 |
+
.message.user-msg {
|
| 111 |
+
background: #0d1e35;
|
| 112 |
+
border-color: #1a3a5c;
|
| 113 |
+
border-left: 3px solid #4f9eff;
|
| 114 |
}
|
| 115 |
.message strong {
|
| 116 |
display: inline-block;
|
|
|
|
| 137 |
word-break: break-word;
|
| 138 |
}
|
| 139 |
.composer {
|
| 140 |
+
margin-top: 16px;
|
| 141 |
display: grid;
|
| 142 |
grid-template-columns: 1fr auto;
|
| 143 |
+
gap: 12px;
|
| 144 |
align-items: start;
|
| 145 |
}
|
| 146 |
#chat-input {
|
|
|
|
| 148 |
resize: vertical;
|
| 149 |
min-height: 80px;
|
| 150 |
max-height: 240px;
|
| 151 |
+
padding: 14px 16px;
|
| 152 |
+
border-radius: 10px;
|
| 153 |
border: 1px solid var(--border);
|
| 154 |
+
background: #0d0f14;
|
| 155 |
color: var(--text);
|
| 156 |
font-family: inherit;
|
| 157 |
+
font-size: 15px;
|
| 158 |
+
}
|
| 159 |
+
#chat-input:focus {
|
| 160 |
+
outline: none;
|
| 161 |
+
border-color: #3b82f6;
|
| 162 |
+
box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
|
| 163 |
}
|
| 164 |
#chat-send {
|
| 165 |
height: 40px;
|
|
|
|
| 230 |
/* Command execution styles */
|
| 231 |
.command-wrapper {
|
| 232 |
margin: 10px 0;
|
| 233 |
+
background: #0d0f14;
|
| 234 |
border: 1px solid var(--border);
|
| 235 |
border-radius: 8px;
|
| 236 |
padding: 12px;
|
|
|
|
| 280 |
<button id="clear-btn" class="header-btn" title="Clear conversation">
|
| 281 |
🗑️ Clear
|
| 282 |
</button>
|
| 283 |
+
<div class="status"><span class="status-dot" id="status-dot"></span>Backend: <span id="status">checking…</span></div>
|
| 284 |
</div>
|
| 285 |
</header>
|
| 286 |
|
|
|
|
| 306 |
try {
|
| 307 |
const r = await fetch('/chat/ready');
|
| 308 |
const j = await r.json().catch(() => ({}));
|
| 309 |
+
const isOk = r.ok && j.status === 'ok';
|
| 310 |
+
el.textContent = isOk ? 'ok' : 'error';
|
| 311 |
+
document.getElementById('status-dot').classList.toggle('ok', isOk);
|
| 312 |
} catch {
|
| 313 |
el.textContent = 'offline';
|
| 314 |
}
|