voice-detector / frontend /upload.html
jawaduddin
Deploy: Firebase backend, relative API URLs, cleanup
c50afc1
Raw History Blame Contribute Delete
8.81 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload Audio - AI Voice Detection</title>
<link rel="icon" type="image/png" href="favicon.png">
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="styles.css?v=5">
<script src="theme.js?v=4"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="bg-gradient-to-br from-gray-50 to-blue-50 min-h-screen">
<!-- Navigation -->
<nav class="bg-white shadow-sm border-b border-gray-200"
style="background: var(--nav-bg); border-color: var(--card-border);">
<div class="container mx-auto px-6 py-4">
<div class="flex items-center justify-between">
<a href="index.html" class="flex items-center space-x-2 hover:opacity-80 transition">
<i class="fas fa-wave-square text-blue-600 text-2xl"></i>
<span class="text-xl font-bold text-gray-800" style="color: var(--text-color);">AI Voice
Detection</span>
</a>
<button id="themeToggle" class="theme-toggle" aria-label="Toggle Theme">
<i class="fas fa-moon"></i>
</button>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="container mx-auto px-6 py-12">
<div class="max-w-2xl mx-auto fade-in">
<!-- Header -->
<div class="text-center mb-8">
<h1 class="text-4xl font-bold text-gray-900 mb-3">Upload Audio File</h1>
<p class="text-gray-600">Upload an MP3 file to detect if it's AI-generated or human</p>
<div class="mt-2 text-xs text-blue-500 font-mono">Build v5.2 (Fixed)</div>
</div>
<!-- Upload Card -->
<div class="bg-white rounded-2xl shadow-lg border border-gray-200 p-8">
<!-- Drag & Drop Zone -->
<div id="dropZone"
class="border-3 border-dashed border-gray-300 rounded-xl p-12 text-center hover:border-blue-400 transition-colors cursor-pointer bg-gray-50 hover:bg-blue-50">
<svg class="w-16 h-16 text-gray-400 mx-auto mb-4" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12">
</path>
</svg>
<h3 class="text-lg font-semibold text-gray-700 mb-2">Drag & drop your audio file</h3>
<p class="text-gray-500 mb-4">or click to browse</p>
<input type="file" id="fileInput" accept=".mp3,audio/mp3" class="hidden">
<button onclick="document.getElementById('fileInput').click()"
class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg transition">
Choose File
</button>
</div>
<!-- File Info -->
<div id="fileInfo" class="hidden mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg">
<div class="flex items-center justify-between">
<div class="flex items-center space-x-3">
<svg class="w-8 h-8 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3">
</path>
</svg>
<div>
<p id="fileName" class="font-semibold text-gray-800"></p>
<p id="fileSize" class="text-sm text-gray-600"></p>
</div>
</div>
<button onclick="clearFile()" class="text-red-600 hover:text-red-700">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
</div>
<!-- Error Message -->
<div id="errorMessage" class="hidden mt-6 p-4 bg-red-50 border border-red-200 rounded-lg">
<div class="flex items-start space-x-3">
<svg class="w-6 h-6 text-red-600 flex-shrink-0" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<p id="errorText" class="text-red-800"></p>
</div>
</div>
<!-- Analyze Button -->
<button id="analyzeBtn" onclick="analyzeAudio()" disabled
class="w-full mt-6 bg-gray-300 text-gray-500 font-semibold py-3 rounded-lg cursor-not-allowed transition">
Analyze Voice
</button>
<!-- Loading State -->
<div id="loadingState" class="hidden mt-6 text-center">
<div class="inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mb-4"></div>
<p class="text-gray-700 font-medium">Analyzing audio...</p>
<p class="text-gray-500 text-sm mt-2">This may take a few seconds</p>
</div>
<!-- Supported Languages -->
<div class="mt-8 pt-6 border-t border-gray-200">
<h4 class="font-semibold text-gray-700 mb-3">Supported Languages</h4>
<div class="flex flex-wrap gap-2">
<span class="px-3 py-1 bg-blue-100 text-blue-700 rounded-full text-sm">Tamil</span>
<span class="px-3 py-1 bg-blue-100 text-blue-700 rounded-full text-sm">English</span>
<span class="px-3 py-1 bg-blue-100 text-blue-700 rounded-full text-sm">Hindi</span>
<span class="px-3 py-1 bg-blue-100 text-blue-700 rounded-full text-sm">Malayalam</span>
<span class="px-3 py-1 bg-blue-100 text-blue-700 rounded-full text-sm">Telugu</span>
</div>
</div>
<!-- Requirements -->
<div class="mt-6 p-4 bg-gray-50 rounded-lg">
<h4 class="font-semibold text-gray-700 mb-2 text-sm">Requirements</h4>
<ul class="text-sm text-gray-600 space-y-1">
<li>• File format: MP3</li>
<li>• Maximum size: 10MB</li>
<li>• Minimum duration: 0.5 seconds</li>
</ul>
</div>
</div>
</div>
</main>
<script src="script.js?v=6"></script>
<!-- Team Footer -->
<footer class="team-footer">
<div class="footer-divider"></div>
<div class="footer-content">
<h2 class="team-name">Bug Hunterx</h2>
<h3>Built by</h3>
<div class="team-members">
<div class="member">
<span class="name">Mohammed Meraj Uddin</span>
<a href="https://www.linkedin.com/in/merajuddin-0751a6396" target="_blank"
aria-label="LinkedIn for Mohammed Meraj Uddin">
<i class="fab fa-linkedin"></i>
</a>
</div>
<div class="member">
<span class="name">Mohd Basheer Ahmed</span>
<a href="https://www.linkedin.com/in/mohd-basheer-ahmed-5247593a6" target="_blank"
aria-label="LinkedIn for Mohd Basheer Ahmed">
<i class="fab fa-linkedin"></i>
</a>
</div>
</div>
<p class="footer-note">Responsive UI • Optimized for all screen sizes</p>
</div>
</footer>
</body>
</html>