document.getElementById('analysis-form').addEventListener('submit', function(e) { e.preventDefault(); const audioFile = document.getElementById('audio-file').files[0]; if (!audioFile) { alert('Please select an audio file.'); return; } const analysisResult = document.getElementById('analysis-result'); const spinner = document.getElementById('spinner'); const alertPlaceholder = document.getElementById('alert-placeholder'); analysisResult.style.display = 'block'; spinner.style.display = 'flex'; alertPlaceholder.innerHTML = ''; setTimeout(() => { spinner.style.display = 'none'; const isHarmful = Math.random() < 0.5; let alertHtml = ''; if (isHarmful) { alertHtml = `
Our analysis indicates that this call may contain harmful content. We recommend reviewing the call details.
Timestamp: ${new Date().toLocaleString()}
No harmful content was detected in this call.
Timestamp: ${new Date().toLocaleString()}