Zhen Ye Claude Opus 4.6 (1M context) commited on
Commit
f14a5fa
Β·
1 Parent(s): 488b1d4

style(demo): elevate chat panel visual design

Browse files

- Glass morphism panel background with gradient + backdrop blur
- Context header with subtle accent gradient sweep
- Pill-shaped chips with accent-tinted borders, hover glow
- Suggestion chips with blue tint, hover shadow aura
- Messages with colored left-border accent (blue for user, purple for AI)
- Tooltip with deep shadow + accent-tinted border, smooth entrance
- Refined spacing, letter-spacing, font weights throughout
- Uses CSS variable system consistently (mission colors, accent, etc.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. demo/styles/chat.css +126 -87
demo/styles/chat.css CHANGED
@@ -6,16 +6,19 @@
6
  position: relative;
7
  max-height: 400px;
8
  overflow: hidden;
9
- transition: max-height 0.3s cubic-bezier(.4, 0, .2, 1);
 
10
  display: flex;
11
  flex-direction: column;
12
- background: var(--panel-bg);
13
- border-top: 1px solid var(--panel-border);
 
 
14
  }
15
 
16
  .chat-panel.collapsed {
17
  max-height: 0;
18
- border-top: none;
19
  }
20
 
21
  /* Chat Toggle Button */
@@ -34,57 +37,70 @@
34
  right: 12px;
35
  top: 50%;
36
  transform: translateY(-50%);
 
37
  }
38
 
39
  .chat-toggle:hover {
40
- color: var(--text-secondary);
41
  }
42
 
43
- /* Context Header */
 
44
  .chat-context-header {
45
  display: flex;
46
  align-items: center;
47
- gap: 6px;
48
- padding: 6px 16px;
49
- background: rgba(0,0,0,.15);
50
- border-bottom: 1px solid var(--panel-border);
51
  flex-wrap: wrap;
52
  flex-shrink: 0;
53
  }
54
 
55
  .chat-context-label {
56
- color: var(--text-tertiary);
57
- font-size: 10px;
 
58
  text-transform: uppercase;
59
- letter-spacing: 0.5px;
60
  flex-shrink: 0;
 
61
  }
62
 
63
  .chat-context-chips {
64
  display: flex;
65
  flex-wrap: wrap;
66
- gap: 4px;
67
  }
68
 
69
  .chat-context-chip {
70
  display: inline-flex;
71
  align-items: center;
72
- gap: 4px;
73
- background: rgba(255,255,255,.04);
74
- border: 1px solid var(--panel-border);
75
  color: var(--text-primary);
76
- padding: 2px 8px;
77
- border-radius: 4px;
78
  font-size: 11px;
79
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
 
 
 
 
 
 
 
80
  }
81
 
82
  .chat-context-chip .chip-label {
83
  color: var(--text-secondary);
 
 
84
  }
85
 
86
  .chat-context-chip .chip-status {
87
- font-size: 9px;
88
  line-height: 1;
89
  }
90
 
@@ -92,27 +108,35 @@
92
  .chat-context-chip .chip-status.no-match { color: var(--mission-nomatch); }
93
  .chat-context-chip .chip-status.unassessed { color: var(--text-tertiary); }
94
 
95
- /* Chip Hover Tooltip (mini track card) */
 
96
  .chip-tooltip {
97
  position: absolute;
98
  z-index: 20;
99
- background: rgba(2, 6, 23, 0.95);
100
- backdrop-filter: blur(12px);
101
- -webkit-backdrop-filter: blur(12px);
102
- border: 1px solid var(--panel-border);
103
- border-radius: 6px;
104
- padding: 8px 10px;
105
- min-width: 180px;
106
- max-width: 280px;
107
  pointer-events: none;
108
- animation: fadeSlideIn 0.15s ease;
 
 
 
 
 
 
 
109
  }
110
 
111
  .chip-tooltip .tt-header {
112
- font-size: 11px;
113
  font-weight: 600;
114
  color: var(--text-primary);
115
- margin-bottom: 6px;
116
  display: flex;
117
  align-items: center;
118
  gap: 6px;
@@ -126,112 +150,125 @@
126
 
127
  .chip-tooltip .tt-badge {
128
  font-size: 9px;
129
- font-weight: 600;
130
- padding: 1px 5px;
131
- border-radius: 3px;
132
- letter-spacing: 0.3px;
133
  }
134
 
135
  .chip-tooltip .tt-match {
136
- background: rgba(52, 211, 153, 0.15);
137
  color: var(--mission-match);
138
  border: 1px solid rgba(52, 211, 153, 0.25);
139
  }
140
 
141
  .chip-tooltip .tt-nomatch {
142
- background: rgba(248, 113, 113, 0.12);
143
  color: var(--mission-nomatch);
144
  border: 1px solid rgba(248, 113, 113, 0.2);
145
  }
146
 
147
  .chip-tooltip .tt-pending {
148
- background: rgba(255, 255, 255, 0.04);
149
- color: var(--text-tertiary);
150
- border: 1px solid rgba(255, 255, 255, 0.08);
151
  }
152
 
153
  .chip-tooltip .tt-metrics {
154
  display: flex;
155
- gap: 10px;
156
  font-size: 10px;
157
  color: var(--text-tertiary);
158
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
159
  margin-bottom: 4px;
 
 
 
 
 
 
160
  }
161
 
162
  .chip-tooltip .tt-reason {
163
- font-size: 10px;
164
  color: var(--text-secondary);
165
- line-height: 1.4;
166
- margin-top: 4px;
167
- border-top: 1px solid var(--panel-border);
168
- padding-top: 4px;
169
  }
170
 
171
- /* Suggestions */
 
172
  .chat-suggestions {
173
  display: flex;
174
- gap: 5px;
175
- padding: 6px 16px;
176
- border-bottom: 1px solid var(--panel-border);
177
  flex-wrap: wrap;
178
  flex-shrink: 0;
179
  overflow-x: auto;
180
  }
181
 
182
  .chat-suggestion-chip {
183
- background: rgba(255,255,255,.03);
184
- border: 1px solid var(--panel-border);
185
- color: var(--text-secondary);
186
- padding: 3px 10px;
187
- border-radius: 12px;
188
- font-size: 10px;
 
189
  cursor: pointer;
190
  white-space: nowrap;
191
- transition: all 0.15s ease;
 
192
  }
193
 
194
  .chat-suggestion-chip:hover {
195
- background: rgba(59, 130, 246, .1);
196
- border-color: rgba(59, 130, 246, .3);
197
- color: var(--text-primary);
 
198
  }
199
 
200
- /* Messages Area */
 
201
  .chat-messages {
202
  flex: 1;
203
  overflow-y: auto;
204
- padding: 8px 16px;
205
  display: flex;
206
  flex-direction: column;
207
- gap: 6px;
208
  min-height: 0;
209
  }
210
 
211
  .chat-msg {
212
- padding: 6px 10px;
213
- border-radius: 6px;
214
- font-size: 12px;
215
- line-height: 1.5;
216
- animation: fadeSlideIn 0.2s ease;
217
  }
218
 
219
- @keyframes fadeSlideIn {
220
- from { opacity: 0; transform: translateY(4px); }
221
  to { opacity: 1; transform: translateY(0); }
222
  }
223
 
224
  .chat-msg.user {
225
- background: rgba(59, 130, 246, .08);
226
- border: 1px solid rgba(59, 130, 246, .15);
227
- margin-left: 24px;
 
228
  color: var(--text-primary);
229
  }
230
 
231
  .chat-msg.assistant {
232
- background: rgba(255,255,255,.03);
233
- border: 1px solid var(--panel-border);
234
- margin-right: 24px;
 
235
  color: var(--text-secondary);
236
  }
237
 
@@ -240,30 +277,32 @@
240
  border: none;
241
  text-align: center;
242
  color: var(--text-tertiary);
243
- font-size: 11px;
244
- padding: 2px 0;
 
245
  }
246
 
247
  .chat-msg .msg-role {
248
- font-size: 10px;
249
- font-weight: 600;
250
  text-transform: uppercase;
251
- margin-bottom: 2px;
252
- opacity: 0.6;
 
253
  }
254
 
255
- .chat-msg.user .msg-role { color: var(--accent); }
256
- .chat-msg.assistant .msg-role { color: #8b5cf6; }
257
 
258
  .chat-msg.loading .msg-text::after {
259
  content: "";
260
  display: inline-block;
261
  width: 10px; height: 10px;
262
- border: 2px solid rgba(255,255,255,.1);
263
  border-top-color: var(--accent);
264
  border-radius: 50%;
265
  animation: spin 0.6s linear infinite;
266
- margin-left: 6px;
267
  vertical-align: middle;
268
  }
269
 
 
6
  position: relative;
7
  max-height: 400px;
8
  overflow: hidden;
9
+ transition: max-height 0.35s cubic-bezier(.4, 0, .2, 1),
10
+ border-color 0.3s ease;
11
  display: flex;
12
  flex-direction: column;
13
+ background: linear-gradient(180deg, rgba(2, 6, 23, 0.6) 0%, rgba(2, 6, 23, 0.3) 100%);
14
+ backdrop-filter: blur(16px);
15
+ -webkit-backdrop-filter: blur(16px);
16
+ border-top: 1px solid rgba(59, 130, 246, 0.08);
17
  }
18
 
19
  .chat-panel.collapsed {
20
  max-height: 0;
21
+ border-top-color: transparent;
22
  }
23
 
24
  /* Chat Toggle Button */
 
37
  right: 12px;
38
  top: 50%;
39
  transform: translateY(-50%);
40
+ transition: color 0.2s ease;
41
  }
42
 
43
  .chat-toggle:hover {
44
+ color: var(--accent-light);
45
  }
46
 
47
+ /* ── Context Header ──────────────────────────────────────────── */
48
+
49
  .chat-context-header {
50
  display: flex;
51
  align-items: center;
52
+ gap: 8px;
53
+ padding: 8px 16px;
54
+ background: linear-gradient(90deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
55
+ border-bottom: 1px solid rgba(255, 255, 255, 0.04);
56
  flex-wrap: wrap;
57
  flex-shrink: 0;
58
  }
59
 
60
  .chat-context-label {
61
+ color: var(--accent);
62
+ font-size: 9px;
63
+ font-weight: 700;
64
  text-transform: uppercase;
65
+ letter-spacing: 1.2px;
66
  flex-shrink: 0;
67
+ opacity: 0.7;
68
  }
69
 
70
  .chat-context-chips {
71
  display: flex;
72
  flex-wrap: wrap;
73
+ gap: 5px;
74
  }
75
 
76
  .chat-context-chip {
77
  display: inline-flex;
78
  align-items: center;
79
+ gap: 5px;
80
+ background: rgba(59, 130, 246, 0.06);
81
+ border: 1px solid rgba(59, 130, 246, 0.15);
82
  color: var(--text-primary);
83
+ padding: 3px 10px;
84
+ border-radius: 20px;
85
  font-size: 11px;
86
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
87
+ cursor: default;
88
+ transition: all 0.2s ease;
89
+ }
90
+
91
+ .chat-context-chip:hover {
92
+ background: rgba(59, 130, 246, 0.12);
93
+ border-color: rgba(59, 130, 246, 0.3);
94
  }
95
 
96
  .chat-context-chip .chip-label {
97
  color: var(--text-secondary);
98
+ font-family: 'Inter', sans-serif;
99
+ font-weight: 500;
100
  }
101
 
102
  .chat-context-chip .chip-status {
103
+ font-size: 8px;
104
  line-height: 1;
105
  }
106
 
 
108
  .chat-context-chip .chip-status.no-match { color: var(--mission-nomatch); }
109
  .chat-context-chip .chip-status.unassessed { color: var(--text-tertiary); }
110
 
111
+ /* ── Chip Hover Tooltip (mini track card) ────────────────────── */
112
+
113
  .chip-tooltip {
114
  position: absolute;
115
  z-index: 20;
116
+ background: rgba(2, 6, 23, 0.96);
117
+ backdrop-filter: blur(20px);
118
+ -webkit-backdrop-filter: blur(20px);
119
+ border: 1px solid rgba(59, 130, 246, 0.12);
120
+ border-radius: 8px;
121
+ padding: 10px 12px;
122
+ min-width: 200px;
123
+ max-width: 300px;
124
  pointer-events: none;
125
+ animation: tooltipIn 0.15s ease;
126
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
127
+ 0 0 1px rgba(59, 130, 246, 0.2);
128
+ }
129
+
130
+ @keyframes tooltipIn {
131
+ from { opacity: 0; transform: translateY(-4px); }
132
+ to { opacity: 1; transform: translateY(0); }
133
  }
134
 
135
  .chip-tooltip .tt-header {
136
+ font-size: 12px;
137
  font-weight: 600;
138
  color: var(--text-primary);
139
+ margin-bottom: 8px;
140
  display: flex;
141
  align-items: center;
142
  gap: 6px;
 
150
 
151
  .chip-tooltip .tt-badge {
152
  font-size: 9px;
153
+ font-weight: 700;
154
+ padding: 2px 6px;
155
+ border-radius: 4px;
156
+ letter-spacing: 0.5px;
157
  }
158
 
159
  .chip-tooltip .tt-match {
160
+ background: var(--mission-match-bg);
161
  color: var(--mission-match);
162
  border: 1px solid rgba(52, 211, 153, 0.25);
163
  }
164
 
165
  .chip-tooltip .tt-nomatch {
166
+ background: var(--mission-nomatch-bg);
167
  color: var(--mission-nomatch);
168
  border: 1px solid rgba(248, 113, 113, 0.2);
169
  }
170
 
171
  .chip-tooltip .tt-pending {
172
+ background: var(--mission-unassessed-bg);
173
+ color: var(--mission-unassessed);
174
+ border: 1px solid rgba(100, 116, 139, 0.2);
175
  }
176
 
177
  .chip-tooltip .tt-metrics {
178
  display: flex;
179
+ gap: 12px;
180
  font-size: 10px;
181
  color: var(--text-tertiary);
182
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
183
  margin-bottom: 4px;
184
+ padding: 4px 0;
185
+ }
186
+
187
+ .chip-tooltip .tt-metrics span {
188
+ display: flex;
189
+ gap: 3px;
190
  }
191
 
192
  .chip-tooltip .tt-reason {
193
+ font-size: 11px;
194
  color: var(--text-secondary);
195
+ line-height: 1.5;
196
+ margin-top: 6px;
197
+ border-top: 1px solid rgba(255, 255, 255, 0.04);
198
+ padding-top: 6px;
199
  }
200
 
201
+ /* ── Suggestion Chips ────────────────────────────────────────── */
202
+
203
  .chat-suggestions {
204
  display: flex;
205
+ gap: 6px;
206
+ padding: 8px 16px;
207
+ border-bottom: 1px solid rgba(255, 255, 255, 0.03);
208
  flex-wrap: wrap;
209
  flex-shrink: 0;
210
  overflow-x: auto;
211
  }
212
 
213
  .chat-suggestion-chip {
214
+ background: rgba(59, 130, 246, 0.04);
215
+ border: 1px solid rgba(59, 130, 246, 0.12);
216
+ color: var(--accent-light);
217
+ padding: 5px 14px;
218
+ border-radius: 20px;
219
+ font-size: 11px;
220
+ font-weight: 500;
221
  cursor: pointer;
222
  white-space: nowrap;
223
+ transition: all 0.2s ease;
224
+ letter-spacing: 0.1px;
225
  }
226
 
227
  .chat-suggestion-chip:hover {
228
+ background: rgba(59, 130, 246, 0.12);
229
+ border-color: rgba(59, 130, 246, 0.35);
230
+ color: #fff;
231
+ box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
232
  }
233
 
234
+ /* ── Messages Area ───────────────────────────────────────────── */
235
+
236
  .chat-messages {
237
  flex: 1;
238
  overflow-y: auto;
239
+ padding: 10px 16px;
240
  display: flex;
241
  flex-direction: column;
242
+ gap: 8px;
243
  min-height: 0;
244
  }
245
 
246
  .chat-msg {
247
+ padding: 8px 12px;
248
+ border-radius: 8px;
249
+ font-size: 12.5px;
250
+ line-height: 1.6;
251
+ animation: msgSlideIn 0.25s ease;
252
  }
253
 
254
+ @keyframes msgSlideIn {
255
+ from { opacity: 0; transform: translateY(6px); }
256
  to { opacity: 1; transform: translateY(0); }
257
  }
258
 
259
  .chat-msg.user {
260
+ background: rgba(59, 130, 246, 0.08);
261
+ border: 1px solid rgba(59, 130, 246, 0.12);
262
+ border-left: 2px solid var(--accent);
263
+ margin-left: 20px;
264
  color: var(--text-primary);
265
  }
266
 
267
  .chat-msg.assistant {
268
+ background: rgba(255, 255, 255, 0.02);
269
+ border: 1px solid rgba(255, 255, 255, 0.04);
270
+ border-left: 2px solid rgba(139, 92, 246, 0.4);
271
+ margin-right: 20px;
272
  color: var(--text-secondary);
273
  }
274
 
 
277
  border: none;
278
  text-align: center;
279
  color: var(--text-tertiary);
280
+ font-size: 10px;
281
+ padding: 4px 0;
282
+ letter-spacing: 0.3px;
283
  }
284
 
285
  .chat-msg .msg-role {
286
+ font-size: 9px;
287
+ font-weight: 700;
288
  text-transform: uppercase;
289
+ letter-spacing: 0.8px;
290
+ margin-bottom: 3px;
291
+ opacity: 0.5;
292
  }
293
 
294
+ .chat-msg.user .msg-role { color: var(--accent-light); }
295
+ .chat-msg.assistant .msg-role { color: #a78bfa; }
296
 
297
  .chat-msg.loading .msg-text::after {
298
  content: "";
299
  display: inline-block;
300
  width: 10px; height: 10px;
301
+ border: 2px solid rgba(255,255,255,.08);
302
  border-top-color: var(--accent);
303
  border-radius: 50%;
304
  animation: spin 0.6s linear infinite;
305
+ margin-left: 8px;
306
  vertical-align: middle;
307
  }
308