nixaut-codelabs commited on
Commit
bd4ac44
·
verified ·
1 Parent(s): f6543dc

The sidebar goes inside the chat section of the site. Fix it to the left so that it doesn't conflict with the chat section. Do correct tool call

Browse files
Files changed (3) hide show
  1. index.html +2 -2
  2. script.js +4 -3
  3. style.css +21 -0
index.html CHANGED
@@ -62,8 +62,8 @@
62
  <!-- Main Container -->
63
  <div class="flex h-screen relative z-10">
64
  <custom-sidebar></custom-sidebar>
65
- <!-- Main Chat Area -->
66
- <main class="flex-1 flex flex-col bg-zinc-950 relative overflow-hidden max-h-screen">
67
  <!-- Messages Container -->
68
  <div id="chatContainer" class="flex-1 overflow-y-auto scroll-smooth p-4 space-y-4" style="scrollbar-width: thin; scrollbar-color: #525252 #18181b;">
69
  <!-- AI Welcome Message -->
 
62
  <!-- Main Container -->
63
  <div class="flex h-screen relative z-10">
64
  <custom-sidebar></custom-sidebar>
65
+ <!-- Main Chat Area -->
66
+ <main class="flex-1 flex flex-col bg-zinc-950 relative overflow-hidden max-h-screen ml-[260px]">
67
  <!-- Messages Container -->
68
  <div id="chatContainer" class="flex-1 overflow-y-auto scroll-smooth p-4 space-y-4" style="scrollbar-width: thin; scrollbar-color: #525252 #18181b;">
69
  <!-- AI Welcome Message -->
script.js CHANGED
@@ -74,7 +74,6 @@ function initializeSidebarToggle() {
74
  main.style.marginLeft = '0';
75
  }
76
  }
77
-
78
  function toggleSidebar() {
79
  const sidebar = document.querySelector('.sidebar');
80
  const main = document.querySelector('main');
@@ -83,12 +82,14 @@ function toggleSidebar() {
83
 
84
  if (sidebarCollapsed) {
85
  sidebar.style.transform = 'translateX(-100%)';
86
- main.style.marginLeft = '0';
87
  main.style.width = '100%';
 
88
  } else {
89
  sidebar.style.transform = 'translateX(0)';
90
- main.style.marginLeft = '260px';
91
  main.style.width = 'calc(100% - 260px)';
 
92
  }
93
  }
94
  function sendMessage() {
 
74
  main.style.marginLeft = '0';
75
  }
76
  }
 
77
  function toggleSidebar() {
78
  const sidebar = document.querySelector('.sidebar');
79
  const main = document.querySelector('main');
 
82
 
83
  if (sidebarCollapsed) {
84
  sidebar.style.transform = 'translateX(-100%)';
85
+ main.style.left = '0';
86
  main.style.width = '100%';
87
+ main.style.marginLeft = '0';
88
  } else {
89
  sidebar.style.transform = 'translateX(0)';
90
+ main.style.left = '260px';
91
  main.style.width = 'calc(100% - 260px)';
92
+ main.style.marginLeft = '0';
93
  }
94
  }
95
  function sendMessage() {
style.css CHANGED
@@ -163,6 +163,27 @@ main {
163
  main {
164
  transition: margin-left 0.3s ease;
165
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  /* Sidebar Transitions */
167
  .sidebar {
168
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
 
163
  main {
164
  transition: margin-left 0.3s ease;
165
  }
166
+
167
+ /* Sidebar container positioning */
168
+ .flex {
169
+ position: relative;
170
+ }
171
+
172
+ /* Ensure sidebar is properly positioned */
173
+ custom-sidebar {
174
+ position: fixed !important;
175
+ left: 0;
176
+ top: 0;
177
+ height: 100vh;
178
+ z-index: 1000;
179
+ }
180
+
181
+ /* Make sure main content doesn't overlap with sidebar */
182
+ main {
183
+ position: relative !important;
184
+ left: 260px;
185
+ width: calc(100% - 260px);
186
+ }
187
  /* Sidebar Transitions */
188
  .sidebar {
189
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);