WebashalarForML commited on
Commit
2e0b502
1 Parent(s): 3a5bd72

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +42 -29
templates/index.html CHANGED
@@ -143,7 +143,10 @@
143
  padding: 20px;
144
  margin-top: 70px;
145
  }
146
-
 
 
 
147
  /* Responsive design */
148
  @media (max-width: 768px) {
149
  .tab {
@@ -197,57 +200,67 @@
197
  </div>
198
 
199
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
200
- <script>
201
- // Loader functionality
202
- document.getElementById('fileUploadForm').onsubmit = function() {
203
- document.getElementById('loader').style.display = 'block';
204
 
205
- // Disable the tab buttons
206
  const buttons = document.querySelectorAll('.tab button');
207
- buttons.forEach(button => {
208
  button.setAttribute('disabled', 'true');
209
- });
 
 
 
 
210
 
211
  // Show processing message
212
  const processingMessage = document.createElement('p');
213
  processingMessage.id = 'processing-message';
214
  processingMessage.textContent = 'Processing, please wait...';
215
- processingMessage.style.color = '#e68a00'; // Style as needed
216
  document.querySelector('.file-upload-section').appendChild(processingMessage);
217
- };
218
-
219
- // Flash message auto-hide
220
- setTimeout(function () {
221
- let flashMessage = document.getElementById("flash-message");
222
  if (flashMessage) {
223
  flashMessage.style.transition = "opacity 1s ease";
224
- flashMessage.style.opacity = 0;
225
- setTimeout(() => flashMessage.remove(), 1000);
226
- }
227
 
228
  // After processing is complete (You can adjust this based on your logic)
229
  const processingMessage = document.getElementById('processing-message');
230
  if (processingMessage) {
231
  processingMessage.remove(); // Remove the processing message
232
- }
233
 
234
- // Re-enable tab buttons
235
  const buttons = document.querySelectorAll('.tab button');
236
- buttons.forEach(button => {
237
  button.removeAttribute('disabled');
238
- });
239
- }, 3000); // Adjust timing based on your upload duration
240
-
241
- // Function to open links in the same tab
242
- function openLink(url) {
243
- window.location.href = url; // Redirects to the specified URL in the same tab
 
 
 
 
 
244
  // Remove "active" class from all buttons
245
  const buttons = document.querySelectorAll('.tab button');
246
- buttons.forEach(button => button.classList.remove('active'));
 
247
  // Add "active" class to the clicked button
248
  element.classList.add('active');
249
- }
250
- </script>
251
  </body>
252
 
253
  </html>
 
143
  padding: 20px;
144
  margin-top: 70px;
145
  }
146
+ .disabled {
147
+ cursor: wait !important; /* Set cursor to wait */
148
+ }
149
+
150
  /* Responsive design */
151
  @media (max-width: 768px) {
152
  .tab {
 
200
  </div>
201
 
202
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
203
+ <script>
204
+ // Loader functionality
205
+ document.getElementById('fileUploadForm').onsubmit = function() {
206
+ document.getElementById('loader').style.display = 'block';
207
 
208
+ // Disable the tab buttons and apply disabled class
209
  const buttons = document.querySelectorAll('.tab button');
210
+ buttons.forEach(button => {
211
  button.setAttribute('disabled', 'true');
212
+ button.classList.add('disabled'); // Add disabled class
213
+ });
214
+
215
+ // Change cursor to wait
216
+ document.body.style.cursor = 'wait';
217
 
218
  // Show processing message
219
  const processingMessage = document.createElement('p');
220
  processingMessage.id = 'processing-message';
221
  processingMessage.textContent = 'Processing, please wait...';
222
+ processingMessage.style.color = '#e68a10'; // Style as needed
223
  document.querySelector('.file-upload-section').appendChild(processingMessage);
224
+ };
225
+
226
+ // Flash message auto-hide
227
+ setTimeout(function () {
228
+ let flashMessage = document.getElementById("flash-message");
229
  if (flashMessage) {
230
  flashMessage.style.transition = "opacity 1s ease";
231
+ flashMessage.style.opacity = 0;
232
+ setTimeout(() => flashMessage.remove(), 1000);
233
+ }
234
 
235
  // After processing is complete (You can adjust this based on your logic)
236
  const processingMessage = document.getElementById('processing-message');
237
  if (processingMessage) {
238
  processingMessage.remove(); // Remove the processing message
239
+ }
240
 
241
+ // Re-enable tab buttons and remove disabled class
242
  const buttons = document.querySelectorAll('.tab button');
243
+ buttons.forEach(button => {
244
  button.removeAttribute('disabled');
245
+ button.classList.remove('disabled'); // Remove disabled class
246
+ });
247
+
248
+ // Reset cursor to default
249
+ document.body.style.cursor = 'auto';
250
+ }, 3000); // Adjust timing based on your upload duration
251
+
252
+ // Function to open links in the same tab
253
+ function openLink(url, element) {
254
+ window.location.href = url; // Redirects to the specified URL in the same tab
255
+
256
  // Remove "active" class from all buttons
257
  const buttons = document.querySelectorAll('.tab button');
258
+ buttons.forEach(button => button.classList.remove('active'));
259
+
260
  // Add "active" class to the clicked button
261
  element.classList.add('active');
262
+ }
263
+ </script>
264
  </body>
265
 
266
  </html>