Spaces:
Runtime error
Runtime error
Update templates/index.html
Browse files145 unmodified lines14614714814915015152 unmodified lines204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259145 unmodified lines}.disabled {cursor: not-allowed !important; /* Set cursor to not-allowed */}/* Responsive design */52 unmodified lines<script>// Loader functionalitydocument.getElementById('fileUploadForm').onsubmit = function() {document.getElementById('loader').style.display = 'block';// Disable the tab buttons and apply disabled classconst buttons = document.querySelectorAll('.tab button');buttons.forEach(button => {button.setAttribute('disabled', 'true');button.classList.add('disabled'); // Add disabled class});// Show processing messageconst processingMessage = document.createElement('p');processingMessage.id = 'processing-message';processingMessage.textContent = 'Processing, please wait...';processingMessage.style.color = '#e68a10'; // Style as neededdocument.querySelector('.file-upload-section').appendChild(processingMessage);};// Flash message auto-hidesetTimeout(function () {let flashMessage = document.getElementById("flash-message");if (flashMessage) {flashMessage.style.transition = "opacity 1s ease";flashMessage.style.opacity = 0;setTimeout(() => flashMessage.remove(), 1000);}// After processing is complete (You can adjust this based on your logic)const processingMessage = document.getElementById('processing-message');if (processingMessage) {processingMessage.remove(); // Remove the processing message}// Re-enable tab buttons and remove disabled classconst buttons = document.querySelectorAll('.tab button');buttons.forEach(button => {button.removeAttribute('disabled');button.classList.remove('disabled'); // Remove disabled class});}, 3000); // Adjust timing based on your upload duration// Function to open links in the same tabfunction openLink(url, element) {window.location.href = url; // Redirects to the specified URL in the same tab// Remove "active" class from all buttonsconst buttons = document.querySelectorAll('.tab button');buttons.forEach(button => button.classList.remove('active'));// Add "active" class to the clicked buttonelement.classList.add('active');}</script></body>145 unmodified lines14614714814915015115252 unmodified lines205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276145 unmodified lines}.disabled {cursor: not-allowed !important; /* Set cursor to not-allowed */opacity: 0.6;}/* Responsive design */52 unmodified lines<script>// Loader functionalitydocument.getElementById('fileUploadForm').onsubmit = function() {document.getElementById('loader').style.display = 'block';// Disable the tab buttons and apply disabled classconst buttons = document.querySelectorAll('.tab button');buttons.forEach(button => {button.setAttribute('disabled', 'true');button.classList.add('disabled'); // Add disabled class});// Disable the "Choose file" input and "Upload your Images" buttonconst fileInput = document.querySelector('input[type="file"]');const uploadButton = document.querySelector('input[type="submit"]');fileInput.setAttribute('disabled', 'true');uploadButton.setAttribute('disabled', 'true');fileInput.classList.add('disabled');uploadButton.classList.add('disabled');// Show processing messageconst processingMessage = document.createElement('p');processingMessage.id = 'processing-message';processingMessage.textContent = 'Processing, please wait...';processingMessage.style.color = '#e68a10'; // Style as neededdocument.querySelector('.file-upload-section').appendChild(processingMessage);};// Flash message auto-hidesetTimeout(function () {let flashMessage = document.getElementById("flash-message");if (flashMessage) {flashMessage.style.transition = "opacity 1s ease";flashMessage.style.opacity = 0;setTimeout(() => flashMessage.remove(), 1000);}// After processing is complete (You can adjust this based on your logic)const processingMessage = document.getElementById('processing-message');if (processingMessage) {processingMessage.remove(); // Remove the processing message}// Re-enable tab buttons and remove disabled classconst buttons = document.querySelectorAll('.tab button');buttons.forEach(button => {button.removeAttribute('disabled');button.classList.remove('disabled'); // Remove disabled class});// Re-enable the file input and submit buttonconst fileInput = document.querySelector('input[type="file"]');const uploadButton = document.querySelector('input[type="submit"]');fileInput.removeAttribute('disabled');uploadButton.removeAttribute('disabled');fileInput.classList.remove('disabled');uploadButton.classList.remove('disabled');}, 3000); // Adjust timing based on your upload duration// Function to open links in the same tabfunction openLink(url, element) {window.location.href = url; // Redirects to the specified URL in the same tab// Remove "active" class from all buttonsconst buttons = document.querySelectorAll('.tab button');buttons.forEach(button => button.classList.remove('active'));// Add "active" class to the clicked buttonelement.classList.add('active');}</script></body>
templates/index.html+61-44