mirror of
https://github.com/uutils/uutils.github.io.git
synced 2026-10-16 03:24:02 -07:00
- New page /ai-playground with text input for plain English descriptions - LLM (OpenAI-compatible) translates to uutils shell commands - Commands run in existing WASM terminal - API key stored in localStorage only, never touches uutils servers - Works with OpenAI, Mistral, Groq, Ollama, any OpenAI-compatible endpoint - History of past queries with one-click re-run - Settings modal (key, model, base URL) - Responsive CSS, dark mode support - Nav link added in base.html
238 lines
5.3 KiB
CSS
238 lines
5.3 KiB
CSS
/* ─── AI Playground ─────────────────────────────────────────────────────────── */
|
|
|
|
.ai-playground {
|
|
margin: 1.5rem 0;
|
|
font-family: var(--font-face, sans-serif);
|
|
}
|
|
|
|
/* Input area */
|
|
.ai-input-area {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
#ai-prompt {
|
|
flex: 1;
|
|
resize: vertical;
|
|
padding: 0.6rem 0.75rem;
|
|
font-family: inherit;
|
|
font-size: 0.95rem;
|
|
line-height: 1.4;
|
|
border: 1px solid var(--header-border-color, #ddd);
|
|
border-radius: 6px;
|
|
background: var(--bg-color, #fff);
|
|
color: var(--fg-color, #141414);
|
|
transition: border-color 0.15s;
|
|
}
|
|
|
|
#ai-prompt:focus {
|
|
outline: none;
|
|
border-color: var(--accent-color, #c04828);
|
|
}
|
|
|
|
.ai-input-actions {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.4rem;
|
|
}
|
|
|
|
/* Buttons */
|
|
.ai-btn-primary {
|
|
padding: 0.55rem 1rem;
|
|
background: var(--accent-color, #c04828);
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 0.9rem;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
transition: opacity 0.15s;
|
|
}
|
|
|
|
.ai-btn-primary:hover:not(:disabled) { opacity: 0.88; }
|
|
.ai-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
|
|
.ai-btn-secondary {
|
|
padding: 0.5rem 0.9rem;
|
|
background: transparent;
|
|
color: var(--fg-color, #141414);
|
|
border: 1px solid var(--header-border-color, #ddd);
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 0.9rem;
|
|
transition: background 0.15s;
|
|
}
|
|
.ai-btn-secondary:hover { background: var(--light-highlight-bg-color, #ededed); }
|
|
|
|
.ai-btn-icon {
|
|
padding: 0.4rem 0.55rem;
|
|
background: transparent;
|
|
border: 1px solid var(--header-border-color, #ddd);
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 1rem;
|
|
line-height: 1;
|
|
transition: background 0.15s;
|
|
}
|
|
.ai-btn-icon:hover { background: var(--light-highlight-bg-color, #ededed); }
|
|
|
|
/* Status bar */
|
|
.ai-status {
|
|
margin-top: 0.5rem;
|
|
padding: 0.4rem 0.75rem;
|
|
border-radius: 5px;
|
|
font-size: 0.88rem;
|
|
}
|
|
.ai-status-loading { background: var(--light-highlight-bg-color, #ededed); color: var(--highlight-fg-color, #595959); }
|
|
.ai-status-success { background: #d4edda; color: #155724; }
|
|
.ai-status-error { background: #f8d7da; color: #721c24; }
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
.ai-status-success { background: #1a3a25; color: #7dd49d; }
|
|
.ai-status-error { background: #3a1a1d; color: #f08090; }
|
|
}
|
|
|
|
/* Last command bar */
|
|
.ai-last-command {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin-top: 0.6rem;
|
|
padding: 0.5rem 0.75rem;
|
|
background: var(--highlight-bg-color, #ededed);
|
|
border-radius: 6px;
|
|
font-size: 0.9rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
.ai-last-label { color: var(--highlight-fg-color, #595959); font-size: 0.8rem; white-space: nowrap; }
|
|
.ai-last-command code {
|
|
flex: 1;
|
|
font-family: "Fira Mono", "Courier New", monospace;
|
|
font-size: 0.88rem;
|
|
word-break: break-all;
|
|
}
|
|
|
|
/* History */
|
|
.ai-history {
|
|
margin-top: 1rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.4rem;
|
|
}
|
|
|
|
.ai-history-entry {
|
|
padding: 0.5rem 0.75rem;
|
|
border-left: 3px solid var(--accent-color, #c04828);
|
|
background: var(--light-highlight-bg-color, #ededed);
|
|
border-radius: 0 6px 6px 0;
|
|
font-size: 0.88rem;
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
.ai-history-entry { background: var(--dark-highlight-bg-color, #27272a); }
|
|
}
|
|
|
|
.ai-history-prompt {
|
|
color: var(--highlight-fg-color, #595959);
|
|
font-size: 0.82rem;
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
|
|
.ai-history-command {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.ai-history-command code {
|
|
flex: 1;
|
|
font-family: "Fira Mono", "Courier New", monospace;
|
|
word-break: break-all;
|
|
}
|
|
|
|
.ai-run-again {
|
|
background: transparent;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-size: 0.9rem;
|
|
padding: 0.15rem 0.3rem;
|
|
border-radius: 4px;
|
|
opacity: 0.6;
|
|
transition: opacity 0.15s;
|
|
}
|
|
.ai-run-again:hover { opacity: 1; }
|
|
|
|
/* ─── Settings modal ─────────────────────────────────────────────────────────── */
|
|
|
|
#ai-settings-modal {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 1000;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.ai-modal-backdrop {
|
|
position: absolute;
|
|
inset: 0;
|
|
background: rgba(0, 0, 0, 0.45);
|
|
}
|
|
|
|
.ai-modal-box {
|
|
position: relative;
|
|
background: var(--bg-color, #fff);
|
|
color: var(--fg-color, #141414);
|
|
border-radius: 10px;
|
|
padding: 1.5rem;
|
|
width: min(420px, 92vw);
|
|
box-shadow: 0 8px 32px rgba(0,0,0,0.25);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
.ai-modal-box h3 {
|
|
margin: 0;
|
|
font-size: 1.1rem;
|
|
}
|
|
|
|
.ai-modal-box label {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.3rem;
|
|
font-size: 0.9rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.ai-modal-box input {
|
|
padding: 0.45rem 0.65rem;
|
|
border: 1px solid var(--header-border-color, #ddd);
|
|
border-radius: 6px;
|
|
background: var(--bg-color, #fff);
|
|
color: var(--fg-color, #141414);
|
|
font-size: 0.9rem;
|
|
font-family: inherit;
|
|
}
|
|
|
|
.ai-modal-box input:focus {
|
|
outline: none;
|
|
border-color: var(--accent-color, #c04828);
|
|
}
|
|
|
|
.ai-hint {
|
|
font-size: 0.78rem;
|
|
color: var(--highlight-fg-color, #595959);
|
|
font-weight: normal;
|
|
margin: 0;
|
|
}
|
|
|
|
.ai-modal-actions {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
justify-content: flex-end;
|
|
margin-top: 0.25rem;
|
|
}
|