Alsmwal commited on
Commit
211f2d8
·
verified ·
1 Parent(s): 3d6940f

Update chat.html

Browse files
Files changed (1) hide show
  1. chat.html +36 -28
chat.html CHANGED
@@ -303,19 +303,23 @@
303
  /* Main Content */
304
  .main-content {
305
  margin-left: 250px;
306
- padding: 20px;
307
- min-height: 100vh;
 
 
 
308
  }
309
 
310
  .header-bar {
311
  display: flex;
312
  justify-content: space-between;
313
  align-items: center;
314
- margin-bottom: 10px;
 
315
  }
316
 
317
  .header-bar h1 {
318
- font-size: 32px;
319
  color: var(--olive-light);
320
  }
321
 
@@ -324,10 +328,10 @@
324
  height: 26px;
325
  background: var(--olive-light);
326
  border-radius: 13px;
327
- position: fixed;
328
- top: 20px;
329
- right: 20px;
330
- z-index: 1002;
331
  cursor: pointer;
332
  transition: all 0.3s ease;
333
  }
@@ -357,18 +361,11 @@
357
  .chat-area {
358
  display: flex;
359
  flex-direction: column;
360
- height: calc(100vh - 110px);
361
- height: calc(100dvh - 110px); /* Better mobile support */
362
- border-radius: 12px;
363
  overflow: hidden;
364
- }
365
-
366
- .light-mode .chat-area {
367
- background: var(--card-light);
368
- }
369
-
370
- .dark-mode .chat-area {
371
- background: var(--card-dark);
372
  }
373
 
374
  .messages-container {
@@ -710,8 +707,11 @@
710
 
711
  .main-content {
712
  margin-left: 0;
713
- padding: 60px 10px 10px 10px;
714
- height: 100dvh; /* Full viewport height on mobile */
 
 
 
715
  }
716
 
717
  .message-content {
@@ -862,9 +862,6 @@
862
  <!-- Mobile Menu Toggle -->
863
  <button class="menu-toggle" id="menuToggle">☰</button>
864
 
865
- <!-- Theme Toggle -->
866
- <div class="theme-toggle" id="themeToggle"></div>
867
-
868
  <!-- Sidebar Overlay for Mobile -->
869
  <div class="sidebar-overlay" id="sidebarOverlay"></div>
870
 
@@ -889,6 +886,7 @@
889
  <div class="main-content">
890
  <div class="header-bar">
891
  <h1>Welcome 👋</h1>
 
892
  </div>
893
 
894
  <!-- Chat Area -->
@@ -1487,10 +1485,6 @@
1487
  return false;
1488
  }
1489
 
1490
- if (role === CONFIG.ROLES.STUDENT) {
1491
- return true;
1492
- }
1493
-
1494
  try {
1495
  const response = await api.checkAuth();
1496
 
@@ -1507,6 +1501,20 @@
1507
  return false;
1508
  }
1509
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1510
  return true;
1511
  } catch (error) {
1512
  console.error('Auth check failed:', error);
 
303
  /* Main Content */
304
  .main-content {
305
  margin-left: 250px;
306
+ padding: 0;
307
+ height: 100vh;
308
+ height: 100dvh;
309
+ display: flex;
310
+ flex-direction: column;
311
  }
312
 
313
  .header-bar {
314
  display: flex;
315
  justify-content: space-between;
316
  align-items: center;
317
+ padding: 15px 20px;
318
+ flex-shrink: 0;
319
  }
320
 
321
  .header-bar h1 {
322
+ font-size: 24px;
323
  color: var(--olive-light);
324
  }
325
 
 
328
  height: 26px;
329
  background: var(--olive-light);
330
  border-radius: 13px;
331
+ position: relative;
332
+ top: auto;
333
+ right: auto;
334
+ z-index: 1;
335
  cursor: pointer;
336
  transition: all 0.3s ease;
337
  }
 
361
  .chat-area {
362
  display: flex;
363
  flex-direction: column;
364
+ flex: 1;
365
+ height: auto;
366
+ border-radius: 0;
367
  overflow: hidden;
368
+ background: transparent;
 
 
 
 
 
 
 
369
  }
370
 
371
  .messages-container {
 
707
 
708
  .main-content {
709
  margin-left: 0;
710
+ padding: 0;
711
+ }
712
+
713
+ .header-bar {
714
+ padding-left: 70px; /* Space for menu toggle */
715
  }
716
 
717
  .message-content {
 
862
  <!-- Mobile Menu Toggle -->
863
  <button class="menu-toggle" id="menuToggle">☰</button>
864
 
 
 
 
865
  <!-- Sidebar Overlay for Mobile -->
866
  <div class="sidebar-overlay" id="sidebarOverlay"></div>
867
 
 
886
  <div class="main-content">
887
  <div class="header-bar">
888
  <h1>Welcome 👋</h1>
889
+ <div class="theme-toggle" id="themeToggle"></div>
890
  </div>
891
 
892
  <!-- Chat Area -->
 
1485
  return false;
1486
  }
1487
 
 
 
 
 
1488
  try {
1489
  const response = await api.checkAuth();
1490
 
 
1501
  return false;
1502
  }
1503
 
1504
+ // Update Welcome Message with Name
1505
+ if (userData.email) {
1506
+ const namePart = userData.email.split('@')[0];
1507
+ // Replace dots/underscores with spaces and capitalize
1508
+ const displayName = namePart
1509
+ .replace(/[._]/g, ' ')
1510
+ .split(' ')
1511
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
1512
+ .join(' ');
1513
+
1514
+ const header = document.querySelector('.header-bar h1');
1515
+ if (header) header.textContent = `Welcome, ${displayName} 👋`;
1516
+ }
1517
+
1518
  return true;
1519
  } catch (error) {
1520
  console.error('Auth check failed:', error);