Ahmad140 commited on
Commit
c632d24
·
verified ·
1 Parent(s): e086619

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +22 -17
index.html CHANGED
@@ -20,8 +20,9 @@
20
  .chat-modal { position: fixed; bottom: 100px; right: 28px; width: 540px; height: 650px; background: rgba(255,255,255,0.98); border-radius: 28px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35); display: none; flex-direction: column; overflow: hidden; z-index: 1001; animation: slideUpFade 0.3s ease-out; }
21
  @keyframes slideUpFade { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
22
  .chat-header { background: linear-gradient(135deg, #075E54, #0b3b32); color: white; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; }
23
- .close-btn { background: rgba(255,255,255,0.2); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: white; transition: 0.2s; }
24
- .close-btn:hover { transform: rotate(90deg); background: rgba(255,255,255,0.4); }
 
25
 
26
  /* Two-column layout */
27
  .chat-invoice-container { display: flex; flex: 1; overflow: hidden; transition: all 0.3s ease; }
@@ -31,9 +32,6 @@
31
  .chat-column.expanded { flex: 1; }
32
 
33
  .invoice-title { font-weight: 700; font-size: 1rem; color: #075E54; border-bottom: 2px solid #25D366; padding-bottom: 6px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
34
- .invoice-title button { background: none; border: none; color: #075E54; cursor: pointer; font-size: 1rem; transition: 0.2s; }
35
- .invoice-title button:hover { transform: scale(1.1); color: #25D366; }
36
-
37
  .invoice-items { flex: 1; overflow-y: auto; max-height: 350px; }
38
  .invoice-item { background: white; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
39
  .invoice-item-name { font-weight: 500; font-size: 0.8rem; }
@@ -85,13 +83,16 @@
85
  <div class="chat-modal" id="chatModal">
86
  <div class="chat-header">
87
  <h3><i class="fas fa-robot"></i> Elite Visuals AI</h3>
88
- <button class="close-btn" id="closeChat"><i class="fas fa-times"></i></button>
 
 
 
89
  </div>
90
  <div class="chat-invoice-container" id="chatInvoiceContainer">
91
  <!-- Chat Column -->
92
  <div class="chat-column" id="chatColumn">
93
  <div class="chat-messages" id="chatMessages">
94
- <div class="message bot-msg">✨ Assalam-o-Alaikum! Ask me about website packages, e‑commerce, SEO, or extra features. .</div>
95
  <!-- Live Widget -->
96
  <div class="live-widget" id="liveWidget">
97
  <div class="widget-header">
@@ -114,11 +115,10 @@
114
  <button id="sendBtn"><i class="fas fa-paper-plane"></i></button>
115
  </div>
116
  </div>
117
- <!-- Invoice Column (with hide/unhide button) -->
118
  <div class="invoice-column" id="invoiceColumn">
119
  <div class="invoice-title">
120
  <span>🧾 Your Quote</span>
121
- <button id="toggleInvoiceBtn" title="Hide/Show Invoice"><i class="fas fa-eye-slash"></i></button>
122
  </div>
123
  <div class="invoice-items" id="invoiceItems">
124
  <div class="empty-invoice">✨ No services selected yet.<br>Ask or confirm a package to add.</div>
@@ -204,20 +204,24 @@
204
  return true;
205
  }
206
 
207
- // ---------- Invoice Hide/Unhide Toggle ----------
208
  const invoiceColumn = document.getElementById('invoiceColumn');
209
  const chatColumn = document.getElementById('chatColumn');
210
  const toggleInvoiceBtn = document.getElementById('toggleInvoiceBtn');
211
  let invoiceHidden = false;
212
  toggleInvoiceBtn.addEventListener('click', () => {
213
  if (invoiceHidden) {
 
214
  invoiceColumn.classList.remove('hidden');
215
  chatColumn.classList.remove('expanded');
216
  toggleInvoiceBtn.innerHTML = '<i class="fas fa-eye-slash"></i>';
 
217
  } else {
 
218
  invoiceColumn.classList.add('hidden');
219
  chatColumn.classList.add('expanded');
220
  toggleInvoiceBtn.innerHTML = '<i class="fas fa-eye"></i>';
 
221
  }
222
  invoiceHidden = !invoiceHidden;
223
  });
@@ -289,12 +293,13 @@
289
 
290
  // ---------- Message with Confirm Button ----------
291
  function addMessageWithConfirm(text, sender, widgetData = null) {
 
292
  if (sender === 'user') {
293
  const div = document.createElement('div');
294
  div.className = 'message user-msg';
295
  div.innerText = text;
296
- chatMessages.appendChild(div);
297
- chatMessages.scrollTop = chatMessages.scrollHeight;
298
  return;
299
  }
300
  const wrapper = document.createElement('div');
@@ -332,8 +337,8 @@
332
  };
333
  wrapper.appendChild(confirmBtn);
334
  }
335
- chatMessages.appendChild(wrapper);
336
- chatMessages.scrollTop = chatMessages.scrollHeight;
337
  }
338
 
339
  // ---------- Chat UI ----------
@@ -342,7 +347,7 @@
342
  const closeChat = document.getElementById('closeChat');
343
  const sendBtn = document.getElementById('sendBtn');
344
  const userInput = document.getElementById('userInput');
345
- const chatMessages = document.getElementById('chatMessages');
346
  const questionsContainer = document.getElementById('defaultQuestionsContainer');
347
 
348
  function renderQuestionBubbles() {
@@ -362,8 +367,8 @@
362
  typingDiv = document.createElement('div');
363
  typingDiv.className = 'typing-indicator';
364
  typingDiv.innerHTML = '<span></span><span></span><span></span>';
365
- chatMessages.appendChild(typingDiv);
366
- chatMessages.scrollTop = chatMessages.scrollHeight;
367
  }
368
  function hideTyping() {
369
  if (typingDiv) { typingDiv.remove(); typingDiv = null; }
 
20
  .chat-modal { position: fixed; bottom: 100px; right: 28px; width: 540px; height: 650px; background: rgba(255,255,255,0.98); border-radius: 28px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35); display: none; flex-direction: column; overflow: hidden; z-index: 1001; animation: slideUpFade 0.3s ease-out; }
21
  @keyframes slideUpFade { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
22
  .chat-header { background: linear-gradient(135deg, #075E54, #0b3b32); color: white; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; }
23
+ .header-buttons { display: flex; gap: 12px; align-items: center; }
24
+ .header-btn { background: rgba(255,255,255,0.2); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: white; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; }
25
+ .header-btn:hover { transform: scale(1.05); background: rgba(255,255,255,0.4); }
26
 
27
  /* Two-column layout */
28
  .chat-invoice-container { display: flex; flex: 1; overflow: hidden; transition: all 0.3s ease; }
 
32
  .chat-column.expanded { flex: 1; }
33
 
34
  .invoice-title { font-weight: 700; font-size: 1rem; color: #075E54; border-bottom: 2px solid #25D366; padding-bottom: 6px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
 
 
 
35
  .invoice-items { flex: 1; overflow-y: auto; max-height: 350px; }
36
  .invoice-item { background: white; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
37
  .invoice-item-name { font-weight: 500; font-size: 0.8rem; }
 
83
  <div class="chat-modal" id="chatModal">
84
  <div class="chat-header">
85
  <h3><i class="fas fa-robot"></i> Elite Visuals AI</h3>
86
+ <div class="header-buttons">
87
+ <button class="header-btn" id="toggleInvoiceBtn" title="Toggle Invoice Panel"><i class="fas fa-eye-slash"></i></button>
88
+ <button class="header-btn" id="closeChat"><i class="fas fa-times"></i></button>
89
+ </div>
90
  </div>
91
  <div class="chat-invoice-container" id="chatInvoiceContainer">
92
  <!-- Chat Column -->
93
  <div class="chat-column" id="chatColumn">
94
  <div class="chat-messages" id="chatMessages">
95
+ <div class="message bot-msg">✨ Assalam-o-Alaikum! Ask me about website packages, e‑commerce, SEO, or extra features.</div>
96
  <!-- Live Widget -->
97
  <div class="live-widget" id="liveWidget">
98
  <div class="widget-header">
 
115
  <button id="sendBtn"><i class="fas fa-paper-plane"></i></button>
116
  </div>
117
  </div>
118
+ <!-- Invoice Column -->
119
  <div class="invoice-column" id="invoiceColumn">
120
  <div class="invoice-title">
121
  <span>🧾 Your Quote</span>
 
122
  </div>
123
  <div class="invoice-items" id="invoiceItems">
124
  <div class="empty-invoice">✨ No services selected yet.<br>Ask or confirm a package to add.</div>
 
204
  return true;
205
  }
206
 
207
+ // ---------- Invoice Hide/Unhide Toggle (Button in Header) ----------
208
  const invoiceColumn = document.getElementById('invoiceColumn');
209
  const chatColumn = document.getElementById('chatColumn');
210
  const toggleInvoiceBtn = document.getElementById('toggleInvoiceBtn');
211
  let invoiceHidden = false;
212
  toggleInvoiceBtn.addEventListener('click', () => {
213
  if (invoiceHidden) {
214
+ // Unhide
215
  invoiceColumn.classList.remove('hidden');
216
  chatColumn.classList.remove('expanded');
217
  toggleInvoiceBtn.innerHTML = '<i class="fas fa-eye-slash"></i>';
218
+ toggleInvoiceBtn.title = "Hide Invoice Panel";
219
  } else {
220
+ // Hide
221
  invoiceColumn.classList.add('hidden');
222
  chatColumn.classList.add('expanded');
223
  toggleInvoiceBtn.innerHTML = '<i class="fas fa-eye"></i>';
224
+ toggleInvoiceBtn.title = "Show Invoice Panel";
225
  }
226
  invoiceHidden = !invoiceHidden;
227
  });
 
293
 
294
  // ---------- Message with Confirm Button ----------
295
  function addMessageWithConfirm(text, sender, widgetData = null) {
296
+ const chatMessagesDiv = document.getElementById('chatMessages');
297
  if (sender === 'user') {
298
  const div = document.createElement('div');
299
  div.className = 'message user-msg';
300
  div.innerText = text;
301
+ chatMessagesDiv.appendChild(div);
302
+ chatMessagesDiv.scrollTop = chatMessagesDiv.scrollHeight;
303
  return;
304
  }
305
  const wrapper = document.createElement('div');
 
337
  };
338
  wrapper.appendChild(confirmBtn);
339
  }
340
+ chatMessagesDiv.appendChild(wrapper);
341
+ chatMessagesDiv.scrollTop = chatMessagesDiv.scrollHeight;
342
  }
343
 
344
  // ---------- Chat UI ----------
 
347
  const closeChat = document.getElementById('closeChat');
348
  const sendBtn = document.getElementById('sendBtn');
349
  const userInput = document.getElementById('userInput');
350
+ const chatMessagesDiv = document.getElementById('chatMessages');
351
  const questionsContainer = document.getElementById('defaultQuestionsContainer');
352
 
353
  function renderQuestionBubbles() {
 
367
  typingDiv = document.createElement('div');
368
  typingDiv.className = 'typing-indicator';
369
  typingDiv.innerHTML = '<span></span><span></span><span></span>';
370
+ chatMessagesDiv.appendChild(typingDiv);
371
+ chatMessagesDiv.scrollTop = chatMessagesDiv.scrollHeight;
372
  }
373
  function hideTyping() {
374
  if (typingDiv) { typingDiv.remove(); typingDiv = null; }