WebashalarForML commited on
Commit
5f11879
·
verified ·
1 Parent(s): 56f7e95

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +61 -44
templates/index.html CHANGED
@@ -146,6 +146,7 @@
146
  }
147
  .disabled {
148
  cursor: not-allowed !important; /* Set cursor to not-allowed */
 
149
  }
150
 
151
  /* Responsive design */
@@ -204,56 +205,72 @@
204
  <script>
205
  // Loader functionality
206
  document.getElementById('fileUploadForm').onsubmit = function() {
207
- document.getElementById('loader').style.display = 'block';
208
-
209
- // Disable the tab buttons and apply disabled class
210
- const buttons = document.querySelectorAll('.tab button');
211
- buttons.forEach(button => {
212
- button.setAttribute('disabled', 'true');
213
- button.classList.add('disabled'); // Add disabled class
214
- });
215
-
216
- // Show processing message
217
- const processingMessage = document.createElement('p');
218
- processingMessage.id = 'processing-message';
219
- processingMessage.textContent = 'Processing, please wait...';
220
- processingMessage.style.color = '#e68a10'; // Style as needed
221
- document.querySelector('.file-upload-section').appendChild(processingMessage);
 
 
 
 
 
 
 
 
222
  };
223
-
224
  // Flash message auto-hide
225
  setTimeout(function () {
226
- let flashMessage = document.getElementById("flash-message");
227
- if (flashMessage) {
228
- flashMessage.style.transition = "opacity 1s ease";
229
- flashMessage.style.opacity = 0;
230
- setTimeout(() => flashMessage.remove(), 1000);
231
- }
232
-
233
- // After processing is complete (You can adjust this based on your logic)
234
- const processingMessage = document.getElementById('processing-message');
235
- if (processingMessage) {
236
- processingMessage.remove(); // Remove the processing message
237
- }
238
-
239
- // Re-enable tab buttons and remove disabled class
240
- const buttons = document.querySelectorAll('.tab button');
241
- buttons.forEach(button => {
242
- button.removeAttribute('disabled');
243
- button.classList.remove('disabled'); // Remove disabled class
244
- });
 
 
 
 
 
 
 
 
245
  }, 3000); // Adjust timing based on your upload duration
246
-
247
  // Function to open links in the same tab
248
  function openLink(url, element) {
249
- window.location.href = url; // Redirects to the specified URL in the same tab
250
-
251
- // Remove "active" class from all buttons
252
- const buttons = document.querySelectorAll('.tab button');
253
- buttons.forEach(button => button.classList.remove('active'));
254
-
255
- // Add "active" class to the clicked button
256
- element.classList.add('active');
257
  }
258
  </script>
259
  </body>
 
146
  }
147
  .disabled {
148
  cursor: not-allowed !important; /* Set cursor to not-allowed */
149
+ opacity: 0.6;
150
  }
151
 
152
  /* Responsive design */
 
205
  <script>
206
  // Loader functionality
207
  document.getElementById('fileUploadForm').onsubmit = function() {
208
+ document.getElementById('loader').style.display = 'block';
209
+
210
+ // Disable the tab buttons and apply disabled class
211
+ const buttons = document.querySelectorAll('.tab button');
212
+ buttons.forEach(button => {
213
+ button.setAttribute('disabled', 'true');
214
+ button.classList.add('disabled'); // Add disabled class
215
+ });
216
+
217
+ // Disable the "Choose file" input and "Upload your Images" button
218
+ const fileInput = document.querySelector('input[type="file"]');
219
+ const uploadButton = document.querySelector('input[type="submit"]');
220
+ fileInput.setAttribute('disabled', 'true');
221
+ uploadButton.setAttribute('disabled', 'true');
222
+ fileInput.classList.add('disabled');
223
+ uploadButton.classList.add('disabled');
224
+
225
+ // Show processing message
226
+ const processingMessage = document.createElement('p');
227
+ processingMessage.id = 'processing-message';
228
+ processingMessage.textContent = 'Processing, please wait...';
229
+ processingMessage.style.color = '#e68a10'; // Style as needed
230
+ document.querySelector('.file-upload-section').appendChild(processingMessage);
231
  };
232
+
233
  // Flash message auto-hide
234
  setTimeout(function () {
235
+ let flashMessage = document.getElementById("flash-message");
236
+ if (flashMessage) {
237
+ flashMessage.style.transition = "opacity 1s ease";
238
+ flashMessage.style.opacity = 0;
239
+ setTimeout(() => flashMessage.remove(), 1000);
240
+ }
241
+
242
+ // After processing is complete (You can adjust this based on your logic)
243
+ const processingMessage = document.getElementById('processing-message');
244
+ if (processingMessage) {
245
+ processingMessage.remove(); // Remove the processing message
246
+ }
247
+
248
+ // Re-enable tab buttons and remove disabled class
249
+ const buttons = document.querySelectorAll('.tab button');
250
+ buttons.forEach(button => {
251
+ button.removeAttribute('disabled');
252
+ button.classList.remove('disabled'); // Remove disabled class
253
+ });
254
+
255
+ // Re-enable the file input and submit button
256
+ const fileInput = document.querySelector('input[type="file"]');
257
+ const uploadButton = document.querySelector('input[type="submit"]');
258
+ fileInput.removeAttribute('disabled');
259
+ uploadButton.removeAttribute('disabled');
260
+ fileInput.classList.remove('disabled');
261
+ uploadButton.classList.remove('disabled');
262
  }, 3000); // Adjust timing based on your upload duration
263
+
264
  // Function to open links in the same tab
265
  function openLink(url, element) {
266
+ window.location.href = url; // Redirects to the specified URL in the same tab
267
+
268
+ // Remove "active" class from all buttons
269
+ const buttons = document.querySelectorAll('.tab button');
270
+ buttons.forEach(button => button.classList.remove('active'));
271
+
272
+ // Add "active" class to the clicked button
273
+ element.classList.add('active');
274
  }
275
  </script>
276
  </body>