diff --git a/apps/web/src/pages/ai-avatar/components/PanelTitleConfig.tsx b/apps/web/src/pages/ai-avatar/components/PanelTitleConfig.tsx index 56c0d2601..5411d7efa 100644 --- a/apps/web/src/pages/ai-avatar/components/PanelTitleConfig.tsx +++ b/apps/web/src/pages/ai-avatar/components/PanelTitleConfig.tsx @@ -7,8 +7,11 @@ * - AiAvatarTitleConfig ↔ TitleSettings 的双向适配 * - 自动生成字幕开关 */ -import React, { useMemo, useState } from "react" +import React, { useMemo, useState, useEffect } from "react" +import { Input } from "antd" import TitleStylePanel from "@/pages/generate/components/title/TitleStylePanel" +import TitleLibraryAutoComplete from "@/pages/generate/components/title/TitleLibraryAutoComplete" +import type { TitleOption } from "@/pages/generate/components/title/TitleLibraryAutoComplete" import type { TitleSettings } from "@/pages/generate/types" import { POSITION_OPTIONS, @@ -17,7 +20,9 @@ import { getFontFamily, } from "@/pages/generate/constants" import type { AiAvatarTitleConfig } from "../types" -import TitleLibraryModal from "./TitleLibraryModal" +import { getTitles } from "@/api/titles" + +const { TextArea } = Input interface PanelTitleConfigProps { titleConfig: AiAvatarTitleConfig @@ -138,12 +143,7 @@ const PanelTitleConfig: React.FC = ({ titleConfig, onUpda - {/* 标题库选择弹窗 */} - setShowTitleLibrary(false)} - onSelect={(title) => onUpdate({ title })} - /> + ) } diff --git a/apps/web/src/pages/ai-avatar/components/PanelVideoSelector.tsx b/apps/web/src/pages/ai-avatar/components/PanelVideoSelector.tsx index f0568ef34..b09baf3f0 100644 --- a/apps/web/src/pages/ai-avatar/components/PanelVideoSelector.tsx +++ b/apps/web/src/pages/ai-avatar/components/PanelVideoSelector.tsx @@ -70,18 +70,24 @@ export function PanelVideoSelector({ position: "absolute", left: "50%", transform: "translateX(-50%)", - ...(titleConfig.position === "top" ? { top: "10%" } : titleConfig.position === "bottom" ? { bottom: "10%" } : { top: "50%", transform: "translate(-50%, -50%)" }), - fontSize: titleConfig.size, + ...(titleConfig.position === "top" + ? { top: "10%" } + : titleConfig.position === "bottom" + ? { bottom: "10%" } + : { top: "50%", transform: "translate(-50%, -50%)" }), + fontSize: Math.max(titleConfig.size, 32), fontFamily: getFontFamily(titleConfig.font), color: titleConfig.color, fontWeight: titleConfig.bold ? 700 : 400, fontStyle: titleConfig.italic ? "italic" : "normal", - textShadow: titleConfig.shadow ? "2px 2px 4px rgba(0,0,0,0.7)" : undefined, - WebkitTextStroke: titleConfig.stroke ? "1px rgba(0,0,0,0.5)" : undefined, + textShadow: "0 2px 4px rgba(0,0,0,0.5)", + WebkitTextStroke: "2px #000", pointerEvents: "none", zIndex: 10, maxWidth: "90%", textAlign: "center", + whiteSpace: "pre-wrap", + lineHeight: 1.3, }} > {titleConfig.title}