| // Initialize recording functionality | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // Timer functionality for recording | |
| let seconds = 0; | |
| const timerElement = document.getElementById('recording-timer'); | |
| const timer = setInterval(() => { | |
| seconds++; | |
| const mins = Math.floor(seconds / 60).toString().padStart(2, '0'); | |
| const secs = (seconds % 60).toString().padStart(2, '0'); | |
| timerElement.textContent = `${mins}:${secs}`; | |
| }, 1000); | |
| // Stop recording button | |
| document.getElementById('stop-recording').addEventListener('click', () => { | |
| clearInterval(timer); | |
| alert('Recording stopped'); | |
| }); | |
| }); |