Files
ace-step-ui/server/public/demucs-web/index.html
T

390 lines
13 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Extract Stems - ACE-Step UI</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--suno-bg: #09090b;
--suno-panel: #121214;
--suno-card: #18181b;
--suno-hover: #27272a;
--suno-border: #27272a;
--zinc-400: #a1a1aa;
--zinc-500: #71717a;
--zinc-600: #52525b;
--zinc-700: #3f3f46;
--zinc-800: #27272a;
--emerald-400: #34d399;
--emerald-500: #10b981;
--emerald-600: #059669;
--teal-400: #2dd4bf;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: var(--suno-bg);
color: #fff;
min-height: 100vh;
line-height: 1.5;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--zinc-700); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--zinc-600); }
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.header { text-align: center; margin-bottom: 2rem; }
.header h1 {
font-size: 2rem;
font-weight: 700;
margin-bottom: 0.5rem;
background: linear-gradient(to right, var(--emerald-500), var(--teal-400));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.header p { color: var(--zinc-500); font-size: 0.875rem; }
.badge {
display: inline-block;
padding: 0.25rem 0.75rem;
border-radius: 9999px;
font-size: 0.75rem;
font-weight: 500;
margin-top: 0.75rem;
}
.badge-detecting { background: var(--zinc-800); color: var(--zinc-400); }
.badge-gpu { background: rgba(16, 185, 129, 0.2); color: var(--emerald-400); }
.badge-cpu { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.card {
background: var(--suno-card);
border: 1px solid var(--suno-border);
border-radius: 0.75rem;
padding: 1.5rem;
margin-bottom: 1.5rem;
}
.drop-zone {
border: 2px dashed var(--zinc-700);
border-radius: 0.75rem;
padding: 3rem 2rem;
text-align: center;
cursor: pointer;
transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
border-color: var(--emerald-500);
background: rgba(16, 185, 129, 0.05);
}
.drop-zone-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.drop-zone p { color: var(--zinc-400); }
.drop-zone .hint { color: var(--zinc-500); font-size: 0.875rem; margin-top: 0.25rem; }
.file-name { margin-top: 1rem; color: var(--emerald-400); font-weight: 500; font-size: 0.875rem; }
input[type="file"] { display: none; }
.processing-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
}
.processing-header h3 { font-weight: 600; }
.btn {
padding: 0.5rem 1rem;
border-radius: 0.5rem;
font-size: 0.875rem;
font-weight: 600;
border: none;
cursor: pointer;
transition: all 0.2s;
}
.btn-primary {
background: var(--emerald-600);
color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--emerald-500); }
.btn-primary:disabled {
background: var(--zinc-700);
color: var(--zinc-500);
cursor: not-allowed;
}
.progress-bar {
height: 0.5rem;
background: var(--zinc-800);
border-radius: 9999px;
overflow: hidden;
margin-bottom: 0.75rem;
}
.progress-fill {
height: 100%;
background: linear-gradient(to right, var(--emerald-500), var(--teal-400));
transition: width 0.3s;
width: 0%;
}
.status { color: var(--zinc-400); font-size: 0.875rem; }
.stats-row {
display: none;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--zinc-800);
}
.stats-row.visible { display: grid; }
.stat-item { text-align: center; }
.stat-value { font-size: 1.125rem; font-weight: 600; color: var(--emerald-400); }
.stat-label { font-size: 0.75rem; color: var(--zinc-500); }
.log-detail {
display: none;
margin-top: 1rem;
padding: 0.75rem;
background: rgba(0, 0, 0, 0.3);
border-radius: 0.5rem;
max-height: 150px;
overflow-y: auto;
font-family: monospace;
font-size: 0.75rem;
}
.log-detail.visible { display: block; }
.log-line { padding: 0.25rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.log-line:last-child { border-bottom: none; }
.log-time { color: var(--emerald-400); margin-right: 0.5rem; }
.log-phase { color: var(--teal-400); margin-right: 0.5rem; }
.results { display: none; }
.results.visible { display: block; }
.results-card {
background: var(--suno-card);
border: 1px solid var(--suno-border);
border-radius: 0.75rem;
overflow: hidden;
}
.results-header {
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--zinc-800);
display: flex;
justify-content: space-between;
align-items: center;
}
.results-header-text h3 { font-weight: 600; margin-bottom: 0.25rem; }
.results-header-text p { color: var(--zinc-500); font-size: 0.75rem; }
.download-all-btn {
padding: 0.5rem 1rem;
background: var(--emerald-600);
color: white;
border: none;
border-radius: 0.5rem;
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
transition: all 0.2s;
}
.download-all-btn:hover { background: var(--emerald-500); }
.download-all-btn svg { width: 16px; height: 16px; }
.track {
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--zinc-800);
transition: background 0.2s;
}
.track:last-child { border-bottom: none; }
.track:hover { background: rgba(255,255,255,0.03); }
.track-row {
display: flex;
align-items: center;
gap: 1rem;
}
.track-info {
display: flex;
align-items: center;
gap: 0.75rem;
width: 140px;
flex-shrink: 0;
}
.track-icon {
width: 40px;
height: 40px;
border-radius: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
}
.track-icon.drums { background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.2); }
.track-icon.bass { background: rgba(168, 85, 247, 0.1); border: 1px solid rgba(168, 85, 247, 0.2); }
.track-icon.other { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); }
.track-icon.vocals { background: rgba(236, 72, 153, 0.1); border: 1px solid rgba(236, 72, 153, 0.2); }
.track-name { font-weight: 600; }
.track-duration { font-size: 0.75rem; color: var(--zinc-500); }
.track-player {
flex: 1;
display: flex;
align-items: center;
gap: 0.75rem;
}
.play-btn {
width: 32px;
height: 32px;
border-radius: 50%;
background: white;
color: black;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s;
flex-shrink: 0;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn svg { width: 14px; height: 14px; }
.track-progress {
flex: 1;
height: 6px;
background: var(--zinc-700);
border-radius: 3px;
cursor: pointer;
position: relative;
}
.track-progress-fill {
height: 100%;
border-radius: 3px;
transition: width 0.1s;
width: 0%;
}
.track-progress-fill.drums { background: linear-gradient(to right, #f97316, #f59e0b); }
.track-progress-fill.bass { background: linear-gradient(to right, #a855f7, #8b5cf6); }
.track-progress-fill.other { background: linear-gradient(to right, #3b82f6, #06b6d4); }
.track-progress-fill.vocals { background: linear-gradient(to right, #ec4899, #f43f5e); }
.track-time {
font-size: 0.75rem;
color: var(--zinc-500);
font-family: monospace;
width: 90px;
text-align: right;
flex-shrink: 0;
}
.download-btn {
padding: 0.375rem 0.75rem;
background: var(--zinc-800);
color: var(--zinc-400);
border: none;
border-radius: 0.375rem;
font-size: 0.75rem;
font-weight: 500;
cursor: pointer;
text-decoration: none;
display: flex;
align-items: center;
gap: 0.375rem;
transition: all 0.2s;
flex-shrink: 0;
}
.download-btn:hover { background: var(--zinc-700); color: white; }
.download-btn svg { width: 14px; height: 14px; }
</style>
</head>
<body>
<div class="container">
<!-- Header -->
<div class="header">
<h1>Stem Extraction</h1>
<p>AI-powered audio separation using Demucs</p>
<span id="backendBadge" class="badge badge-detecting">Detecting...</span>
</div>
<!-- Upload Card -->
<div class="card">
<div id="dropZone" class="drop-zone">
<div class="drop-zone-icon">🎵</div>
<p>Drop audio file here</p>
<p class="hint">or click to select</p>
<input type="file" id="fileInput" accept="audio/*">
<p id="audioFileName" class="file-name"></p>
</div>
</div>
<!-- Processing Card -->
<div class="card">
<div class="processing-header">
<h3>Processing</h3>
<button id="processBtn" class="btn btn-primary" disabled>Extract Stems</button>
</div>
<div class="progress-bar">
<div id="progressFill" class="progress-fill"></div>
</div>
<p id="status" class="status">Select an audio file to begin</p>
<div id="statsRow" class="stats-row">
<div class="stat-item">
<div id="statElapsed" class="stat-value">0:00</div>
<div class="stat-label">Elapsed</div>
</div>
<div class="stat-item">
<div id="statSegment" class="stat-value">0/0</div>
<div class="stat-label">Segment</div>
</div>
<div class="stat-item">
<div id="statSpeed" class="stat-value">-</div>
<div class="stat-label">Speed</div>
</div>
<div class="stat-item">
<div id="statETA" class="stat-value">--:--</div>
<div class="stat-label">ETA</div>
</div>
</div>
<div id="statusDetail" class="log-detail"></div>
</div>
<!-- Results -->
<div id="results" class="results">
<div class="results-card">
<div class="results-header">
<div class="results-header-text">
<h3>Separated Tracks</h3>
<p>Click to play, download individual stems</p>
</div>
<button class="download-all-btn" onclick="downloadAllStems()">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/>
</svg>
Download All
</button>
</div>
<div id="trackList"></div>
</div>
</div>
</div>
<script type="module" src="app.js"></script>
</body>
</html>