Spaces:
michdubai
/
Sleeping

michdubai commited on
Commit
bc6bc48
·
verified ·
1 Parent(s): ff1dbe1

Update frontend/js/main.js

Browse files
Files changed (1) hide show
  1. frontend/js/main.js +20 -18
frontend/js/main.js CHANGED
@@ -119,11 +119,16 @@ class GeminiApp {
119
  this.currentResponseElement = null;
120
  if (messagesContainer) {
121
  const userElement = document.createElement('div');
122
- userElement.className = 'message-row user-response';
123
- userElement.style.margin = "8px 0";
124
- userElement.style.padding = "6px";
125
- userElement.style.borderLeft = "3px solid #6366f1";
126
- userElement.innerHTML = `<strong>User:</strong> <span class="text-payload">${response.text || response.data || ''}</span>`;
 
 
 
 
 
127
  messagesContainer.appendChild(userElement);
128
  messagesContainer.scrollTop = messagesContainer.scrollHeight;
129
  }
@@ -140,14 +145,6 @@ class GeminiApp {
140
 
141
  case 'turn_complete':
142
  this.currentResponseElement = null; // Clear tracking pointers for next turn
143
- if (messagesContainer) {
144
- const hr = document.createElement('hr');
145
- hr.className = 'turn-divider';
146
- hr.style.opacity = "0.1";
147
- hr.style.margin = "12px 0";
148
- messagesContainer.appendChild(hr);
149
- messagesContainer.scrollTop = messagesContainer.scrollHeight;
150
- }
151
  break;
152
 
153
  default:
@@ -179,11 +176,16 @@ class GeminiApp {
179
  // If we aren't tracking a current container element, build a clean layout block
180
  if (!this.currentResponseElement) {
181
  this.currentResponseElement = document.createElement('div');
182
- this.currentResponseElement.className = 'message-row gemini-response';
183
- this.currentResponseElement.style.margin = "8px 0";
184
- this.currentResponseElement.style.padding = "6px";
185
- this.currentResponseElement.style.borderLeft = "3px solid #10b981";
186
- this.currentResponseElement.innerHTML = `<strong>Gemini:</strong> <span class="text-payload"></span>`;
 
 
 
 
 
187
  messagesContainer.appendChild(this.currentResponseElement);
188
  }
189
 
 
119
  this.currentResponseElement = null;
120
  if (messagesContainer) {
121
  const userElement = document.createElement('div');
122
+ userElement.className = 'message-row user-message';
123
+ userElement.innerHTML = `
124
+ <div class="message-header user-header">
125
+ <span class="speaker-icon user-icon">👤</span>
126
+ <span class="speaker-label">User</span>
127
+ </div>
128
+ <div class="message-content user-content">
129
+ <span class="text-payload">${response.text || response.data || ''}</span>
130
+ </div>
131
+ `;
132
  messagesContainer.appendChild(userElement);
133
  messagesContainer.scrollTop = messagesContainer.scrollHeight;
134
  }
 
145
 
146
  case 'turn_complete':
147
  this.currentResponseElement = null; // Clear tracking pointers for next turn
 
 
 
 
 
 
 
 
148
  break;
149
 
150
  default:
 
176
  // If we aren't tracking a current container element, build a clean layout block
177
  if (!this.currentResponseElement) {
178
  this.currentResponseElement = document.createElement('div');
179
+ this.currentResponseElement.className = 'message-row gemini-message';
180
+ this.currentResponseElement.innerHTML = `
181
+ <div class="message-header gemini-header">
182
+ <span class="speaker-icon gemini-icon">✨</span>
183
+ <span class="speaker-label">Gemini</span>
184
+ </div>
185
+ <div class="message-content gemini-content">
186
+ <span class="text-payload"></span>
187
+ </div>
188
+ `;
189
  messagesContainer.appendChild(this.currentResponseElement);
190
  }
191