nixaut-codelabs commited on
Commit
dd26076
·
verified ·
1 Parent(s): 1117279

chat history tasarımınıı yenile berbat durumda şuanda

Browse files
Files changed (1) hide show
  1. components/sidebar.js +99 -46
components/sidebar.js CHANGED
@@ -54,28 +54,29 @@ this.shadowRoot.innerHTML = `
54
  .new-chat-btn:active {
55
  transform: translateY(0);
56
  }
57
- .chat-history-section {
58
  margin-bottom: 2rem;
 
59
  }
60
 
61
  .nav-title {
62
- font-size: 0.75rem;
63
  font-weight: 600;
64
  color: #71717a;
65
  text-transform: uppercase;
66
  letter-spacing: 0.05em;
67
- padding: 0 1.5rem;
68
- margin-bottom: 0.75rem;
69
  }
70
 
71
  .chat-history {
72
  max-height: 400px;
73
  overflow-y: auto;
74
- padding-right: 0.5rem;
75
  }
76
 
77
  .chat-history::-webkit-scrollbar {
78
- width: 4px;
79
  }
80
 
81
  .chat-history::-webkit-scrollbar-track {
@@ -83,51 +84,86 @@ this.shadowRoot.innerHTML = `
83
  }
84
 
85
  .chat-history::-webkit-scrollbar-thumb {
86
- background: #525252;
87
- border-radius: 2px;
 
 
 
 
88
  }
89
 
90
  .chat-item {
91
  position: relative;
92
- margin-right: 0.75rem;
93
  margin-bottom: 0.25rem;
 
 
94
  }
95
 
96
  .chat-item-content {
97
- padding: 0.75rem 1.25rem 0.75rem 1.5rem;
98
- color: #9ca3af;
99
- font-size: 0.875rem;
100
  cursor: pointer;
101
- transition: all 0.2s ease;
102
- border-radius: 0 8px 8px 0;
103
  display: flex;
104
  align-items: center;
105
  gap: 0.5rem;
106
  position: relative;
107
- line-height: 1.4;
 
 
108
  }
109
 
110
  .chat-item-content:hover {
111
  color: #ffffff;
112
- background: rgba(255, 255, 255, 0.06);
 
 
113
  }
114
 
115
  .chat-item-content.active {
116
  color: #ffffff;
117
- background: rgba(255, 255, 255, 0.12);
 
 
118
  }
119
 
120
  .history-icon {
121
- width: 16px;
122
- height: 16px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  }
124
 
125
  .divider {
126
  height: 1px;
127
- background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
128
- margin: 1.5rem 1.5rem 1rem;
 
129
  }
130
- .media-btn {
131
  display: flex;
132
  align-items: center;
133
  gap: 0.75rem;
@@ -207,26 +243,43 @@ this.shadowRoot.innerHTML = `
207
  color: #9ca3af;
208
  font-size: 0.75rem;
209
  }
210
- @media (max-width: 768px) {
211
  .sidebar {
212
  position: fixed;
213
  transform: translateX(-100%);
 
214
  }
215
 
216
  .sidebar.active {
217
  transform: translateX(0);
218
  }
219
 
220
- .fixed.bottom-0 {
221
  position: fixed;
222
  transform: translateX(-100%);
 
 
223
  }
224
 
225
- .sidebar.active ~ .fixed.bottom-0,
226
- .fixed.bottom-0.active {
227
  transform: translateX(0);
228
  }
229
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  </style>
231
 
232
  <nav class="sidebar">
@@ -248,14 +301,14 @@ this.shadowRoot.innerHTML = `
248
  </button>
249
  <!-- Chat History Section -->
250
  <div class="chat-history-section">
251
- <div class="nav-title">Today
252
- <div class="chat-history" id="recentChats">
253
  <div class="chat-item" data-id="1">
254
  <div class="chat-item-content" onclick="loadChatHistory(1)">
255
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
256
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
257
  </svg>
258
- <span class="chat-title">Website Redesign Discussion</span>
259
  </div>
260
  </div>
261
 
@@ -264,7 +317,7 @@ this.shadowRoot.innerHTML = `
264
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
265
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
266
  </svg>
267
- <span class="chat-title">JavaScript Performance Tips</span>
268
  </div>
269
  </div>
270
 
@@ -273,7 +326,7 @@ this.shadowRoot.innerHTML = `
273
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
274
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
275
  </svg>
276
- <span class="chat-title">React Architecture Planning</span>
277
  </div>
278
  </div>
279
 
@@ -282,7 +335,7 @@ this.shadowRoot.innerHTML = `
282
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
283
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
284
  </svg>
285
- <span class="chat-title">Machine Learning Basics</span>
286
  </div>
287
  </div>
288
 
@@ -291,7 +344,7 @@ this.shadowRoot.innerHTML = `
291
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
292
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
293
  </svg>
294
- <span class="chat-title">API Best Practices Guide</span>
295
  </div>
296
  </div>
297
  </div>
@@ -305,7 +358,7 @@ this.shadowRoot.innerHTML = `
305
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
306
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
307
  </svg>
308
- <span class="chat-title">Data Analysis Report</span>
309
  </div>
310
  </div>
311
 
@@ -314,7 +367,7 @@ this.shadowRoot.innerHTML = `
314
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
315
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
316
  </svg>
317
- <span class="chat-title">Cloud Architecture Review</span>
318
  </div>
319
  </div>
320
  </div>
@@ -328,7 +381,7 @@ this.shadowRoot.innerHTML = `
328
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
329
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
330
  </svg>
331
- <span class="chat-title">Database Optimization Tips</span>
332
  </div>
333
  </div>
334
 
@@ -346,27 +399,26 @@ this.shadowRoot.innerHTML = `
346
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
347
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
348
  </svg>
349
- <span class="chat-title">UI/UX Design Principles</span>
350
  </div>
351
  </div>
352
  </div>
353
  </div>
354
- </nav>
355
  <!-- User Card at Bottom -->
356
- <div class="user-card" id="userCard">
357
- <button onclick="openAccount()" class="user-card-btn">
358
- <div class="user-avatar">
359
  U
360
  </div>
361
- <div class="user-info">
362
- <div class="user-name">User Name</div>
363
- <div class="user-email">[email protected]</div>
364
  </div>
365
- <svg class="user-menu-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
366
  <circle cx="12" cy="12" r="1"/>
367
  <circle cx="19" cy="12" r="1"/>
368
  <circle cx="5" cy="12" r="1"/>
369
- <path d="M19 9v6M5 9v6M19 5v4M5 5v4M19 15v4M5 15v4"/>
370
  </svg>
371
  </button>
372
  </div>
@@ -410,6 +462,7 @@ this.shadowRoot.innerHTML = `
410
  sidebar.classList.toggle('active');
411
  userCard.classList.toggle('active');
412
  };
 
413
  document.body.appendChild(menuButton);
414
  }
415
  }
 
54
  .new-chat-btn:active {
55
  transform: translateY(0);
56
  }
57
+ .chat-history-section {
58
  margin-bottom: 2rem;
59
+ padding: 0 1rem;
60
  }
61
 
62
  .nav-title {
63
+ font-size: 0.65rem;
64
  font-weight: 600;
65
  color: #71717a;
66
  text-transform: uppercase;
67
  letter-spacing: 0.05em;
68
+ padding: 0 0.5rem;
69
+ margin-bottom: 0.5rem;
70
  }
71
 
72
  .chat-history {
73
  max-height: 400px;
74
  overflow-y: auto;
75
+ padding-right: 0.25rem;
76
  }
77
 
78
  .chat-history::-webkit-scrollbar {
79
+ width: 3px;
80
  }
81
 
82
  .chat-history::-webkit-scrollbar-track {
 
84
  }
85
 
86
  .chat-history::-webkit-scrollbar-thumb {
87
+ background: rgba(255, 255, 255, 0.2);
88
+ border-radius: 3px;
89
+ }
90
+
91
+ .chat-history::-webkit-scrollbar-thumb:hover {
92
+ background: rgba(255, 255, 255, 0.3);
93
  }
94
 
95
  .chat-item {
96
  position: relative;
 
97
  margin-bottom: 0.25rem;
98
+ border-radius: 8px;
99
+ overflow: hidden;
100
  }
101
 
102
  .chat-item-content {
103
+ padding: 0.625rem 0.75rem;
104
+ color: #a1a1aa;
105
+ font-size: 0.8125rem;
106
  cursor: pointer;
107
+ transition: all 0.15s ease;
108
+ border-radius: 6px;
109
  display: flex;
110
  align-items: center;
111
  gap: 0.5rem;
112
  position: relative;
113
+ line-height: 1.3;
114
+ border: 1px solid transparent;
115
+ background: rgba(255, 255, 255, 0.02);
116
  }
117
 
118
  .chat-item-content:hover {
119
  color: #ffffff;
120
+ background: rgba(255, 255, 255, 0.08);
121
+ border-color: rgba(255, 255, 255, 0.1);
122
+ transform: translateX(2px);
123
  }
124
 
125
  .chat-item-content.active {
126
  color: #ffffff;
127
+ background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
128
+ border-color: rgba(255, 255, 255, 0.2);
129
+ box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
130
  }
131
 
132
  .history-icon {
133
+ width: 14px;
134
+ height: 14px;
135
+ opacity: 0.7;
136
+ flex-shrink: 0;
137
+ }
138
+
139
+ .chat-item-content:hover .history-icon {
140
+ opacity: 1;
141
+ }
142
+
143
+ .chat-item-content.active .history-icon {
144
+ opacity: 1;
145
+ color: #ffffff;
146
+ }
147
+
148
+ .chat-title {
149
+ flex: 1;
150
+ overflow: hidden;
151
+ text-overflow: ellipsis;
152
+ white-space: nowrap;
153
+ }
154
+
155
+ .chat-item-content:hover .chat-title {
156
+ white-space: normal;
157
+ overflow: visible;
158
  }
159
 
160
  .divider {
161
  height: 1px;
162
+ background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.08), transparent);
163
+ margin: 1.25rem 0.5rem 0.75rem;
164
+ opacity: 0.7;
165
  }
166
+ .media-btn {
167
  display: flex;
168
  align-items: center;
169
  gap: 0.75rem;
 
243
  color: #9ca3af;
244
  font-size: 0.75rem;
245
  }
246
+ @media (max-width: 768px) {
247
  .sidebar {
248
  position: fixed;
249
  transform: translateX(-100%);
250
+ z-index: 40;
251
  }
252
 
253
  .sidebar.active {
254
  transform: translateX(0);
255
  }
256
 
257
+ #userCard {
258
  position: fixed;
259
  transform: translateX(-100%);
260
+ width: 280px;
261
+ z-index: 40;
262
  }
263
 
264
+ .sidebar.active ~ #userCard,
265
+ #userCard.active {
266
  transform: translateX(0);
267
  }
268
  }
269
+
270
+ @media (min-width: 769px) {
271
+ #userCard {
272
+ position: absolute !important;
273
+ bottom: 0 !important;
274
+ left: 0 !important;
275
+ right: auto !important;
276
+ width: 100% !important;
277
+ transform: none !important;
278
+ border-left: none !important;
279
+ border-right: none !important;
280
+ border-bottom: none !important;
281
+ }
282
+ }
283
  </style>
284
 
285
  <nav class="sidebar">
 
301
  </button>
302
  <!-- Chat History Section -->
303
  <div class="chat-history-section">
304
+ <div class="nav-title">Today</div>
305
+ <div class="chat-history" id="recentChats">
306
  <div class="chat-item" data-id="1">
307
  <div class="chat-item-content" onclick="loadChatHistory(1)">
308
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
309
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
310
  </svg>
311
+ <span class="chat-title">Website Redesign</span>
312
  </div>
313
  </div>
314
 
 
317
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
318
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
319
  </svg>
320
+ <span class="chat-title">JS Performance Tips</span>
321
  </div>
322
  </div>
323
 
 
326
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
327
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
328
  </svg>
329
+ <span class="chat-title">React Architecture</span>
330
  </div>
331
  </div>
332
 
 
335
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
336
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
337
  </svg>
338
+ <span class="chat-title">ML Basics</span>
339
  </div>
340
  </div>
341
 
 
344
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
345
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
346
  </svg>
347
+ <span class="chat-title">API Best Practices</span>
348
  </div>
349
  </div>
350
  </div>
 
358
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
359
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
360
  </svg>
361
+ <span class="chat-title">Data Analysis</span>
362
  </div>
363
  </div>
364
 
 
367
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
368
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
369
  </svg>
370
+ <span class="chat-title">Cloud Architecture</span>
371
  </div>
372
  </div>
373
  </div>
 
381
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
382
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
383
  </svg>
384
+ <span class="chat-title">Database Optimization</span>
385
  </div>
386
  </div>
387
 
 
399
  <svg class="history-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
400
  <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
401
  </svg>
402
+ <span class="chat-title">UI/UX Design</span>
403
  </div>
404
  </div>
405
  </div>
406
  </div>
407
+ </nav>
408
  <!-- User Card at Bottom -->
409
+ <div class="fixed bottom-0 left-0 right-0 bg-zinc-900/90 backdrop-blur-xl border-t border-zinc-800/60 p-3 z-30" style="margin-left: 0;" id="userCard">
410
+ <button onclick="openAccount()" class="w-full flex items-center gap-2.5 p-2 rounded-lg hover:bg-zinc-800/60 transition-colors duration-200">
411
+ <div class="w-8 h-8 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-sm font-semibold">
412
  U
413
  </div>
414
+ <div class="flex-1 text-left">
415
+ <div class="text-white text-sm font-medium">User Name</div>
416
+ <div class="text-zinc-400 text-xs">[email protected]</div>
417
  </div>
418
+ <svg class="w-4 h-4 text-zinc-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
419
  <circle cx="12" cy="12" r="1"/>
420
  <circle cx="19" cy="12" r="1"/>
421
  <circle cx="5" cy="12" r="1"/>
 
422
  </svg>
423
  </button>
424
  </div>
 
462
  sidebar.classList.toggle('active');
463
  userCard.classList.toggle('active');
464
  };
465
+ =======
466
  document.body.appendChild(menuButton);
467
  }
468
  }