Hadiil commited on
Commit
5ca4821
·
verified ·
1 Parent(s): 10a0c25

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +60 -79
templates/index.html CHANGED
@@ -21,7 +21,6 @@
21
  --space-glow: 0 0 8px rgba(199, 125, 255, 0.6);
22
  --space-nebula: linear-gradient(135deg, #7b2cbf 0%, #3a0ca3 50%, #4361ee 100%);
23
  }
24
-
25
  body {
26
  font-family: 'Quicksand', sans-serif;
27
  background-color: var(--space-bg-primary);
@@ -29,12 +28,10 @@
29
  min-height: 100vh;
30
  overflow-x: hidden;
31
  }
32
-
33
  h1, h2, h3, h4, h5, h6 {
34
  font-family: 'Space Mono', monospace;
35
  letter-spacing: 1px;
36
  }
37
-
38
  .cosmic-gradient {
39
  background: var(--space-nebula);
40
  -webkit-background-clip: text;
@@ -42,23 +39,18 @@
42
  background-clip: text;
43
  text-shadow: var(--space-glow);
44
  }
45
-
46
  .bg-cosmic {
47
  background-color: var(--space-bg-secondary);
48
  }
49
-
50
  .text-cosmic {
51
  color: var(--space-text-primary);
52
  }
53
-
54
  .text-cosmic-secondary {
55
  color: var(--space-text-secondary);
56
  }
57
-
58
  .border-cosmic {
59
  border-color: rgba(123, 44, 191, 0.3);
60
  }
61
-
62
  .cosmic-card {
63
  background: rgba(10, 10, 45, 0.7);
64
  backdrop-filter: blur(10px);
@@ -69,7 +61,6 @@
69
  overflow: hidden;
70
  position: relative;
71
  }
72
-
73
  .cosmic-card::before {
74
  content: '';
75
  position: absolute;
@@ -82,16 +73,13 @@
82
  transition: opacity 0.3s ease;
83
  pointer-events: none;
84
  }
85
-
86
  .cosmic-card:hover {
87
  transform: translateY(-5px);
88
  box-shadow: 0 8px 30px rgba(123, 44, 191, 0.3);
89
  }
90
-
91
  .cosmic-card:hover::before {
92
  opacity: 1;
93
  }
94
-
95
  .cosmic-button {
96
  background: linear-gradient(135deg, var(--space-accent-primary) 0%, var(--space-accent-secondary) 100%);
97
  color: white;
@@ -99,7 +87,6 @@
99
  overflow: hidden;
100
  transition: all 0.3s ease;
101
  }
102
-
103
  .cosmic-button::before {
104
  content: '';
105
  position: absolute;
@@ -110,29 +97,24 @@
110
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
111
  transition: all 0.8s ease;
112
  }
113
-
114
  .cosmic-button:hover {
115
  transform: translateY(-2px);
116
  box-shadow: 0 5px 15px rgba(123, 44, 191, 0.4);
117
  }
118
-
119
  .cosmic-button:hover::before {
120
  left: 100%;
121
  }
122
-
123
  .cosmic-input {
124
  background: rgba(5, 5, 24, 0.6);
125
  border: 1px solid rgba(123, 44, 191, 0.5);
126
  color: var(--space-text-primary);
127
  transition: all 0.3s ease;
128
  }
129
-
130
  .cosmic-input:focus {
131
  outline: none;
132
  border-color: var(--space-accent-secondary);
133
  box-shadow: 0 0 0 3px rgba(199, 125, 255, 0.2), var(--space-glow);
134
  }
135
-
136
  .stars-container {
137
  position: fixed;
138
  top: 0;
@@ -142,19 +124,16 @@
142
  z-index: -1;
143
  overflow: hidden;
144
  }
145
-
146
  .star {
147
  position: absolute;
148
  background-color: #ffffff;
149
  border-radius: 50%;
150
  animation: twinkle 4s infinite ease-in-out;
151
  }
152
-
153
  @keyframes twinkle {
154
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
155
  50% { opacity: 1; transform: scale(1.2); }
156
  }
157
-
158
  #particlesCanvas {
159
  position: fixed;
160
  top: 0;
@@ -163,29 +142,24 @@
163
  height: 100%;
164
  z-index: -1;
165
  }
166
-
167
  .feature-icon {
168
  transition: transform 0.3s ease;
169
  }
170
-
171
  .cosmic-card:hover .feature-icon {
172
  transform: scale(1.2);
173
  }
174
-
175
  .message {
176
  max-width: 80%;
177
  padding: 0.8rem 1.2rem;
178
  border-radius: 12px;
179
  animation: messageAppear 0.3s ease;
180
  }
181
-
182
  .user-message {
183
  align-self: flex-end;
184
  background: linear-gradient(135deg, var(--space-accent-primary) 0%, var(--space-accent-secondary) 100%);
185
  color: white;
186
  border-bottom-right-radius: 0;
187
  }
188
-
189
  .bot-message {
190
  align-self: flex-start;
191
  background: rgba(5, 5, 24, 0.8);
@@ -193,7 +167,6 @@
193
  border-bottom-left-radius: 0;
194
  border: 1px solid rgba(123, 44, 191, 0.3);
195
  }
196
-
197
  @keyframes messageAppear {
198
  from {
199
  opacity: 0;
@@ -204,39 +177,33 @@
204
  transform: translateY(0);
205
  }
206
  }
207
-
208
  .cosmic-upload__dropzone {
209
  background: rgba(10, 10, 45, 0.6);
210
  border: 2px dashed rgba(123, 44, 191, 0.5);
211
  transition: all 0.3s ease;
212
  cursor: pointer;
213
  }
214
-
215
  .cosmic-upload__dropzone.active {
216
  background: rgba(10, 10, 45, 0.8);
217
  border-color: var(--space-accent-secondary);
218
  box-shadow: 0 0 20px rgba(123, 44, 191, 0.3);
219
  }
220
-
221
  .feature-transition {
222
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
223
  opacity 0.5s ease;
224
  opacity: 0;
225
  transform: translateY(20px);
226
  }
227
-
228
  .feature-transition.active {
229
  opacity: 1;
230
  transform: translateY(0);
231
  }
232
-
233
  .cosmos-loader {
234
  width: 80px;
235
  height: 80px;
236
  position: relative;
237
  margin: 2rem auto;
238
  }
239
-
240
  .cosmos-loader::before,
241
  .cosmos-loader::after {
242
  content: '';
@@ -250,25 +217,21 @@
250
  border-top-color: var(--space-accent-primary);
251
  animation: spin 1.5s linear infinite;
252
  }
253
-
254
  .cosmos-loader::before {
255
  border-top-color: var(--space-accent-primary);
256
  z-index: 1;
257
  animation-duration: 1.5s;
258
  }
259
-
260
  .cosmos-loader::after {
261
  border-top-color: var(--space-accent-secondary);
262
  border-right-color: var(--space-accent-secondary);
263
  z-index: 0;
264
  animation-duration: 2s;
265
  }
266
-
267
  @keyframes spin {
268
  0% { transform: rotate(0deg); }
269
  100% { transform: rotate(360deg); }
270
  }
271
-
272
  .planet {
273
  width: 150px;
274
  height: 150px;
@@ -277,7 +240,6 @@
277
  position: relative;
278
  box-shadow: 0 0 30px rgba(123, 44, 191, 0.5);
279
  }
280
-
281
  .planet::before {
282
  content: '';
283
  position: absolute;
@@ -289,7 +251,6 @@
289
  left: 50%;
290
  transform: translate(-50%, -50%) rotateX(80deg);
291
  }
292
-
293
  .orbit {
294
  position: absolute;
295
  top: 50%;
@@ -298,7 +259,6 @@
298
  border-radius: 50%;
299
  transform: translate(-50%, -50%);
300
  }
301
-
302
  .moon {
303
  position: absolute;
304
  background: rgba(10, 10, 45, 0.9);
@@ -308,7 +268,6 @@
308
  animation: orbit 20s linear infinite;
309
  box-shadow: 0 0 10px rgba(199, 125, 255, 0.4);
310
  }
311
-
312
  @keyframes orbit {
313
  0% { transform: rotate(0deg) translateX(100px); }
314
  100% { transform: rotate(360deg) translateX(100px); }
@@ -652,7 +611,6 @@
652
  const star = document.createElement('div');
653
  star.classList.add('star');
654
 
655
- // Random positioning
656
  const x = Math.random() * 100;
657
  const y = Math.random() * 100;
658
  const delay = Math.random() * 5;
@@ -690,11 +648,11 @@
690
 
691
  getRandomColor() {
692
  const colors = [
693
- 'rgba(123, 44, 191, 0.8)', // Purple
694
- 'rgba(199, 125, 255, 0.8)', // Light purple
695
- 'rgba(0, 180, 216, 0.8)', // Cyan
696
- 'rgba(67, 97, 238, 0.8)', // Blue
697
- 'rgba(255, 255, 255, 0.8)' // White
698
  ];
699
  return colors[Math.floor(Math.random() * colors.length)];
700
  }
@@ -703,7 +661,6 @@
703
  this.x += this.speedX;
704
  this.y += this.speedY;
705
 
706
- // Wrap around edges
707
  if (this.x > canvas.width) this.x = 0;
708
  if (this.x < 0) this.x = canvas.width;
709
  if (this.y > canvas.height) this.y = 0;
@@ -725,7 +682,6 @@
725
  function animate() {
726
  ctx.clearRect(0, 0, canvas.width, canvas.height);
727
 
728
- // Draw connections between nearby particles
729
  ctx.strokeStyle = 'rgba(255, 255, 255, 0.05)';
730
  ctx.lineWidth = 0.5;
731
 
@@ -744,7 +700,6 @@
744
  }
745
  }
746
 
747
- // Update and draw particles
748
  particles.forEach(particle => {
749
  particle.update();
750
  particle.draw();
@@ -761,7 +716,6 @@
761
  const features = document.querySelectorAll('.feature-transition');
762
 
763
  features.forEach((feature, index) => {
764
- // Add delay based on index
765
  setTimeout(() => {
766
  feature.classList.add('active');
767
  }, index * 150);
@@ -772,40 +726,74 @@
772
  const chatInput = document.getElementById('chatInput');
773
  const sendButton = document.getElementById('sendButton');
774
  const chatMessages = document.getElementById('chatMessages');
 
 
 
775
 
776
  function addMessage(text, isUser = false) {
777
  const messageDiv = document.createElement('div');
778
  messageDiv.classList.add('message');
779
  messageDiv.classList.add(isUser ? 'user-message' : 'bot-message');
780
  messageDiv.textContent = text;
781
-
782
  chatMessages.appendChild(messageDiv);
783
  chatMessages.scrollTop = chatMessages.scrollHeight;
784
  }
785
 
786
- function handleUserMessage() {
787
  const message = chatInput.value.trim();
788
- if (message === '') return;
789
 
790
- addMessage(message, true);
791
- chatInput.value = '';
792
 
793
- // Simulate AI response
794
- setTimeout(() => {
795
- let response;
796
- if (message.toLowerCase().includes('help')) {
797
- response = "I can help with document summarization, image description, question answering, translation, and data visualization. What would you like to know?";
798
- } else if (message.toLowerCase().includes('summarize')) {
799
- response = "To summarize a document, simply upload it using the upload area or drag and drop. I'll analyze it and provide a concise summary.";
800
- } else if (message.toLowerCase().includes('translate')) {
801
- response = "I can translate text to various languages. Just tell me what you want to translate and the target language.";
802
- } else if (message.toLowerCase().includes('image') || message.toLowerCase().includes('picture')) {
803
- response = "For image description or visual Q&A, upload an image and I'll analyze it for you.";
804
- } else {
805
- response = "I'm your Cosmic AI Assistant. I can help with various tasks including summarization, image analysis, and answering questions. What would you like me to do?";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
806
  }
807
- addMessage(response);
808
- }, 1000);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
809
  }
810
 
811
  sendButton.addEventListener('click', handleUserMessage);
@@ -816,10 +804,6 @@
816
  });
817
 
818
  // File Upload Handling
819
- const dropzone = document.getElementById('fileDropzone');
820
- const fileInput = document.getElementById('fileInput');
821
- const previewArea = document.getElementById('filePreviewArea');
822
-
823
  dropzone.addEventListener('click', () => {
824
  fileInput.click();
825
  });
@@ -830,13 +814,12 @@
830
  });
831
 
832
  dropzone.addEventListener('dragleave', () => {
833
- dropzone.classList.remove('active');
834
  });
835
 
836
  dropzone.addEventListener('drop', (e) => {
837
  e.preventDefault();
838
  dropzone.classList.remove('active');
839
-
840
  if (e.dataTransfer.files.length) {
841
  handleFiles(e.dataTransfer.files);
842
  }
@@ -894,7 +877,6 @@
894
  previewArea.appendChild(fileElement);
895
  });
896
 
897
- // Simulate processing response
898
  addMessage(`I've received ${files.length} file(s). How would you like me to process them?`);
899
  }
900
 
@@ -906,7 +888,6 @@
906
  // Handle window resize
907
  window.addEventListener('resize', () => {
908
  createStars();
909
-
910
  const canvas = document.getElementById('particlesCanvas');
911
  canvas.width = window.innerWidth;
912
  canvas.height = window.innerHeight;
 
21
  --space-glow: 0 0 8px rgba(199, 125, 255, 0.6);
22
  --space-nebula: linear-gradient(135deg, #7b2cbf 0%, #3a0ca3 50%, #4361ee 100%);
23
  }
 
24
  body {
25
  font-family: 'Quicksand', sans-serif;
26
  background-color: var(--space-bg-primary);
 
28
  min-height: 100vh;
29
  overflow-x: hidden;
30
  }
 
31
  h1, h2, h3, h4, h5, h6 {
32
  font-family: 'Space Mono', monospace;
33
  letter-spacing: 1px;
34
  }
 
35
  .cosmic-gradient {
36
  background: var(--space-nebula);
37
  -webkit-background-clip: text;
 
39
  background-clip: text;
40
  text-shadow: var(--space-glow);
41
  }
 
42
  .bg-cosmic {
43
  background-color: var(--space-bg-secondary);
44
  }
 
45
  .text-cosmic {
46
  color: var(--space-text-primary);
47
  }
 
48
  .text-cosmic-secondary {
49
  color: var(--space-text-secondary);
50
  }
 
51
  .border-cosmic {
52
  border-color: rgba(123, 44, 191, 0.3);
53
  }
 
54
  .cosmic-card {
55
  background: rgba(10, 10, 45, 0.7);
56
  backdrop-filter: blur(10px);
 
61
  overflow: hidden;
62
  position: relative;
63
  }
 
64
  .cosmic-card::before {
65
  content: '';
66
  position: absolute;
 
73
  transition: opacity 0.3s ease;
74
  pointer-events: none;
75
  }
 
76
  .cosmic-card:hover {
77
  transform: translateY(-5px);
78
  box-shadow: 0 8px 30px rgba(123, 44, 191, 0.3);
79
  }
 
80
  .cosmic-card:hover::before {
81
  opacity: 1;
82
  }
 
83
  .cosmic-button {
84
  background: linear-gradient(135deg, var(--space-accent-primary) 0%, var(--space-accent-secondary) 100%);
85
  color: white;
 
87
  overflow: hidden;
88
  transition: all 0.3s ease;
89
  }
 
90
  .cosmic-button::before {
91
  content: '';
92
  position: absolute;
 
97
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
98
  transition: all 0.8s ease;
99
  }
 
100
  .cosmic-button:hover {
101
  transform: translateY(-2px);
102
  box-shadow: 0 5px 15px rgba(123, 44, 191, 0.4);
103
  }
 
104
  .cosmic-button:hover::before {
105
  left: 100%;
106
  }
 
107
  .cosmic-input {
108
  background: rgba(5, 5, 24, 0.6);
109
  border: 1px solid rgba(123, 44, 191, 0.5);
110
  color: var(--space-text-primary);
111
  transition: all 0.3s ease;
112
  }
 
113
  .cosmic-input:focus {
114
  outline: none;
115
  border-color: var(--space-accent-secondary);
116
  box-shadow: 0 0 0 3px rgba(199, 125, 255, 0.2), var(--space-glow);
117
  }
 
118
  .stars-container {
119
  position: fixed;
120
  top: 0;
 
124
  z-index: -1;
125
  overflow: hidden;
126
  }
 
127
  .star {
128
  position: absolute;
129
  background-color: #ffffff;
130
  border-radius: 50%;
131
  animation: twinkle 4s infinite ease-in-out;
132
  }
 
133
  @keyframes twinkle {
134
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
135
  50% { opacity: 1; transform: scale(1.2); }
136
  }
 
137
  #particlesCanvas {
138
  position: fixed;
139
  top: 0;
 
142
  height: 100%;
143
  z-index: -1;
144
  }
 
145
  .feature-icon {
146
  transition: transform 0.3s ease;
147
  }
 
148
  .cosmic-card:hover .feature-icon {
149
  transform: scale(1.2);
150
  }
 
151
  .message {
152
  max-width: 80%;
153
  padding: 0.8rem 1.2rem;
154
  border-radius: 12px;
155
  animation: messageAppear 0.3s ease;
156
  }
 
157
  .user-message {
158
  align-self: flex-end;
159
  background: linear-gradient(135deg, var(--space-accent-primary) 0%, var(--space-accent-secondary) 100%);
160
  color: white;
161
  border-bottom-right-radius: 0;
162
  }
 
163
  .bot-message {
164
  align-self: flex-start;
165
  background: rgba(5, 5, 24, 0.8);
 
167
  border-bottom-left-radius: 0;
168
  border: 1px solid rgba(123, 44, 191, 0.3);
169
  }
 
170
  @keyframes messageAppear {
171
  from {
172
  opacity: 0;
 
177
  transform: translateY(0);
178
  }
179
  }
 
180
  .cosmic-upload__dropzone {
181
  background: rgba(10, 10, 45, 0.6);
182
  border: 2px dashed rgba(123, 44, 191, 0.5);
183
  transition: all 0.3s ease;
184
  cursor: pointer;
185
  }
 
186
  .cosmic-upload__dropzone.active {
187
  background: rgba(10, 10, 45, 0.8);
188
  border-color: var(--space-accent-secondary);
189
  box-shadow: 0 0 20px rgba(123, 44, 191, 0.3);
190
  }
 
191
  .feature-transition {
192
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
193
  opacity 0.5s ease;
194
  opacity: 0;
195
  transform: translateY(20px);
196
  }
 
197
  .feature-transition.active {
198
  opacity: 1;
199
  transform: translateY(0);
200
  }
 
201
  .cosmos-loader {
202
  width: 80px;
203
  height: 80px;
204
  position: relative;
205
  margin: 2rem auto;
206
  }
 
207
  .cosmos-loader::before,
208
  .cosmos-loader::after {
209
  content: '';
 
217
  border-top-color: var(--space-accent-primary);
218
  animation: spin 1.5s linear infinite;
219
  }
 
220
  .cosmos-loader::before {
221
  border-top-color: var(--space-accent-primary);
222
  z-index: 1;
223
  animation-duration: 1.5s;
224
  }
 
225
  .cosmos-loader::after {
226
  border-top-color: var(--space-accent-secondary);
227
  border-right-color: var(--space-accent-secondary);
228
  z-index: 0;
229
  animation-duration: 2s;
230
  }
 
231
  @keyframes spin {
232
  0% { transform: rotate(0deg); }
233
  100% { transform: rotate(360deg); }
234
  }
 
235
  .planet {
236
  width: 150px;
237
  height: 150px;
 
240
  position: relative;
241
  box-shadow: 0 0 30px rgba(123, 44, 191, 0.5);
242
  }
 
243
  .planet::before {
244
  content: '';
245
  position: absolute;
 
251
  left: 50%;
252
  transform: translate(-50%, -50%) rotateX(80deg);
253
  }
 
254
  .orbit {
255
  position: absolute;
256
  top: 50%;
 
259
  border-radius: 50%;
260
  transform: translate(-50%, -50%);
261
  }
 
262
  .moon {
263
  position: absolute;
264
  background: rgba(10, 10, 45, 0.9);
 
268
  animation: orbit 20s linear infinite;
269
  box-shadow: 0 0 10px rgba(199, 125, 255, 0.4);
270
  }
 
271
  @keyframes orbit {
272
  0% { transform: rotate(0deg) translateX(100px); }
273
  100% { transform: rotate(360deg) translateX(100px); }
 
611
  const star = document.createElement('div');
612
  star.classList.add('star');
613
 
 
614
  const x = Math.random() * 100;
615
  const y = Math.random() * 100;
616
  const delay = Math.random() * 5;
 
648
 
649
  getRandomColor() {
650
  const colors = [
651
+ 'rgba(123, 44, 191, 0.8)',
652
+ 'rgba(199, 125, 255, 0.8)',
653
+ 'rgba(0, 180, 216, 0.8)',
654
+ 'rgba(67, 97, 238, 0.8)',
655
+ 'rgba(255, 255, 255, 0.8)'
656
  ];
657
  return colors[Math.floor(Math.random() * colors.length)];
658
  }
 
661
  this.x += this.speedX;
662
  this.y += this.speedY;
663
 
 
664
  if (this.x > canvas.width) this.x = 0;
665
  if (this.x < 0) this.x = canvas.width;
666
  if (this.y > canvas.height) this.y = 0;
 
682
  function animate() {
683
  ctx.clearRect(0, 0, canvas.width, canvas.height);
684
 
 
685
  ctx.strokeStyle = 'rgba(255, 255, 255, 0.05)';
686
  ctx.lineWidth = 0.5;
687
 
 
700
  }
701
  }
702
 
 
703
  particles.forEach(particle => {
704
  particle.update();
705
  particle.draw();
 
716
  const features = document.querySelectorAll('.feature-transition');
717
 
718
  features.forEach((feature, index) => {
 
719
  setTimeout(() => {
720
  feature.classList.add('active');
721
  }, index * 150);
 
726
  const chatInput = document.getElementById('chatInput');
727
  const sendButton = document.getElementById('sendButton');
728
  const chatMessages = document.getElementById('chatMessages');
729
+ const dropzone = document.getElementById('fileDropzone');
730
+ const fileInput = document.getElementById('fileInput');
731
+ const previewArea = document.getElementById('filePreviewArea');
732
 
733
  function addMessage(text, isUser = false) {
734
  const messageDiv = document.createElement('div');
735
  messageDiv.classList.add('message');
736
  messageDiv.classList.add(isUser ? 'user-message' : 'bot-message');
737
  messageDiv.textContent = text;
 
738
  chatMessages.appendChild(messageDiv);
739
  chatMessages.scrollTop = chatMessages.scrollHeight;
740
  }
741
 
742
+ async function handleUserMessage() {
743
  const message = chatInput.value.trim();
744
+ const files = fileInput.files;
745
 
746
+ if (message === '' && files.length === 0) return;
 
747
 
748
+ if (message) {
749
+ addMessage(message, true);
750
+ chatInput.value = '';
751
+ }
752
+
753
+ const formData = new FormData();
754
+ if (message) {
755
+ formData.append('text', message);
756
+ }
757
+ if (files.length > 0) {
758
+ for (let file of files) {
759
+ formData.append('file', file);
760
+ }
761
+ }
762
+
763
+ try {
764
+ const loader = document.createElement('div');
765
+ loader.classList.add('cosmos-loader');
766
+ chatMessages.appendChild(loader);
767
+
768
+ const response = await fetch('/process', {
769
+ method: 'POST',
770
+ body: formData,
771
+ });
772
+
773
+ if (!response.ok) {
774
+ throw new Error(`HTTP error! status: ${response.status}`);
775
  }
776
+
777
+ const result = await response.json();
778
+ addMessage(result.response);
779
+
780
+ if (result.additional_data) {
781
+ const additionalInfo = JSON.stringify(result.additional_data, null, 2);
782
+ addMessage(`Additional Info: ${additionalInfo}`);
783
+ }
784
+
785
+ if (files.length > 0) {
786
+ fileInput.value = '';
787
+ previewArea.innerHTML = '';
788
+ previewArea.classList.add('hidden');
789
+ }
790
+ } catch (error) {
791
+ console.error('Error:', error);
792
+ addMessage('Sorry, something went wrong. Please try again.');
793
+ } finally {
794
+ const loader = chatMessages.querySelector('.cosmos-loader');
795
+ if (loader) loader.remove();
796
+ }
797
  }
798
 
799
  sendButton.addEventListener('click', handleUserMessage);
 
804
  });
805
 
806
  // File Upload Handling
 
 
 
 
807
  dropzone.addEventListener('click', () => {
808
  fileInput.click();
809
  });
 
814
  });
815
 
816
  dropzone.addEventListener('dragleave', () => {
817
+ drop sculpted by the cosmic winds of progresszone.classList.remove('active');
818
  });
819
 
820
  dropzone.addEventListener('drop', (e) => {
821
  e.preventDefault();
822
  dropzone.classList.remove('active');
 
823
  if (e.dataTransfer.files.length) {
824
  handleFiles(e.dataTransfer.files);
825
  }
 
877
  previewArea.appendChild(fileElement);
878
  });
879
 
 
880
  addMessage(`I've received ${files.length} file(s). How would you like me to process them?`);
881
  }
882
 
 
888
  // Handle window resize
889
  window.addEventListener('resize', () => {
890
  createStars();
 
891
  const canvas = document.getElementById('particlesCanvas');
892
  canvas.width = window.innerWidth;
893
  canvas.height = window.innerHeight;