Files
xiaoxia-saas/apps/web/src/components/voice/CloneModal/clone-modal.css
T
xiaoxia 9f9e492bf3
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3m8s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 3m37s
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 3m49s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 3m58s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 4m10s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m35s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m48s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 2m5s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 5m19s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 6m50s
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 30s
AI Code Review / AI Code Review (pull_request) Successful in 8m56s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 3m46s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 5m22s
fix(voices): 配音库四连修复——素材进度条隔离/TTS下拉克隆音色/克隆弹窗素材选择
1. 素材卡片进度条联动 bug:MaterialVoiceTab 与新配音库页 CardPlayer
   共用页面级 currentTime,非播放卡片也显示进度。改为仅播放中的卡片
   计算进度(参照 ClonedVoiceTab 隔离写法)
2. AI 配音弹窗音色下拉新增「我的克隆音色」分组:旧配音库页 VoiceSelector
   + useTtsSynthesize 透传 ready 克隆音色(ClonedVoiceDisplay);新配音库页
   TtsModal + hook 用 getVoiceClonesWithTotal 拉取并过滤 ready;选中克隆音色
   时 voice_id 直接传 profile UUID 由后端解析
3. 克隆音色弹窗改造:删除「上传音频文件」入口及拖拽/文件选择死代码;
   保留录音(录音后仍上传为素材再克隆,用户无感知);新增「从配音素材选择」
   下拉(getAssetsByKind voice,显示素材名+时长),选中直接传 asset_id
   克隆,跳过上传;素材为空提示「请先在配音库上传素材」+跳转入口
4. API:CreateVoiceCloneRequest/Full 支持 asset_id(与 audio_url 二选一);
   删除 components/voice 下无引用的旧架构死代码(clone-modal/hooks/constants/
   utils/types 共 12 个文件,-1088 行)

测试:tsc/ESLint/prettier 全过,604 单测通过,CloneModal 4 条交互用例
2026-08-30 14:43:04 +08:00

621 lines
14 KiB
CSS

/**
* CloneModal 样式
* 任务 3.13:音色克隆弹窗
*
* V21 Design System
* CSS 前缀:xx-clonemodal-
*/
/* ── 容器 ───────────────────────────────────────────────── */
.xx-clonemodal-body {
padding: 4px 0;
}
/* ── 步骤引导 ───────────────────────────────────────────── */
.xx-clonemodal-steps {
display: flex;
align-items: center;
justify-content: center;
gap: 0;
margin-bottom: 24px;
padding: 0 16px;
}
.xx-clonemodal-step {
display: flex;
align-items: center;
gap: 8px;
opacity: 0.5;
transition: opacity 0.2s ease;
}
.xx-clonemodal-step--active {
opacity: 1;
}
.xx-clonemodal-step-number {
width: 28px;
height: 28px;
border-radius: 50%;
background: var(--xx-color-primary, #6366f1);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 13px;
font-weight: 600;
flex-shrink: 0;
}
.xx-clonemodal-step:not(.xx-clonemodal-step--active) .xx-clonemodal-step-number {
background: var(--xx-color-border, #e5e7eb);
color: var(--xx-color-text-secondary, #6b7280);
}
.xx-clonemodal-step-label {
font-size: 13px;
font-weight: 500;
color: var(--xx-color-text, #111827);
white-space: nowrap;
}
.xx-clonemodal-step-connector {
width: 40px;
height: 2px;
background: var(--xx-color-border, #e5e7eb);
margin: 0 8px;
flex-shrink: 0;
}
/* ── 表单字段 ───────────────────────────────────────────── */
.xx-clonemodal-field {
margin-bottom: 18px;
position: relative;
}
.xx-clonemodal-label {
display: block;
font-size: 13px;
font-weight: 500;
color: var(--xx-color-text, #111827);
margin-bottom: 6px;
}
.xx-clonemodal-required {
color: var(--xx-color-error, #ef4444);
margin-left: 2px;
}
.xx-clonemodal-input {
width: 100%;
padding: 10px 14px;
border: 1px solid var(--xx-color-border, #e5e7eb);
border-radius: var(--radius-xs);
font-size: 14px;
color: var(--xx-color-text, #111827);
background: var(--xx-color-bg-secondary, #f9fafb);
outline: none;
transition:
border-color 0.2s ease,
box-shadow 0.2s ease;
box-sizing: border-box;
}
.xx-clonemodal-input:focus {
border-color: var(--xx-color-primary, #6366f1);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.xx-clonemodal-input::placeholder {
color: var(--xx-color-text-placeholder, #9ca3af);
}
.xx-clonemodal-textarea {
width: 100%;
padding: 10px 14px;
border: 1px solid var(--xx-color-border, #e5e7eb);
border-radius: var(--radius-xs);
font-size: 14px;
color: var(--xx-color-text, #111827);
background: var(--xx-color-bg-secondary, #f9fafb);
outline: none;
resize: vertical;
font-family: inherit;
transition:
border-color 0.2s ease,
box-shadow 0.2s ease;
box-sizing: border-box;
}
.xx-clonemodal-textarea:focus {
border-color: var(--xx-color-primary, #6366f1);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.xx-clonemodal-textarea::placeholder {
color: var(--xx-color-text-placeholder, #9ca3af);
}
.xx-clonemodal-char-count {
position: absolute;
right: 0;
top: 0;
font-size: 12px;
color: var(--xx-color-text-secondary, #6b7280);
}
/* ── 上传区域 ───────────────────────────────────────────── */
/* ── 素材选择空态 ─────────────────────────────────────────── */
.xx-clonemodal-asset-empty {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 14px 16px;
border: 1px dashed var(--xx-color-border, #e5e7eb);
border-radius: var(--radius-sm);
background: var(--xx-color-bg-secondary, #f9fafb);
}
.xx-clonemodal-asset-empty-text {
margin: 0;
font-size: 13px;
color: var(--xx-color-text-secondary, #6b7280);
}
/* ── 错误提示 ───────────────────────────────────────────── */
/* ── 错误提示 ───────────────────────────────────────────── */
.xx-clonemodal-error {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
border-radius: var(--radius-xs);
background: rgba(239, 68, 68, 0.08);
border: 1px solid rgba(239, 68, 68, 0.2);
color: var(--xx-color-error, #ef4444);
font-size: 13px;
margin-bottom: 16px;
}
.xx-clonemodal-error-icon {
flex-shrink: 0;
font-size: 14px;
}
/* ── 提示 ───────────────────────────────────────────────── */
.xx-clonemodal-tip {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 10px 14px;
border-radius: var(--radius-xs);
background: rgba(99, 102, 241, 0.06);
font-size: 12px;
color: var(--xx-color-text-secondary, #6b7280);
margin-bottom: 20px;
line-height: 1.5;
}
.xx-clonemodal-tip-icon {
flex-shrink: 0;
font-size: 14px;
}
/* ── 底部按钮 ───────────────────────────────────────────── */
.xx-clonemodal-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
padding-top: 4px;
}
/* ── 上传中状态 ─────────────────────────────────────────── */
.xx-clonemodal-uploading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 48px 20px;
text-align: center;
}
.xx-clonemodal-uploading-spinner {
width: 48px;
height: 48px;
border: 3px solid var(--xx-color-border, #e5e7eb);
border-top-color: var(--xx-color-primary, #6366f1);
border-radius: 50%;
animation: xx-clonemodal-spin 0.8s linear infinite;
margin-bottom: 20px;
}
@keyframes xx-clonemodal-spin {
to {
transform: rotate(360deg);
}
}
.xx-clonemodal-uploading-text {
font-size: 16px;
font-weight: 500;
color: var(--xx-color-text, #111827);
margin: 0 0 8px;
}
.xx-clonemodal-uploading-sub {
font-size: 13px;
color: var(--xx-color-text-secondary, #6b7280);
margin: 0;
}
/* ── 分隔线 ───────────────────────────────────────────── */
.xx-clonemodal-divider {
display: flex;
align-items: center;
gap: 12px;
margin: 4px 0;
}
.xx-clonemodal-divider-line {
flex: 1;
height: 1px;
background: var(--xx-color-border, #e5e7eb);
}
.xx-clonemodal-divider-text {
font-size: 13px;
color: var(--xx-color-text-secondary, #6b7280);
font-weight: 500;
}
/* ── 录制区域 ─────────────────────────────────────────── */
.xx-clonemodal-record-area {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
border: 1px solid var(--xx-color-border, #e5e7eb);
border-radius: var(--radius-xs);
background: var(--xx-color-bg-secondary, #f9fafb);
}
.xx-clonemodal-record-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 4px;
}
.xx-clonemodal-record-hint {
margin: 0;
font-size: 13px;
color: var(--xx-color-text-secondary, #6b7280);
}
/* 录制波形动画 */
.xx-clonemodal-record-wave {
display: flex;
align-items: flex-end;
gap: 3px;
height: 20px;
}
.xx-clonemodal-record-wave-bar {
width: 3px;
background: var(--xx-color-primary, #6366f1);
border-radius: 999px;
animation: xx-clonemodal-wave 0.8s ease-in-out infinite alternate;
}
.xx-clonemodal-record-wave-bar:nth-child(1) {
height: 40%;
animation-delay: 0s;
}
.xx-clonemodal-record-wave-bar:nth-child(2) {
height: 70%;
animation-delay: 0.15s;
}
.xx-clonemodal-record-wave-bar:nth-child(3) {
height: 100%;
animation-delay: 0.3s;
}
.xx-clonemodal-record-wave-bar:nth-child(4) {
height: 60%;
animation-delay: 0.45s;
}
.xx-clonemodal-record-wave-bar:nth-child(5) {
height: 30%;
animation-delay: 0.6s;
}
@keyframes xx-clonemodal-wave {
from {
transform: scaleY(0.4);
}
to {
transform: scaleY(1);
}
}
/* 录制按钮 */
.xx-clonemodal-record-btn {
width: 48px;
height: 48px;
border: none;
border-radius: 50%;
background: var(--xx-color-bg, #fff);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
font-size: 20px;
cursor: pointer;
transition:
background 0.2s ease,
transform 0.15s ease,
box-shadow 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.xx-clonemodal-record-btn:hover {
background: rgba(99, 102, 241, 0.06);
transform: scale(1.05);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.xx-clonemodal-record-btn--recording {
background: var(--xx-color-error, #ef4444);
color: #fff;
animation: xx-clonemodal-pulse 1.2s ease-in-out infinite;
}
.xx-clonemodal-record-btn--recording:hover {
background: #dc2626;
}
@keyframes xx-clonemodal-pulse {
0%,
100% {
box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
}
50% {
box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
}
}
/* ── 进度阶段(上传中 / 克隆中 / 完成) ─────────────── */
.xx-clonemodal-progress-body {
display: flex;
flex-direction: column;
align-items: center;
gap: 24px;
padding: 24px 0 16px;
}
/* 进度步骤指示器 */
.xx-clonemodal-steps-progress {
display: flex;
align-items: center;
gap: 0;
width: 100%;
max-width: 360px;
}
.xx-clonemodal-step-progress {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
flex: 1;
}
.xx-clonemodal-step-icon {
width: 40px;
height: 40px;
border-radius: 50%;
background: var(--xx-color-bg-tertiary, #f3f4f6);
border: 2px solid var(--xx-color-border, #e5e7eb);
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: var(--xx-color-text-secondary, #6b7280);
transition: all 0.3s ease;
}
.xx-clonemodal-step-progress--active .xx-clonemodal-step-icon {
background: rgba(99, 102, 241, 0.08);
border-color: var(--xx-color-primary, #6366f1);
color: var(--xx-color-primary, #6366f1);
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.xx-clonemodal-step-progress--done .xx-clonemodal-step-icon {
background: rgba(34, 197, 94, 0.08);
border-color: #22c55e;
color: #22c55e;
}
.xx-clonemodal-step-progress--active .xx-clonemodal-step-label {
color: var(--xx-color-primary, #6366f1);
font-weight: 600;
}
.xx-clonemodal-step-progress--done .xx-clonemodal-step-label {
color: #22c55e;
}
.xx-clonemodal-step-connector {
flex: 0 0 40px;
height: 2px;
background: var(--xx-color-border, #e5e7eb);
margin-bottom: 20px;
transition: background 0.3s ease;
}
.xx-clonemodal-step-connector--done {
background: #86efac;
}
/* 进度信息 */
.xx-clonemodal-progress-info {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
text-align: center;
}
.xx-clonemodal-progress-spinner {
width: 48px;
height: 48px;
border: 3px solid rgba(99, 102, 241, 0.15);
border-top-color: var(--xx-color-primary, #6366f1);
border-radius: 50%;
animation: xx-clonemodal-spin 0.8s linear infinite;
}
.xx-clonemodal-progress-spinner--cloning {
border-color: rgba(34, 197, 94, 0.15);
border-top-color: #22c55e;
}
.xx-clonemodal-progress-text {
margin: 0;
font-size: 16px;
font-weight: 600;
color: var(--xx-color-text, #111827);
}
.xx-clonemodal-progress-sub {
margin: 0;
font-size: 13px;
color: var(--xx-color-text-secondary, #6b7280);
}
/* ── 成功状态 ───────────────────────────────────────────── */
.xx-clonemodal-success {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
text-align: center;
}
.xx-clonemodal-success-icon {
font-size: 48px;
line-height: 1;
animation: xx-clonemodal-bounce 0.6s ease-out;
}
@keyframes xx-clonemodal-bounce {
0% {
transform: scale(0);
opacity: 0;
}
60% {
transform: scale(1.2);
opacity: 1;
}
100% {
transform: scale(1);
}
}
.xx-clonemodal-success-title {
margin: 0;
font-size: 18px;
font-weight: 700;
color: var(--xx-color-text, #111827);
}
.xx-clonemodal-success-desc {
margin: 0;
font-size: 13px;
color: var(--xx-color-text-secondary, #6b7280);
max-width: 280px;
line-height: 1.6;
}
/* ── 响应式 ─────────────────────────────────────────────── */
@media (max-width: 768px) {
.xx-clonemodal-steps {
padding: 0 8px;
}
.xx-clonemodal-step-connector {
width: 24px;
margin: 0 4px;
}
.xx-clonemodal-step-label {
font-size: 12px;
}
.xx-clonemodal-step-number {
width: 24px;
height: 24px;
font-size: 12px;
}
.xx-clonemodal-record-area {
flex-direction: column;
align-items: stretch;
text-align: center;
}
.xx-clonemodal-record-btn {
align-self: center;
}
.xx-clonemodal-steps-progress {
max-width: 280px;
}
.xx-clonemodal-footer {
flex-direction: column-reverse;
}
.xx-clonemodal-footer > * {
width: 100%;
}
}
@media (max-width: 480px) {
.xx-clonemodal-step-icon {
width: 32px;
height: 32px;
font-size: 13px;
}
.xx-clonemodal-step-connector {
flex: 0 0 16px;
margin-bottom: 16px;
}
.xx-clonemodal-progress-spinner {
width: 36px;
height: 36px;
}
.xx-clonemodal-success-icon {
font-size: 36px;
}
}