Download static/application.js from juancmamacias/yolo-multi-class-annotator: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/spaces/juancmamacias/yolo-multi-class-annotator/resolve/main/static/application.js
- Command line
-
hf download hf://spaces/juancmamacias/yolo-multi-class-annotator/static/application.js
-
curl -L -o application.js https://huggingface.co/spaces/juancmamacias/yolo-multi-class-annotator/resolve/main/static/application.js
1.28 kB
| // ===== MODAL DE INSTRUCCIONES ===== | |
| function initializeModal() { | |
| const modal = document.getElementById('instructionsModal'); | |
| const helpBtn = document.getElementById('helpBtn'); | |
| const closeBtn = document.querySelector('.close'); | |
| if (!modal || !helpBtn || !closeBtn) return; | |
| // Abrir modal | |
| helpBtn.addEventListener('click', function() { | |
| modal.style.display = 'block'; | |
| document.body.style.overflow = 'hidden'; | |
| }); | |
| // Cerrar modal con X | |
| closeBtn.addEventListener('click', function() { | |
| modal.style.display = 'none'; | |
| document.body.style.overflow = 'auto'; | |
| }); | |
| // Cerrar modal clickeando fuera | |
| window.addEventListener('click', function(event) { | |
| if (event.target === modal) { | |
| modal.style.display = 'none'; | |
| document.body.style.overflow = 'auto'; | |
| } | |
| }); | |
| // Cerrar con tecla ESC | |
| document.addEventListener('keydown', function(event) { | |
| if (event.key === 'Escape' && modal.style.display === 'block') { | |
| modal.style.display = 'none'; | |
| document.body.style.overflow = 'auto'; | |
| } | |
| }); | |
| } | |
| // Hacer función global para que pueda ser llamada desde otros JS | |
| window.initializeModal = initializeModal; | |