From d43959728dcd48177059eee40957f6f5acc62c43 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Fri, 4 Sep 2026 11:16:05 +0200 Subject: [PATCH] refactor: split voice design styles --- CHANGELOG.md | 2 ++ TODO.md | 1 + VERSION | 2 +- docs/ARCHITECTURE.md | 1 + static/css/voice-design.css | 41 +++++++++++++++++++++++++++++++++++++ static/index.html | 11 +++++----- static/style.css | 41 ------------------------------------- 7 files changed, 52 insertions(+), 47 deletions(-) create mode 100644 static/css/voice-design.css diff --git a/CHANGELOG.md b/CHANGELOG.md index b4b47ad..e45e35e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi ## [Unreleased] ### Changed +- **Voice Design stylesheet split.** Voice-design form, sample-grid, and preview-match rules now live in + `static/css/voice-design.css`. - **Background-job stylesheet split.** Job history and retry-panel rules now live in `static/css/background-jobs.css`. - **Resource diagnostics stylesheet split.** Performance-panel styles now live in `static/css/resource-diagnostics.css` and are loaded with the same release cache-busting version as the core stylesheet. diff --git a/TODO.md b/TODO.md index 110b81c..54d2f6d 100644 --- a/TODO.md +++ b/TODO.md @@ -138,6 +138,7 @@ architecture change: the larger Audiobook/Rehearser/style split. - [x] Extract Audiobook cast serialization and page-stamping helpers into `audiobook-cast.js`. - [x] Split the Performance/resource diagnostic styles into `static/css/resource-diagnostics.css`. - [x] Split background-job history and retry-panel styles into `static/css/background-jobs.css`. +- [x] Split Voice Design form and sample-grid styles into `static/css/voice-design.css`. - [ ] Split `style.css` by feature. - [ ] Do not migrate to TypeScript or rewrite the frontend until behavior is covered by tests. diff --git a/VERSION b/VERSION index 4408ed4..68eebc0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.24.35 +1.24.36 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 6d6bf2b..577a6c9 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -38,6 +38,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed) - ✅ `audiobook-cast.js` — cast Markdown export and legacy page-stamping migration helpers; live casting remains in `audiobook.js`. - ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles. - ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles. +- ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles. - ✅ `rehearser-train.js` — transcript normalization, LCS comparison, and word-level training feedback; microphone/state wiring remains in `rehearser.js`. - ✅ `rehearser-library.js` — SQLite persistence helpers and IndexedDB migration; import/export and auto-save remain in `rehearser.js` until their UI/event-handler dependencies are isolated. diff --git a/static/css/voice-design.css b/static/css/voice-design.css new file mode 100644 index 0000000..beb4781 --- /dev/null +++ b/static/css/voice-design.css @@ -0,0 +1,41 @@ +/* ── Voice Design feature ─────────────────────────────────────────────────── */ +.design-hints { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; color: var(--subtext); } +.design-hints th, .design-hints td { text-align: left; vertical-align: top; padding: 7px 9px; border-bottom: 1px solid var(--border); } +.design-hints th { color: var(--text); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; } +.design-samples-details summary { cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--subtext); user-select: none; list-style: none; } +.design-samples-details summary::-webkit-details-marker { display: none; } +.design-samples-details summary::before { content: '\25B6'; color: var(--accent); font-size: 14px; } +.design-samples-details[open] summary::before { content: '\25BC'; } +.design-samples-details summary span:first-child { font-size: 12px; font-weight: 700; color: var(--subtext); text-transform: uppercase; letter-spacing: .09em; } +.design-samples-details .design-sample-header { margin-top: 12px; } +.preset-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; } +.preset-row input, .preset-row select { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; } +.design-sample-grid { display: grid; grid-template-columns: minmax(150px,1fr) 52px 86px minmax(220px,1.4fr) minmax(220px,1.4fr) 176px; gap: 8px; align-items: center; } +.design-sample-header { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); } +.design-sample-header div { white-space: nowrap; overflow: hidden; font-size: 14px; font-weight: 700; color: var(--subtext); text-transform: uppercase; letter-spacing: .07em; } +.qwen-sample { border: 1px solid var(--border); border-radius: 6px; background: var(--panel); padding: 8px 10px; transition: border-color .15s; } +.qwen-sample:hover { border-color: var(--accent); } +.qwen-sample strong { color: var(--accent); font-size: 13px; } +.qwen-sample .sample-sex, .qwen-sample .sample-language { color: var(--subtext); font-size: 12px; font-family: monospace; } +.qwen-sample .sample-desc, .qwen-sample .sample-text { color: var(--subtext); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.qwen-sample audio { display: none; grid-column: 1 / -1; margin-top: 6px; } +.qwen-sample-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; } +.lang-select { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; } +.d-naming-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; } +.d-naming-row .field { flex: 0 0 auto; } +.d-naming-row .field.flex1 { flex: 1 1 140px; } +#d-voice-id { font-family: monospace; font-weight: 600; font-size: 15px; color: var(--accent); width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; } +#d-transcript { min-height: 70px; width: 100%; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; font-family: inherit; resize: vertical; } +#d-lang, #d-gender, #d-name { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; } +#design-save-result { display: flex; flex-direction: column; gap: 8px; } +#tts-voice-select { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; min-width: 200px; } +.preview-match-panel { margin-top: 12px; border: 1px solid var(--border); border-radius: 6px; background: rgba(37,99,235,.04); padding: 12px; display: grid; grid-template-columns: minmax(220px,.75fr) minmax(260px,1fr); gap: 12px; } +.preview-match-panel[hidden] { display: none; } +.preview-match-meta { display: flex; flex-direction: column; gap: 8px; min-width: 0; } +.preview-match-title { font-weight: 700; color: var(--text); } +.preview-match-detail { color: var(--subtext); font-size: 12px; line-height: 1.45; } +.preview-match-warning { color: var(--yellow); font-size: 12px; line-height: 1.45; } +.preview-match-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } +.preview-match-panel audio { width: 100%; min-width: 0; } +.preview-match-transcript { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px; color: var(--subtext); font-family: monospace; font-size: 12px; line-height: 1.4; max-height: 88px; overflow: auto; white-space: pre-wrap; } +@media (max-width: 900px) { .preview-match-panel { grid-template-columns: 1fr; } } diff --git a/static/index.html b/static/index.html index b11af2a..3aad0d1 100644 --- a/static/index.html +++ b/static/index.html @@ -10,7 +10,7 @@ - + @@ -27,9 +27,10 @@ - - - + + + + @@ -394,7 +395,7 @@ window.toggleNavTree = function(treeId, chevronId) { - + diff --git a/static/style.css b/static/style.css index d49a363..3aa3bfe 100644 --- a/static/style.css +++ b/static/style.css @@ -509,47 +509,6 @@ audio { width: 100%; } } -/* ── Voice Design ───────────────────────────────────────────────────────── */ -.design-hints { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; color: var(--subtext); } -.design-hints th, .design-hints td { text-align: left; vertical-align: top; padding: 7px 9px; border-bottom: 1px solid var(--border); } -.design-hints th { color: var(--text); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; } -.design-samples-details summary { cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--subtext); user-select: none; list-style: none; } -.design-samples-details summary::-webkit-details-marker { display: none; } -.design-samples-details summary::before { content: '\25B6'; color: var(--accent); font-size: 14px; } -.design-samples-details[open] summary::before { content: '\25BC'; } -.design-samples-details summary span:first-child { font-size: 12px; font-weight: 700; color: var(--subtext); text-transform: uppercase; letter-spacing: .09em; } -.design-samples-details .design-sample-header { margin-top: 12px; } -.preset-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; } -.preset-row input, .preset-row select { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; } -.design-sample-grid { display: grid; grid-template-columns: minmax(150px,1fr) 52px 86px minmax(220px,1.4fr) minmax(220px,1.4fr) 176px; gap: 8px; align-items: center; } -.design-sample-header { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); } -.design-sample-header div { white-space: nowrap; overflow: hidden; font-size: 14px; font-weight: 700; color: var(--subtext); text-transform: uppercase; letter-spacing: .07em; } -.qwen-sample { border: 1px solid var(--border); border-radius: 6px; background: var(--panel); padding: 8px 10px; transition: border-color .15s; } -.qwen-sample:hover { border-color: var(--accent); } -.qwen-sample strong { color: var(--accent); font-size: 13px; } -.qwen-sample .sample-sex, .qwen-sample .sample-language { color: var(--subtext); font-size: 12px; font-family: monospace; } -.qwen-sample .sample-desc, .qwen-sample .sample-text { color: var(--subtext); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.qwen-sample audio { display: none; grid-column: 1 / -1; margin-top: 6px; } -.qwen-sample-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; } -.lang-select { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; } -.d-naming-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; } -.d-naming-row .field { flex: 0 0 auto; } -.d-naming-row .field.flex1 { flex: 1 1 140px; } -#d-voice-id { font-family: monospace; font-weight: 600; font-size: 15px; color: var(--accent); width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; } -#d-transcript { min-height: 70px; width: 100%; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; font-family: inherit; resize: vertical; } -#d-lang, #d-gender, #d-name { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; } -#design-save-result { display: flex; flex-direction: column; gap: 8px; } -#tts-voice-select { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; min-width: 200px; } -.preview-match-panel { margin-top: 12px; border: 1px solid var(--border); border-radius: 6px; background: rgba(37,99,235,.04); padding: 12px; display: grid; grid-template-columns: minmax(220px,.75fr) minmax(260px,1fr); gap: 12px; } -.preview-match-panel[hidden] { display: none; } -.preview-match-meta { display: flex; flex-direction: column; gap: 8px; min-width: 0; } -.preview-match-title { font-weight: 700; color: var(--text); } -.preview-match-detail { color: var(--subtext); font-size: 12px; line-height: 1.45; } -.preview-match-warning { color: var(--yellow); font-size: 12px; line-height: 1.45; } -.preview-match-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } -.preview-match-panel audio { width: 100%; min-width: 0; } -.preview-match-transcript { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px; color: var(--subtext); font-family: monospace; font-size: 12px; line-height: 1.4; max-height: 88px; overflow: auto; white-space: pre-wrap; } -@media (max-width: 900px) { .preview-match-panel { grid-template-columns: 1fr; } } .tryout-voice-row { display: grid; grid-template-columns: minmax(150px,1fr) minmax(230px,1.7fr) minmax(150px,1fr); gap: 12px; align-items: end; } .tryout-voice-row .field select { width: 100%; min-width: 0; } .tryout-voice-pick { display: flex; gap: 6px; align-items: stretch; min-width: 0; }