Llara-preview / static /style.css
helloadhavan's picture
init commit
13d012b
Raw
History Blame Contribute Delete
9.87 kB
/*
style.css β€” GPT-2 Playground
==============================
Design tokens and component styles for the generation interface.
Color system
------------
--bg-* dark indigo backgrounds (darkest β†’ surface)
--purple-* purple scale (accent, hover states)
--blue-* blue scale (gradient pair)
--text-* foreground hierarchy
--border subtle separator
Component hierarchy
-------------------
site-header
main-layout
controls-panel (parameter sliders)
generation-panel (textarea, output pane)
*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg-base: #0b0718;
--bg-surface: #13102b;
--bg-raised: #1c1840;
--bg-input: #0f0c24;
--purple-400: #84d2fc;
--purple-500: #5588f7;
--purple-600: #9333ea;
--purple-700: #7c3aed;
--blue-500: #3b82f6;
--blue-600: #2563eb;
--grad-primary: linear-gradient(135deg, #0054fd 0%, #2563eb 100%);
--grad-shimmer: linear-gradient(90deg, #2d31ff, #1068ea, #2563eb, #4f46e5, #7c3aed);
--text-primary: #ede9fe;
--text-secondary: #8ba5fa;
--text-muted: #5f68a6;
--text-on-grad: #ffffff;
--border: rgba(1, 189, 255, 0.25);
--border-focus: rgba(85, 136, 247, 0.6);
--radius-sm: 6px;
--radius-md: 10px;
--radius-lg: 16px;
--font-display: "Space Grotesk", sans-serif;
--font-body: "Inter", sans-serif;
--font-mono: "JetBrains Mono", monospace;
}
html, body {
height: 100%;
background-color: var(--bg-base);
color: var(--text-primary);
font-family: var(--font-body);
font-size: 14px;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
/* ── Accessibility ── */
.sr-only {
position: absolute; width: 1px; height: 1px;
padding: 0; margin: -1px; overflow: hidden;
clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* ── Background ambient glow ── */
body::before {
content: "";
position: fixed; inset: 0; pointer-events: none; z-index: 0;
background:
radial-gradient(ellipse 60% 40% at 20% 10%, rgba(124,58,237,0.18) 0%, transparent 70%),
radial-gradient(ellipse 50% 35% at 80% 80%, rgba(37,99,235,0.14) 0%, transparent 70%);
}
/* ── Header ── */
.site-header {
position: relative; z-index: 10;
display: flex; align-items: center; justify-content: space-between;
padding: 16px 32px;
border-bottom: 1px solid var(--border);
background: rgba(11, 7, 24, 0.8);
backdrop-filter: blur(12px);
}
.logo {
display: flex; align-items: center; gap: 10px;
font-family: var(--font-display);
font-size: 17px; font-weight: 600;
color: var(--text-primary);
}
.model-badge {
font-family: var(--font-mono);
font-size: 11px;
color: var(--purple-400);
background: rgba(124, 58, 237, 0.15);
border: 1px solid rgba(124, 58, 237, 0.3);
padding: 4px 10px;
border-radius: 100px;
letter-spacing: 0.02em;
}
/* ── Layout ── */
.main-layout {
position: relative; z-index: 1;
display: grid;
grid-template-columns: 280px 1fr;
gap: 24px;
max-width: 1100px;
margin: 0 auto;
padding: 32px 24px 48px;
min-height: calc(100vh - 65px);
align-items: start;
}
/* ── Controls panel ── */
.controls-panel {
background: var(--bg-surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 24px;
position: sticky;
top: 24px;
}
.panel-title {
font-family: var(--font-display);
font-size: 13px;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--text-secondary);
margin-bottom: 20px;
}
.control-group {
margin-bottom: 22px;
}
.control-group label {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 13px;
font-weight: 500;
color: var(--text-primary);
margin-bottom: 8px;
}
.value-display {
font-family: var(--font-mono);
font-size: 12px;
color: var(--purple-400);
background: rgba(85, 123, 247, 0.12);
padding: 2px 7px;
border-radius: 4px;
min-width: 38px;
text-align: center;
}
/* Custom range slider */
input[type="range"] {
-webkit-appearance: none;
width: 100%;
height: 4px;
background: var(--bg-raised);
border-radius: 2px;
outline: none;
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 16px; height: 16px;
border-radius: 50%;
background: var(--grad-primary);
background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
box-shadow: 0 0 0 3px rgba(0, 31, 255, 0.2);
transition: box-shadow 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
box-shadow: 0 0 0 5px rgba(85, 131, 247, 0.3);
}
input[type="range"]::-moz-range-thumb {
width: 16px; height: 16px;
border: none; border-radius: 50%;
background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
}
.param-explainer {
margin-top: 24px;
padding-top: 18px;
border-top: 1px solid var(--border);
display: flex;
flex-direction: column;
gap: 8px;
}
.param-explainer p {
font-size: 12px;
color: var(--text-muted);
line-height: 1.5;
}
.param-explainer strong {
color: var(--text-secondary);
font-weight: 500;
}
/* ── Generation panel ── */
.generation-panel {
display: flex;
flex-direction: column;
gap: 20px;
}
/* Prompt textarea */
.prompt-area {
background: var(--bg-surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
transition: border-color 0.2s;
}
.prompt-area:focus-within {
border-color: var(--border-focus);
box-shadow: 0 0 0 3px rgba(85, 98, 247, 0.1);
}
#promptInput {
width: 100%;
background: transparent;
border: none;
outline: none;
resize: none;
padding: 18px 20px 12px;
font-family: var(--font-body);
font-size: 15px;
color: var(--text-primary);
line-height: 1.65;
caret-color: var(--purple-400);
}
#promptInput::placeholder {
color: var(--text-muted);
}
.prompt-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px 14px;
border-top: 1px solid var(--border);
}
.char-count {
font-family: var(--font-mono);
font-size: 11px;
color: var(--text-muted);
}
/* Generate button */
.btn-generate {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 9px 22px;
background: var(--grad-primary);
color: var(--text-on-grad);
font-family: var(--font-display);
font-size: 14px;
font-weight: 600;
border: none;
border-radius: var(--radius-md);
cursor: pointer;
position: relative;
overflow: hidden;
transition: opacity 0.15s, transform 0.1s;
}
.btn-generate:hover:not(:disabled) {
opacity: 0.92;
transform: translateY(-1px);
}
.btn-generate:active:not(:disabled) {
transform: translateY(0);
}
.btn-generate:disabled {
cursor: not-allowed;
opacity: 0.7;
}
/* Shimmer animation while generating */
.btn-generate.is-loading {
background-size: 300% 100%;
animation: shimmerBg 1.5s linear infinite;
}
@keyframes shimmerBg {
0% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.btn-generate.is-loading .btn-label { opacity: 0; }
.btn-generate .btn-spinner { display: none; }
.btn-generate.is-loading .btn-spinner {
display: block;
position: absolute;
inset: 0; margin: auto;
width: 18px; height: 18px;
border: 2px solid rgba(255,255,255,0.3);
border-top-color: white;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* ── Output pane ── */
.output-container {
background: var(--bg-surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
}
.output-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
border-bottom: 1px solid var(--border);
background: var(--bg-raised);
}
.output-label {
font-family: var(--font-display);
font-size: 12px;
font-weight: 600;
letter-spacing: 0.07em;
text-transform: uppercase;
color: var(--text-secondary);
}
.btn-copy {
display: inline-flex; align-items: center; gap: 5px;
padding: 4px 10px;
background: transparent;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text-muted);
font-size: 12px;
cursor: pointer;
transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-copy:hover:not(:disabled) {
color: var(--text-primary);
border-color: var(--purple-600);
background: rgba(124, 58, 237, 0.12);
}
.btn-copy:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.btn-copy.copied {
color: #34d399;
border-color: rgba(52, 211, 153, 0.4);
}
.output-body {
padding: 20px;
min-height: 180px;
font-family: var(--font-mono);
font-size: 13.5px;
line-height: 1.75;
}
.output-prompt {
color: var(--text-muted);
white-space: pre-wrap;
word-break: break-word;
}
.output-prompt:not(:empty)::after {
content: "";
display: inline-block;
width: 0;
}
.output-generated {
color: var(--text-primary);
white-space: pre-wrap;
word-break: break-word;
}
.output-prompt:not(:empty) + .output-generated {
border-left: 2px solid var(--purple-700);
padding-left: 12px;
margin-top: 12px;
color: var(--text-primary);
}
.placeholder-text {
color: var(--text-muted);
font-family: var(--font-body);
font-size: 13px;
font-style: italic;
}
/* ── Error banner ── */
.error-banner {
padding: 12px 16px;
background: rgba(220, 38, 38, 0.12);
border: 1px solid rgba(220, 38, 38, 0.35);
border-radius: var(--radius-md);
color: #fca5a5;
font-size: 13px;
}
/* ── Responsive ── */
@media (max-width: 768px) {
.main-layout {
grid-template-columns: 1fr;
padding: 20px 16px 40px;
}
.controls-panel {
position: static;
}
.site-header {
padding: 14px 20px;
}
}