feat: add modern glassmorphism styling and initial text chat component layout
This commit is contained in:
1 parent
dbd222dc9a
commit
ac406f9cd0
2 files changed
+1248
-970
No files matched your search
+359
-30
@@ -281,72 +281,268 @@ body {
|
||||
border: 1px solid color-mix(in srgb, var(--md-sys-color-success) 45%, transparent);
|
||||
}
|
||||
|
||||
/* ─── Chat Messages Container ─────────────────────────────────── */
|
||||
.chat-messages {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding: 28px 24px 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
gap: 0;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
.chat-messages::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
.chat-messages::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
.chat-messages::-webkit-scrollbar-thumb {
|
||||
background: color-mix(in srgb, var(--md-sys-color-outline) 35%, transparent);
|
||||
border-radius: 99px;
|
||||
}
|
||||
|
||||
/* ─── Empty State ─────────────────────────────────────────────── */
|
||||
.chat-empty {
|
||||
margin: auto;
|
||||
max-width: 440px;
|
||||
max-width: 460px;
|
||||
text-align: center;
|
||||
color: var(--md-sys-color-on-surface-variant);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 40px 24px;
|
||||
}
|
||||
|
||||
.chat-empty-icon {
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg,
|
||||
color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent),
|
||||
color-mix(in srgb, var(--md-sys-color-tertiary, #7c3aed) 12%, transparent));
|
||||
border: 1.5px solid color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent);
|
||||
color: var(--md-sys-color-primary);
|
||||
animation: emptyPulse 3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes emptyPulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent); }
|
||||
50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--md-sys-color-primary) 0%, transparent); }
|
||||
}
|
||||
|
||||
.chat-empty h3 {
|
||||
margin-top: 10px;
|
||||
margin: 0;
|
||||
font-size: 1.15rem;
|
||||
font-weight: 700;
|
||||
color: var(--md-sys-color-on-surface);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.chat-message {
|
||||
align-self: flex-start;
|
||||
max-width: min(780px, 88%);
|
||||
padding: 12px 14px;
|
||||
border-radius: 4px var(--md-shape-corner-large) var(--md-shape-corner-large) var(--md-shape-corner-large);
|
||||
.chat-empty p {
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.6;
|
||||
max-width: 340px;
|
||||
}
|
||||
|
||||
.chat-suggestions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
max-width: 380px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.chat-suggestion-chip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 10px 14px;
|
||||
border-radius: var(--md-shape-corner-medium);
|
||||
border: 1px solid var(--border-color);
|
||||
background: var(--md-sys-color-surface-variant);
|
||||
line-height: 1.55;
|
||||
white-space: pre-wrap;
|
||||
color: var(--md-sys-color-on-surface-variant);
|
||||
font-size: 0.82rem;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
transition: all 0.18s ease;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.chat-suggestion-chip:hover {
|
||||
border-color: var(--md-sys-color-primary);
|
||||
background: color-mix(in srgb, var(--md-sys-color-primary) 8%, var(--md-sys-color-surface-variant));
|
||||
color: var(--md-sys-color-on-surface);
|
||||
transform: translateX(3px);
|
||||
}
|
||||
|
||||
/* ─── Message Row (avatar + bubble) ──────────────────────────── */
|
||||
.chat-message-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 10px;
|
||||
margin-bottom: 6px;
|
||||
animation: msgSlideIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
|
||||
}
|
||||
|
||||
@keyframes msgSlideIn {
|
||||
from { opacity: 0; transform: translateY(10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.chat-message-row.user {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
.chat-message-row + .chat-message-row {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* Group spacing: bigger gap between user→ai switches */
|
||||
.chat-message-row.ai + .chat-message-row.user,
|
||||
.chat-message-row.user + .chat-message-row.ai {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
/* ─── Avatar Chip ─────────────────────────────────────────────── */
|
||||
.chat-avatar {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.02em;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.chat-avatar.ai {
|
||||
background: linear-gradient(135deg, var(--md-sys-color-primary), color-mix(in srgb, var(--md-sys-color-primary) 70%, #7c3aed));
|
||||
color: var(--md-sys-color-on-primary);
|
||||
box-shadow: 0 2px 8px color-mix(in srgb, var(--md-sys-color-primary) 35%, transparent);
|
||||
}
|
||||
|
||||
.chat-avatar.user {
|
||||
background: color-mix(in srgb, var(--md-sys-color-primary-container) 80%, var(--md-sys-color-surface-variant));
|
||||
color: var(--md-sys-color-on-primary-container);
|
||||
border: 1.5px solid color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
|
||||
}
|
||||
|
||||
/* ─── Bubble ──────────────────────────────────────────────────── */
|
||||
.chat-bubble-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: min(720px, 84%);
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.chat-message-row.user .chat-bubble-wrap {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.chat-message-row.ai .chat-bubble-wrap {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.chat-bubble {
|
||||
padding: 12px 16px;
|
||||
border-radius: 18px;
|
||||
line-height: 1.6;
|
||||
overflow-wrap: anywhere;
|
||||
position: relative;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.chat-message.user {
|
||||
align-self: flex-end;
|
||||
border-radius: var(--md-shape-corner-large) 4px var(--md-shape-corner-large) var(--md-shape-corner-large);
|
||||
background: var(--md-sys-color-primary-container);
|
||||
/* AI bubble */
|
||||
.chat-message-row.ai .chat-bubble {
|
||||
background: var(--md-sys-color-surface-variant);
|
||||
color: var(--md-sys-color-on-surface);
|
||||
border: 1px solid var(--border-color);
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.chat-message.error {
|
||||
/* User bubble */
|
||||
.chat-message-row.user .chat-bubble {
|
||||
background: linear-gradient(135deg,
|
||||
var(--md-sys-color-primary),
|
||||
color-mix(in srgb, var(--md-sys-color-primary) 80%, #7c3aed 20%));
|
||||
color: var(--md-sys-color-on-primary);
|
||||
border: none;
|
||||
border-bottom-right-radius: 4px;
|
||||
box-shadow: 0 2px 12px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
|
||||
}
|
||||
|
||||
.chat-bubble.error {
|
||||
background: color-mix(in srgb, var(--md-sys-color-error) 12%, var(--md-sys-color-surface-variant));
|
||||
border-color: color-mix(in srgb, var(--md-sys-color-error) 35%, transparent);
|
||||
color: var(--md-sys-color-error);
|
||||
}
|
||||
|
||||
.chat-message strong {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
color: var(--md-sys-color-primary);
|
||||
font-size: 0.78rem;
|
||||
/* Sender label */
|
||||
.chat-sender-label {
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
color: var(--md-sys-color-outline);
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
/* ─── Generation Stats ────────────────────────────────────────── */
|
||||
.chat-generation-stats {
|
||||
display: flex;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-top: 9px;
|
||||
padding-top: 7px;
|
||||
border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 22%, transparent);
|
||||
margin-top: 4px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 99px;
|
||||
background: color-mix(in srgb, var(--md-sys-color-surface-variant) 70%, transparent);
|
||||
border: 1px solid var(--border-color);
|
||||
color: var(--md-sys-color-on-surface-variant);
|
||||
font-size: 0.72rem;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
backdrop-filter: blur(4px);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.chat-generation-stats.streaming {
|
||||
color: var(--md-sys-color-primary);
|
||||
border-color: color-mix(in srgb, var(--md-sys-color-primary) 35%, transparent);
|
||||
background: color-mix(in srgb, var(--md-sys-color-primary) 8%, var(--md-sys-color-surface-variant));
|
||||
animation: statsGlow 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes statsGlow {
|
||||
0%, 100% { box-shadow: none; }
|
||||
50% { box-shadow: 0 0 8px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent); }
|
||||
}
|
||||
|
||||
.chat-generation-stats.complete {
|
||||
color: var(--md-sys-color-primary);
|
||||
}
|
||||
|
||||
.chat-generation-stats.starting {
|
||||
animation: statsBlink 1.1s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes statsBlink {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.45; }
|
||||
}
|
||||
|
||||
/* ─── Thinking / Progress ─────────────────────────────────────── */
|
||||
.chat-thinking,
|
||||
.text-progress {
|
||||
display: flex;
|
||||
@@ -360,11 +556,31 @@ body {
|
||||
color: var(--md-sys-color-error);
|
||||
}
|
||||
|
||||
/* ─── Composer ────────────────────────────────────────────────── */
|
||||
.chat-composer {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
padding: 14px;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
padding: 12px 20px 16px;
|
||||
border-top: 1px solid var(--border-color);
|
||||
background: color-mix(in srgb, var(--md-sys-color-surface) 80%, transparent);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.chat-composer-inner {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 10px;
|
||||
background: var(--md-sys-color-surface-variant);
|
||||
border: 1.5px solid var(--border-color);
|
||||
border-radius: 20px;
|
||||
padding: 6px 6px 6px 14px;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.chat-composer-inner:focus-within {
|
||||
border-color: var(--md-sys-color-primary);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent);
|
||||
}
|
||||
|
||||
.chat-composer textarea,
|
||||
@@ -381,12 +597,125 @@ body {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.chat-composer-textarea {
|
||||
flex: 1;
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
color: var(--md-sys-color-on-surface);
|
||||
padding: 8px 0;
|
||||
font: inherit;
|
||||
font-size: 0.92rem;
|
||||
outline: none;
|
||||
resize: none;
|
||||
min-height: 36px;
|
||||
max-height: 160px;
|
||||
line-height: 1.55;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.chat-composer-textarea::placeholder {
|
||||
color: var(--md-sys-color-outline);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.chat-composer textarea {
|
||||
min-height: 48px;
|
||||
max-height: 160px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.chat-composer-send-btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
border: none;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.18s ease;
|
||||
background: linear-gradient(135deg, var(--md-sys-color-primary), color-mix(in srgb, var(--md-sys-color-primary) 75%, #7c3aed));
|
||||
color: var(--md-sys-color-on-primary);
|
||||
box-shadow: 0 2px 8px color-mix(in srgb, var(--md-sys-color-primary) 35%, transparent);
|
||||
}
|
||||
|
||||
.chat-composer-send-btn:hover:not(:disabled) {
|
||||
transform: scale(1.08);
|
||||
box-shadow: 0 4px 16px color-mix(in srgb, var(--md-sys-color-primary) 50%, transparent);
|
||||
}
|
||||
|
||||
.chat-composer-send-btn:active:not(:disabled) {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
.chat-composer-send-btn:disabled {
|
||||
background: var(--md-sys-color-surface-variant);
|
||||
color: var(--md-sys-color-outline);
|
||||
box-shadow: none;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.chat-composer-stop-btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
border: none;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.18s ease;
|
||||
background: color-mix(in srgb, var(--md-sys-color-error) 15%, var(--md-sys-color-surface-variant));
|
||||
color: var(--md-sys-color-error);
|
||||
border: 1.5px solid color-mix(in srgb, var(--md-sys-color-error) 40%, transparent);
|
||||
animation: stopPulse 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes stopPulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--md-sys-color-error) 30%, transparent); }
|
||||
50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--md-sys-color-error) 0%, transparent); }
|
||||
}
|
||||
|
||||
.chat-composer-stop-btn:hover {
|
||||
background: color-mix(in srgb, var(--md-sys-color-error) 22%, var(--md-sys-color-surface-variant));
|
||||
transform: scale(1.08);
|
||||
}
|
||||
|
||||
.chat-composer-attach-btn {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: 50%;
|
||||
border: none;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.18s ease;
|
||||
background: transparent;
|
||||
color: var(--md-sys-color-outline);
|
||||
}
|
||||
|
||||
.chat-composer-attach-btn:hover:not(:disabled) {
|
||||
background: color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent);
|
||||
color: var(--md-sys-color-primary);
|
||||
}
|
||||
|
||||
.chat-composer-attach-btn:disabled {
|
||||
opacity: 0.35;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.chat-composer-hint {
|
||||
text-align: center;
|
||||
font-size: 0.7rem;
|
||||
color: var(--md-sys-color-outline);
|
||||
margin-top: 6px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.text-chat-settings {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user