camerasnap / script.js
yy689's picture
creat a mobil app camera
7efb2bf verified
Raw History Blame Contribute Delete
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!');
});