Download script.js from mafiad2p/smartwash-strategy-studio: direct link, hf CLI and curl.
- Browser
- Download file 2.98 kB
-
https://huggingface.co/spaces/mafiad2p/smartwash-strategy-studio/resolve/main/script.js
- Command line
-
hf download hf://spaces/mafiad2p/smartwash-strategy-studio/script.js
-
curl -L -o script.js https://huggingface.co/spaces/mafiad2p/smartwash-strategy-studio/resolve/main/script.js
2.98 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Color selection | |
| const colorOptions = document.querySelectorAll('.color-option'); | |
| const previewTitle = document.querySelector('.preview-title'); | |
| colorOptions.forEach(option => { | |
| option.addEventListener('click', function() { | |
| const color = this.getAttribute('data-color'); | |
| // Remove all color classes from title | |
| previewTitle.classList.remove('text-green-500', 'text-blue-500', 'text-indigo-500', 'text-teal-500'); | |
| // Add selected color class | |
| previewTitle.classList.add(`text-${color}-500`); | |
| // Update generate button color | |
| const generateBtn = document.getElementById('generate-btn'); | |
| generateBtn.classList.remove('bg-green-500', 'hover:bg-green-600', | |
| 'bg-blue-500', 'hover:bg-blue-600', | |
| 'bg-indigo-500', 'hover:bg-indigo-600', | |
| 'bg-teal-500', 'hover:bg-teal-600'); | |
| generateBtn.classList.add(`bg-${color}-500`, `hover:bg-${color}-600`); | |
| }); | |
| }); | |
| // Theme selection | |
| const themeBtns = document.querySelectorAll('.theme-btn'); | |
| const previewContainer = document.querySelector('.preview-container'); | |
| themeBtns.forEach(btn => { | |
| btn.addEventListener('click', function() { | |
| const theme = this.getAttribute('data-theme'); | |
| // Reset all theme classes | |
| previewContainer.classList.remove('bg-white', 'border-gray-200', | |
| 'bg-gray-800', 'border-gray-700', | |
| 'bg-gray-100', 'border-gray-300'); | |
| // Apply selected theme | |
| if (theme === 'light') { | |
| previewContainer.classList.add('bg-white', 'border-gray-200'); | |
| } else if (theme === 'dark') { | |
| previewContainer.classList.add('bg-gray-800', 'border-gray-700'); | |
| } else if (theme === 'minimal') { | |
| previewContainer.classList.add('bg-gray-100', 'border-gray-300'); | |
| } | |
| }); | |
| }); | |
| // Generate PDF button | |
| const generateBtn = document.getElementById('generate-btn'); | |
| generateBtn.addEventListener('click', function() { | |
| // Simulate PDF generation | |
| this.innerHTML = '<i data-feather="loader" class="animate-spin mr-2"></i> Generating...'; | |
| setTimeout(() => { | |
| this.innerHTML = '<i data-feather="check" class="mr-2"></i> PDF Ready!'; | |
| feather.replace(); | |
| // Reset button after 2 seconds | |
| setTimeout(() => { | |
| this.innerHTML = '<i data-feather="download" class="mr-2"></i> Generate PDF Presentation'; | |
| feather.replace(); | |
| }, 2000); | |
| }, 2000); | |
| }); | |
| }); |