audio-alchemy-unmixer / index.html
maximumsin's picture
实现一个能从音乐中分离人声和背景音乐的功能
0a17af6 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Audio Alchemy Unmixer | Separate Vocals & Instrumentals</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.waves.min.js"></script>
<style>
.dropzone {
border: 2px dashed rgba(255,255,255,0.3);
transition: all 0.3s ease;
}
.dropzone.active {
border-color: #4F46E5;
background-color: rgba(79, 70, 229, 0.1);
}
.waveform {
height: 120px;
background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
border-radius: 12px;
}
.audio-controls button {
transition: all 0.2s ease;
}
.audio-controls button:hover {
transform: scale(1.05);
}
</style>
</head>
<body class="bg-gradient-to-br from-gray-900 to-indigo-900 text-white min-h-screen">
<div id="vanta-bg" class="fixed inset-0 -z-10"></div>
<div class="container mx-auto px-4 py-12 max-w-5xl">
<header class="text-center mb-16">
<h1 class="text-5xl font-bold mb-4 bg-clip-text text-transparent bg-gradient-to-r from-purple-400 via-pink-500 to-indigo-500">
Audio Alchemy Unmixer
</h1>
<p class="text-xl text-gray-300 max-w-2xl mx-auto">
Magically separate vocals from instrumentals with our AI-powered audio processing
</p>
</header>
<main>
<div class="bg-gray-800 bg-opacity-50 backdrop-blur-lg rounded-2xl p-8 shadow-2xl">
<div class="flex flex-col md:flex-row gap-8">
<!-- Upload Section -->
<div class="flex-1">
<div
id="dropzone"
class="dropzone rounded-xl p-8 text-center cursor-pointer hover:bg-gray-700 hover:bg-opacity-30 transition-colors"
>
<div class="space-y-4">
<div class="mx-auto w-16 h-16 bg-indigo-600 rounded-full flex items-center justify-center">
<i data-feather="upload" class="w-8 h-8"></i>
</div>
<h3 class="text-xl font-semibold">Drop your audio file here</h3>
<p class="text-gray-400">or click to browse files (MP3, WAV, FLAC)</p>
<input type="file" id="fileInput" class="hidden" accept="audio/*" />
</div>
</div>
<div class="mt-6">
<h3 class="text-lg font-medium mb-3">Recording Options</h3>
<div class="flex flex-col sm:flex-row gap-4">
<button class="flex-1 bg-indigo-600 hover:bg-indigo-700 py-3 px-4 rounded-lg flex items-center justify-center gap-2">
<i data-feather="mic" class="w-5 h-5"></i>
Record Microphone
</button>
<button class="flex-1 bg-gray-700 hover:bg-gray-600 py-3 px-4 rounded-lg flex items-center justify-center gap-2">
<i data-feather="youtube" class="w-5 h-5"></i>
Import from YouTube
</button>
</div>
</div>
</div>
<!-- Settings Section -->
<div class="flex-1">
<h2 class="text-2xl font-bold mb-6">Processing Options</h2>
<div class="space-y-6">
<div>
<label class="block text-sm font-medium mb-2">Processing Mode</label>
<div class="flex flex-col sm:flex-row gap-3">
<button class="flex-1 bg-indigo-600 py-2 px-4 rounded-lg text-center">Standard</button>
<button class="flex-1 bg-gray-700 py-2 px-4 rounded-lg text-center">Professional</button>
<button class="flex-1 bg-gray-700 py-2 px-4 rounded-lg text-center">Ultra HD</button>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-2">Output Components</label>
<div class="grid grid-cols-2 gap-3">
<label class="flex items-center space-x-2 bg-gray-700 bg-opacity-50 p-3 rounded-lg cursor-pointer">
<input type="checkbox" class="form-checkbox h-5 w-5 text-indigo-600 rounded" checked>
<span>Vocals Only</span>
</label>
<label class="flex items-center space-x-2 bg-gray-700 bg-opacity-50 p-3 rounded-lg cursor-pointer">
<input type="checkbox" class="form-checkbox h-5 w-5 text-indigo-600 rounded" checked>
<span>Instrumental</span>
</label>
<label class="flex items-center space-x-2 bg-gray-700 bg-opacity-50 p-3 rounded-lg cursor-pointer">
<input type="checkbox" class="form-checkbox h-5 w-5 text-indigo-600 rounded">
<span>Drums</span>
</label>
<label class="flex items-center space-x-2 bg-gray-700 bg-opacity-50 p-3 rounded-lg cursor-pointer">
<input type="checkbox" class="form-checkbox h-5 w-5 text-indigo-600 rounded">
<span>Bass</span>
</label>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-2">Quality</label>
<input type="range" min="1" max="5" value="3" class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer">
<div class="flex justify-between text-xs text-gray-400 mt-1">
<span>Fast</span>
<span>Balanced</span>
<span>High Quality</span>
</div>
</div>
</div>
<button id="processBtn" class="mt-8 w-full bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-700 hover:to-indigo-700 py-4 px-6 rounded-xl font-bold text-lg shadow-lg transition-all transform hover:scale-105">
Start Audio Alchemy
</button>
</div>
</div>
<!-- Results Section (Hidden by default) -->
<div id="resultsSection" class="mt-12 hidden">
<h2 class="text-2xl font-bold mb-6">Your Separated Tracks</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Vocals Track -->
<div class="bg-gray-800 rounded-xl p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold flex items-center gap-2">
<i data-feather="user" class="w-5 h-5 text-pink-500"></i>
Vocals
</h3>
<span class="text-xs bg-pink-900 text-pink-300 px-2 py-1 rounded-full">5.2 MB</span>
</div>
<div class="waveform mb-4" id="vocalsWaveform"></div>
<div class="audio-controls flex justify-between items-center">
<button class="bg-pink-600 hover:bg-pink-700 w-10 h-10 rounded-full flex items-center justify-center">
<i data-feather="play" class="w-4 h-4"></i>
</button>
<div class="flex gap-2">
<button class="bg-gray-700 hover:bg-gray-600 w-8 h-8 rounded-full flex items-center justify-center">
<i data-feather="download" class="w-3 h-3"></i>
</button>
<button class="bg-gray-700 hover:bg-gray-600 w-8 h-8 rounded-full flex items-center justify-center">
<i data-feather="share-2" class="w-3 h-3"></i>
</button>
</div>
</div>
</div>
<!-- Instrumental Track -->
<div class="bg-gray-800 rounded-xl p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold flex items-center gap-2">
<i data-feather="music" class="w-5 h-5 text-indigo-500"></i>
Instrumental
</h3>
<span class="text-xs bg-indigo-900 text-indigo-300 px-2 py-1 rounded-full">7.8 MB</span>
</div>
<div class="waveform mb-4" id="instrumentalWaveform"></div>
<div class="audio-controls flex justify-between items-center">
<button class="bg-indigo-600 hover:bg-indigo-700 w-10 h-10 rounded-full flex items-center justify-center">
<i data-feather="play" class="w-4 h-4"></i>
</button>
<div class="flex gap-2">
<button class="bg-gray-700 hover:bg-gray-600 w-8 h-8 rounded-full flex items-center justify-center">
<i data-feather="download" class="w-3 h-3"></i>
</button>
<button class="bg-gray-700 hover:bg-gray-600 w-8 h-8 rounded-full flex items-center justify-center">
<i data-feather="share-2" class="w-3 h-3"></i>
</button>
</div>
</div>
</div>
</div>
<div class="mt-8 text-center">
<button class="inline-flex items-center gap-2 bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-700 hover:to-indigo-700 py-3 px-6 rounded-lg font-medium">
<i data-feather="download-cloud"></i>
Download All Tracks
</button>
</div>
</div>
</div>
<!-- How it works section -->
<div class="mt-20 text-center">
<h2 class="text-3xl font-bold mb-4">How the Magic Happens</h2>
<p class="text-gray-300 max-w-3xl mx-auto mb-12">
Our AI analyzes your audio file using advanced machine learning models to identify and isolate different components of the music.
</p>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-xl">
<div class="w-16 h-16 bg-indigo-600 rounded-full flex items-center justify-center mx-auto mb-4">
<i data-feather="upload" class="w-8 h-8"></i>
</div>
<h3 class="text-xl font-semibold mb-2">Upload</h3>
<p class="text-gray-400">Drag & drop your music file or record directly</p>
</div>
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-xl">
<div class="w-16 h-16 bg-indigo-600 rounded-full flex items-center justify-center mx-auto mb-4">
<i data-feather="cpu" class="w-8 h-8"></i>
</div>
<h3 class="text-xl font-semibold mb-2">Process</h3>
<p class="text-gray-400">Our AI separates vocals and instruments</p>
</div>
<div class="bg-gray-800 bg-opacity-50 p-6 rounded-xl">
<div class="w-16 h-16 bg-indigo-600 rounded-full flex items-center justify-center mx-auto mb-4">
<i data-feather="download" class="w-8 h-8"></i>
</div>
<h3 class="text-xl font-semibold mb-2">Download</h3>
<p class="text-gray-400">Get your isolated tracks instantly</p>
</div>
</div>
</div>
</main>
</div>
<footer class="mt-20 py-8 text-center text-gray-400">
<div class="container mx-auto px-4">
<div class="flex justify-center gap-6 mb-6">
<a href="#" class="hover:text-white transition-colors">About</a>
<a href="#" class="hover:text-white transition-colors">Privacy</a>
<a href="#" class="hover:text-white transition-colors">Terms</a>
<a href="#" class="hover:text-white transition-colors">Contact</a>
</div>
<p>© 2023 Audio Alchemy Unmixer. All rights reserved.</p>
</div>
</footer>
<script>
// Initialize Vanta.js background
VANTA.WAVES({
el: "#vanta-bg",
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: 0x4b0082,
shininess: 35.00,
waveHeight: 15.00,
waveSpeed: 0.85,
zoom: 0.8
});
// Initialize Feather Icons
feather.replace();
// Dropzone functionality
const dropzone = document.getElementById('dropzone');
const fileInput = document.getElementById('fileInput');
const processBtn = document.getElementById('processBtn');
const resultsSection = document.getElementById('resultsSection');
dropzone.addEventListener('click', () => fileInput.click());
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
dropzone.addEventListener(eventName, preventDefaults, false);
});
function preventDefaults(e) {
e.preventDefault();
e.stopPropagation();
}
['dragenter', 'dragover'].forEach(eventName => {
dropzone.addEventListener(eventName, highlight, false);
});
['dragleave', 'drop'].forEach(eventName => {
dropzone.addEventListener(eventName, unhighlight, false);
});
function highlight() {
dropzone.classList.add('active');
}
function unhighlight() {
dropzone.classList.remove('active');
}
dropzone.addEventListener('drop', handleDrop, false);
function handleDrop(e) {
const dt = e.dataTransfer;
const files = dt.files;
handleFiles(files);
}
fileInput.addEventListener('change', function() {
if (this.files.length) {
handleFiles(this.files);
}
});
function handleFiles(files) {
const audioFile = files[0];
if (!audioFile.type.match('audio.*')) {
alert('Please upload an audio file');
return;
}
// Simulate processing
processBtn.addEventListener('click', function() {
processBtn.innerHTML = '<i data-feather="loader" class="animate-spin mr-2"></i> Processing...';
processBtn.disabled = true;
setTimeout(() => {
resultsSection.classList.remove('hidden');
processBtn.innerHTML = 'Process Another File';
processBtn.disabled = false;
feather.replace();
// Scroll to results
resultsSection.scrollIntoView({ behavior: 'smooth' });
}, 3000);
});
// Show process button
processBtn.classList.remove('hidden');
}
</script>
</body>
</html>