Spaces:
Running
Running
Download script.js from yy689/camerasnap: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/yy689/camerasnap/resolve/main/script.js
- Command line
-
hf download hf://spaces/yy689/camerasnap/script.js
-
curl -L -o script.js https://huggingface.co/spaces/yy689/camerasnap/resolve/main/script.js
1.05 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| const captureBtn = document.getElementById('capture-btn'); | |
| const switchCameraBtn = document.getElementById('switch-camera'); | |
| const galleryBtn = document.getElementById('gallery-btn'); | |
| // Capture button animation | |
| captureBtn.addEventListener('click', function() { | |
| this.classList.add('animate-pulse'); | |
| setTimeout(() => { | |
| this.classList.remove('animate-pulse'); | |
| alert('Photo captured! 📸'); | |
| }, 500); | |
| }); | |
| // Switch camera functionality | |
| switchCameraBtn.addEventListener('click', function() { | |
| this.classList.add('animate-spin'); | |
| setTimeout(() => { | |
| this.classList.remove('animate-spin'); | |
| alert('Switched camera! 🔄'); | |
| }, 1000); | |
| }); | |
| // Gallery button | |
| galleryBtn.addEventListener('click', function() { | |
| alert('Opening gallery... 🖼️'); | |
| }); | |
| // Simulate camera access | |
| console.log('CameraSnap initialized!'); | |
| }); |