Streams replies over SSE from any OpenAI-compatible server (oMLX, llama.cpp, Ollama, ...). Single binary that can install itself as an OS service; docker compose bundles llama.cpp + Gemma 4 E2B.
157 lines
3.7 KiB
CSS
157 lines
3.7 KiB
CSS
:root {
|
|
--bg: #f7f7f5;
|
|
--surface: #ffffff;
|
|
--text: #1d1d1f;
|
|
--muted: #6e6e73;
|
|
--border: #e3e3e0;
|
|
--accent: #3b6cf6;
|
|
--accent-text: #ffffff;
|
|
--user-bg: #3b6cf6;
|
|
--user-text: #ffffff;
|
|
--code-bg: #f0f0ed;
|
|
--ok: #22a356;
|
|
--bad: #d64545;
|
|
--radius: 14px;
|
|
color-scheme: light dark;
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--bg: #131315;
|
|
--surface: #1d1d20;
|
|
--text: #ececef;
|
|
--muted: #9a9aa2;
|
|
--border: #2c2c31;
|
|
--accent: #6b8fff;
|
|
--user-bg: #3d5fd9;
|
|
--code-bg: #26262b;
|
|
}
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
html, body { height: 100%; margin: 0; }
|
|
|
|
body {
|
|
display: grid;
|
|
grid-template-rows: auto 1fr auto;
|
|
max-width: 820px;
|
|
margin: 0 auto;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
}
|
|
|
|
header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 14px 16px;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
header h1 { font-size: 1.05rem; margin: 0; flex: 1; }
|
|
header form { margin: 0; }
|
|
|
|
.health { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
|
|
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
|
|
.dot.ok { background: var(--ok); }
|
|
.dot.bad { background: var(--bad); }
|
|
|
|
#messages {
|
|
overflow-y: auto;
|
|
padding: 20px 16px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 14px;
|
|
}
|
|
|
|
.empty { margin: auto; text-align: center; color: var(--muted); }
|
|
.empty .big { font-size: 2rem; margin: 0; }
|
|
.empty:not(:only-child) { display: none; }
|
|
|
|
.msg { display: flex; }
|
|
.msg.user { justify-content: flex-end; }
|
|
|
|
.bubble {
|
|
max-width: min(85%, 680px);
|
|
padding: 10px 14px;
|
|
border-radius: var(--radius);
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
overflow-wrap: anywhere;
|
|
}
|
|
.msg.user .bubble {
|
|
background: var(--user-bg);
|
|
color: var(--user-text);
|
|
border-color: transparent;
|
|
border-bottom-right-radius: 4px;
|
|
}
|
|
.msg.assistant .bubble { border-bottom-left-radius: 4px; }
|
|
|
|
.content.plain { white-space: pre-wrap; }
|
|
.markdown > :first-child { margin-top: 0; }
|
|
.markdown > :last-child { margin-bottom: 0; }
|
|
.markdown pre {
|
|
background: var(--code-bg);
|
|
padding: 10px 12px;
|
|
border-radius: 8px;
|
|
overflow-x: auto;
|
|
font-size: .9em;
|
|
tab-size: 4;
|
|
}
|
|
.markdown code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
.markdown :not(pre) > code { background: var(--code-bg); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
|
|
.markdown table { border-collapse: collapse; }
|
|
.markdown th, .markdown td { border: 1px solid var(--border); padding: 4px 8px; }
|
|
.markdown a { color: var(--accent); }
|
|
|
|
.error { color: var(--bad); font-size: .9rem; margin: 6px 0 0; }
|
|
|
|
/* typing indicator while waiting for the first token */
|
|
.streaming:empty::after {
|
|
content: "● ● ●";
|
|
letter-spacing: 2px;
|
|
color: var(--muted);
|
|
animation: pulse 1.2s ease-in-out infinite;
|
|
}
|
|
@keyframes pulse { 50% { opacity: .3; } }
|
|
|
|
#composer {
|
|
display: flex;
|
|
gap: 8px;
|
|
padding: 12px 16px 18px;
|
|
border-top: 1px solid var(--border);
|
|
}
|
|
#composer textarea {
|
|
flex: 1;
|
|
resize: none;
|
|
max-height: 200px;
|
|
padding: 10px 12px;
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius);
|
|
background: var(--surface);
|
|
color: var(--text);
|
|
font: inherit;
|
|
}
|
|
#composer textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
|
|
|
|
button {
|
|
padding: 0 18px;
|
|
border: 0;
|
|
border-radius: var(--radius);
|
|
background: var(--accent);
|
|
color: var(--accent-text);
|
|
font: inherit;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
button:disabled { opacity: .5; cursor: progress; }
|
|
button.ghost {
|
|
padding: 6px 12px;
|
|
background: transparent;
|
|
color: var(--muted);
|
|
border: 1px solid var(--border);
|
|
font-weight: 500;
|
|
font-size: .85rem;
|
|
}
|