WebashalarForML commited on
Commit
92bf7fc
·
verified ·
1 Parent(s): 48cba38

Update templates/index.html

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