diff --git a/web/ui/app.js b/web/ui/app.js index 6124a6f..2e934d7 100644 --- a/web/ui/app.js +++ b/web/ui/app.js @@ -204,7 +204,6 @@ function renderSampleCards(samples) { return samples.map(s => `
${esc(s.name)} -
`).join(''); } @@ -234,8 +233,8 @@ function renderLibraries(libs) { const sampleCount = Object.values(programs).reduce((sum, s) => sum + s.length, 0); return `
-
-

${esc(cleanName(lib))}

+
+

${esc(cleanName(lib))}

${progCount} programs · ${sampleCount} samples
@@ -383,3 +382,17 @@ document.addEventListener('click', function(e) { playWav(btn.dataset.wav); } }); + +// Section collapse toggle +document.querySelectorAll('.section-toggle').forEach(h => { + h.addEventListener('click', function () { + this.classList.toggle('collapsed'); + const target = document.getElementById(this.dataset.section); + target.style.display = target.style.display === 'none' ? '' : 'none'; + }); +}); + +// Collapse all libraries +document.getElementById('wav-collapse-all').addEventListener('click', function () { + document.querySelectorAll('.library-card').forEach(c => c.classList.add('collapsed')); +}); diff --git a/web/ui/index.html b/web/ui/index.html index 889edb8..3f462e6 100644 --- a/web/ui/index.html +++ b/web/ui/index.html @@ -40,13 +40,17 @@
-

Sample Library

+

Sample Library

+
diff --git a/web/ui/style.css b/web/ui/style.css index 32aae1a..217dc61 100644 --- a/web/ui/style.css +++ b/web/ui/style.css @@ -50,6 +50,23 @@ section { margin-bottom: 20px; } +/* Section collapse toggle */ +.section-toggle { + cursor: pointer; + user-select: none; + display: flex; + align-items: center; + gap: 8px; +} +.toggle-icon { + font-size: 12px; + transition: transform 0.2s; + display: inline-block; +} +.section-toggle.collapsed .toggle-icon { + transform: rotate(-90deg); +} + h2 { font-size: 16px; color: var(--text2); @@ -298,52 +315,59 @@ h2 { border: 1px solid var(--bg3); border-radius: var(--radius); overflow: hidden; + margin-bottom: 8px; } .library-header { - padding: 14px 18px; + padding: 10px 16px; cursor: pointer; user-select: none; background: var(--bg); - border-bottom: 1px solid transparent; + border-bottom: 1px solid var(--bg3); transition: border-color 0.15s; + display: flex; + align-items: center; + gap: 12px; } .library-header:hover { border-color: var(--accent); } .library-header h3 { - font-size: 15px; + font-size: 14px; font-weight: 600; color: var(--text); margin: 0; text-transform: none; letter-spacing: 0; + display: flex; + align-items: center; + gap: 4px; } .library-header .lib-meta { - font-size: 12px; + font-size: 11px; color: var(--text2); - margin-top: 4px; + margin-left: auto; } .library-programs { - padding: 10px 18px 16px; + padding: 8px 16px 12px; } /* Program cards */ .program-card { - margin-top: 14px; + margin-top: 10px; } .program-card:first-child { margin-top: 0; } .program-header { - cursor: pointer; + cursor: default; user-select: none; - margin-bottom: 8px; + margin-bottom: 6px; } .program-header h4 { - font-size: 13px; + font-size: 12px; font-weight: 600; color: var(--accent); margin: 0; @@ -352,30 +376,28 @@ h2 { display: inline; } .program-header .prog-meta { - font-size: 11px; + font-size: 10px; color: var(--text2); - margin-left: 8px; + margin-left: 6px; } .program-samples { display: grid; - grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); - gap: 6px; + grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); + gap: 4px; } /* Sample cards */ .sample-card { background: var(--bg); border: 1px solid var(--bg3); - border-radius: var(--radius); - padding: 8px 10px; + border-radius: 4px; + padding: 4px 8px; cursor: pointer; display: flex; - flex-direction: column; align-items: center; justify-content: center; - gap: 4px; - min-height: 64px; + min-height: 28px; transition: border-color 0.15s, background 0.15s; } .sample-card:hover { @@ -383,10 +405,10 @@ h2 { } .sample-card.playing { border-color: var(--green); - background: rgba(78, 204, 163, 0.1); + background: rgba(78, 204, 163, 0.15); } .sample-card .sample-name { - font-size: 11px; + font-size: 10px; color: var(--text); text-align: center; overflow: hidden; @@ -395,7 +417,40 @@ h2 { max-width: 100%; } .sample-card .sample-play-icon { - font-size: 14px; - color: var(--accent2); - line-height: 1; + display: none; +} + +/* Collapse all button */ +.wav-summary-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} +.collapse-all-btn { + background: var(--bg3); + color: var(--text2); + border: none; + border-radius: 4px; + padding: 4px 10px; + font-size: 11px; + cursor: pointer; + white-space: nowrap; +} +.collapse-all-btn:hover { + color: var(--text); +} + +/* Library collapse state */ +.library-card.collapsed .library-programs { + display: none; +} +.library-header .lib-toggle { + font-size: 11px; + transition: transform 0.2s; + margin-left: 8px; + color: var(--text2); +} +.library-card.collapsed .lib-toggle { + transform: rotate(-90deg); } \ No newline at end of file