Spaces:
Running
Running
Download script.js from Amamia/gradegenius-pro: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/spaces/Amamia/gradegenius-pro/resolve/main/script.js
- Command line
-
hf download hf://spaces/Amamia/gradegenius-pro/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Amamia/gradegenius-pro/resolve/main/script.js
1.58 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Add event listeners for interactive elements | |
| document.querySelectorAll('button').forEach(button => { | |
| button.addEventListener('click', function() { | |
| this.classList.add('transform', 'scale-95'); | |
| setTimeout(() => { | |
| this.classList.remove('transform', 'scale-95'); | |
| }, 150); | |
| // Play click sound | |
| const sound = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-modern-click-box-check-1120.mp3'); | |
| sound.play(); | |
| }); | |
| }); | |
| // Make windows draggable | |
| document.addEventListener('mousedown', function(e) { | |
| if(e.target.closest('.window-header')) { | |
| const header = e.target.closest('.window-header'); | |
| const window = header.parentElement; | |
| let offsetX = e.clientX - window.getBoundingClientRect().left; | |
| let offsetY = e.clientY - window.getBoundingClientRect().top; | |
| function moveWindow(e) { | |
| window.style.left = (e.clientX - offsetX) + 'px'; | |
| window.style.top = (e.clientY - offsetY) + 'px'; | |
| } | |
| function stopMoving() { | |
| document.removeEventListener('mousemove', moveWindow); | |
| document.removeEventListener('mouseup', stopMoving); | |
| } | |
| document.addEventListener('mousemove', moveWindow); | |
| document.addEventListener('mouseup', stopMoving); | |
| } | |
| }); | |
| }); | |