Skip to content

PRINTFILM: AI short-video marketing and AI short-drama creation platform

feat(ui): 精简顶栏和账户入口并移除旧工具中心

yi7c98cccdec3f
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 6f5e4d1..5265c9e 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -8,8 +8,6 @@ import AuthPage from './pages/AuthPage'
import HistoryPage from './pages/HistoryPage'
import HomePage from './pages/HomePage'
import MethodPage from './pages/MethodPage'
-import ToolsPage from './pages/ToolsPage'
-import ToolDetailPage from './pages/ToolDetailPage'
import GenerationPage from './pages/GenerationPage'
import GenerationTasksPage from './pages/GenerationTasksPage'
import HelpPage from './pages/HelpPage'
@@ -61,11 +59,9 @@ export default function App() {
<Route path="/method" element={<MethodPage />} />
<Route path="/auth" element={<AuthPage />} />
<Route path="/templates" element={<TemplatesPage />} />
- <Route path="/tools" element={<ToolsPage />} />
<Route path="/tools/video" element={<RequireAuth><GenerationPage kind="video" /></RequireAuth>} />
<Route path="/tools/image" element={<RequireAuth><GenerationPage kind="image" /></RequireAuth>} />
<Route path="/tools/audio" element={<RequireAuth><GenerationPage kind="audio" /></RequireAuth>} />
- <Route path="/tools/:toolId" element={<ToolDetailPage />} />
<Route path="/tasks" element={<RequireAuth><GenerationTasksPage /></RequireAuth>} />
<Route path="/assets" element={<AssetLibraryPage />} />
<Route path="/help" element={<HelpPage />} />
diff --git a/frontend/src/components/layout/AccountMenu.tsx b/frontend/src/components/layout/AccountMenu.tsx
new file mode 100644
index 0000000..d2a417d
--- /dev/null
+++ b/frontend/src/components/layout/AccountMenu.tsx
@@ -0,0 +1,78 @@
+import { useEffect, useRef } from 'react'
+import { Link } from 'react-router-dom'
+import { Images, ListTodo, LogOut, Settings2, Store, UserRound, Wallet } from 'lucide-react'
+import type { User } from '../../api'
+import { useI18n } from '../../i18n'
+import { PERSONAL_NAV } from '../../lib/siteNavigation'
+import UserAvatar from '../UserAvatar'
+
+type Props = {
+ user: User | null
+ open: boolean
+ marketplaceEnabled: boolean
+ onOpenChange: (open: boolean) => void
+ onNavigate: () => void
+ onLogout: () => void
+}
+
+/** 头像展开个人入口;支持键盘、点击外部关闭及焦点返回。 */
+export default function AccountMenu({ user, open, marketplaceEnabled, onOpenChange, onNavigate, onLogout }: Props) {
+ const { t } = useI18n()
+ /* wrapper 判断外部点击,button 负责关闭后的键盘焦点,panel 提供首个入口。 */
+ const wrapperRef = useRef<HTMLDivElement>(null)
+ const buttonRef = useRef<HTMLButtonElement>(null)
+ const panelRef = useRef<HTMLDivElement>(null)
+
+ useEffect(() => {
+ if (!open) return
+ const frame = window.requestAnimationFrame(() => panelRef.current?.querySelector<HTMLElement>('a[href]')?.focus())
+ /** 外部点击保持点击目标的默认焦点。 */
+ function closeOutside(event: PointerEvent) {
+ if (event.target instanceof Node && !wrapperRef.current?.contains(event.target)) onOpenChange(false)
+ }
+ /** Escape 收起个人菜单并返回头像。 */
+ function closeWithEscape(event: KeyboardEvent) {
+ if (event.key !== 'Escape') return
+ event.preventDefault()
+ event.stopPropagation()
+ onOpenChange(false)
+ buttonRef.current?.focus()
+ }
+ document.addEventListener('pointerdown', closeOutside)
+ document.addEventListener('keydown', closeWithEscape)
+ return () => {
+ window.cancelAnimationFrame(frame)
+ document.removeEventListener('pointerdown', closeOutside)
+ document.removeEventListener('keydown', closeWithEscape)
+ }
+ }, [open, onOpenChange])
+
+ if (!user) return <Link to="/auth?next=/" className="pf-topbar-account" title={t('nav.login')} aria-label={t('nav.login')}><UserRound size={18} aria-hidden /></Link>
+
+ return <div ref={wrapperRef} className="pf-topbar-account-wrap" onBlur={(event) => {
+ if (!event.currentTarget.contains(event.relatedTarget)) onOpenChange(false)
+ }}>
+ <button ref={buttonRef} type="button" className={`pf-topbar-account${open ? ' is-active' : ''}`} title={`${user.nickname} · ${t('nav.accountMenu')}`} aria-label={t('nav.accountMenu')} aria-expanded={open} aria-controls="pf-account-menu" onClick={() => onOpenChange(!open)} onKeyDown={(event) => {
+ if (event.key === 'ArrowDown') { event.preventDefault(); onOpenChange(true) }
+ }}><UserAvatar user={user} size="sm" /></button>
+ {open && <div ref={panelRef} id="pf-account-menu" className="pf-topbar-account-panel">
+ <div className="pf-topbar-account-heading"><strong>{user.nickname || t('common.creator')}</strong><span>{user.email}</span></div>
+ <nav aria-label={t('nav.accountMenu')}>
+ <div className="pf-topbar-account-group" role="group" aria-label={t('nav.myCreation')}>
+ <span>{t('nav.myCreation')}</span>
+ {PERSONAL_NAV.map((item) => {
+ const Icon = item.key === 'tasks' ? ListTodo : Images
+ return <Link key={item.key} to={item.path} onClick={onNavigate}><Icon size={17} aria-hidden /><span>{t(item.label)}</span></Link>
+ })}
+ {marketplaceEnabled && <Link to="/marketplace/mine" onClick={onNavigate}><Store size={17} aria-hidden /><span>{t('nav.myPublishing')}</span></Link>}
+ </div>
+ <div className="pf-topbar-account-group" role="group" aria-label={t('nav.accountManagement')}>
+ <span>{t('nav.accountManagement')}</span>
+ <Link to="/settings" onClick={onNavigate}><Settings2 size={17} aria-hidden /><span>{t('nav.profile')}</span></Link>
+ <Link to="/settings?tab=subscription" onClick={onNavigate}><Wallet size={17} aria-hidden /><span>{t('nav.balanceBilling')}</span></Link>
+ </div>
+ </nav>
+ <button type="button" className="pf-topbar-account-logout" onClick={onLogout}><LogOut size={17} aria-hidden /><span>{t('settings.logout')}</span></button>
+ </div>}
+ </div>
+}
diff --git a/frontend/src/components/layout/AppShell.tsx b/frontend/src/components/layout/AppShell.tsx
index cab0370..b25b7e1 100644
--- a/frontend/src/components/layout/AppShell.tsx
+++ b/frontend/src/components/layout/AppShell.tsx
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'
import { useI18n } from '../../i18n'
import { GITHUB_REPO_URL } from '../../lib/siteLinks'
import SiteNav, { type NavActive } from './SiteNav'
-import './sidebar.css'
+import './topbar.css'
type Props = {
children: ReactNode
@@ -18,7 +18,7 @@ export default function AppShell({ children, active, wide, flush, hideFooter }:
const { t } = useI18n()
return (
- <div className="pf-shell pf-shell--sidebar">
+ <div className="pf-shell pf-shell--topbar">
<a className="pf-skip-content" href="#pf-main-content">{t('nav.skipContent')}</a>
<SiteNav active={active} />
<main id="pf-main-content" tabIndex={-1} className={['pf-shell-main', wide ? 'wide' : '', flush ? 'flush' : ''].filter(Boolean).join(' ')}>
diff --git a/frontend/src/components/layout/SiteNav.tsx b/frontend/src/components/layout/SiteNav.tsx
index 63b2328..1b95c43 100644
--- a/frontend/src/components/layout/SiteNav.tsx
+++ b/frontend/src/components/layout/SiteNav.tsx
@@ -1,23 +1,20 @@
-import { Link, useLocation, useNavigate } from 'react-router-dom'
-import { useEffect, useRef, useState } from 'react'
+import { Link, useLocation, useNavigate } from 'react-router-dom'
+import { useCallback, useEffect, useRef, useState } from 'react'
import {
- ArrowUpRight, ChevronRight, CircleHelp, Clapperboard, CreditCard,
- Image, Images, LayoutDashboard, ListTodo, Menu, Plus, Settings2, Store, UserRound, UsersRound,
- Video, WandSparkles, Workflow, X,
+ ChevronRight, CircleHelp, Clapperboard, CreditCard,
+ Menu, Plus, Store,
+ Video, Workflow, X,
} from 'lucide-react'
import { api } from '../../api'
import type { User } from '../../api'
-import UserAvatar from '../UserAvatar'
import BrandMark from '../BrandMark'
-import { IconGithub } from '../ui/Icons'
import CreateChoiceModal from '../ui/CreateChoiceModal'
import { USER_UPDATED_EVENT } from '../../lib/userEvents'
import { loadSessionUser } from '../../lib/sessionUser'
-import { GITHUB_REPO_URL } from '../../lib/siteLinks'
-import { CREATION_NAV, RESOURCE_NAV, resolveNavActive, type NavActive } from '../../lib/siteNavigation'
+import { HOME_NAV, CREATION_NAV, RESOURCE_NAV, PERSONAL_NAV, resolveNavActive, type NavActive } from '../../lib/siteNavigation'
import { useI18n } from '../../i18n'
import LanguageSwitch from './LanguageSwitch'
-import WorkspaceSwitcher from '../../features/teams/WorkspaceSwitcher'
+import AccountMenu from './AccountMenu'
import { useTeamPreview } from '../../features/teams/useTeamPreview'
import { useMarketplace } from '../../features/marketplace/hooks'
@@ -27,36 +24,36 @@ type Props = { active?: NavActive }
type NavItem = (typeof CREATION_NAV)[number] | (typeof RESOURCE_NAV)[number]
const NAV_ICONS = {
- home: LayoutDashboard,
drama: Clapperboard,
canvas: Workflow,
kepu: Video,
- video: Video,
- image: Image,
- tools: WandSparkles,
- tasks: ListTodo,
- assets: Images,
- team: UsersRound,
pricing: CreditCard,
}
-/** 应用主侧栏及窄屏导航抽屉,共用路由与会话状态。 */
+/** 桌面与窄屏共用精简产品导航,个人入口由头像菜单承载。 */
export default function SiteNav({ active }: Props) {
const { capabilities: marketplace } = useMarketplace()
const nav = useNavigate()
const location = useLocation()
- const { t } = useI18n()
+ const { t, locale } = useI18n()
const { selectTeam } = useTeamPreview()
const [user, setUser] = useState<User | null>(null)
const [menuOpen, setMenuOpen] = useState(false)
+ const [accountOpen, setAccountOpen] = useState(false)
const [createOpen, setCreateOpen] = useState(false)
- const sidebarRef = useRef<HTMLElement>(null)
+ const menuRef = useRef<HTMLElement>(null)
const menuButtonRef = useRef<HTMLButtonElement>(null)
const closeButtonRef = useRef<HTMLButtonElement>(null)
const current = resolveNavActive(location.pathname, active)
const inMarketplace = location.pathname === '/marketplace' || location.pathname.startsWith('/marketplace/')
- const currentItem = [...CREATION_NAV, ...RESOURCE_NAV].find((item) => item.key === current)
- const currentLabel = inMarketplace ? '数字资产市场' : currentItem ? t(currentItem.label) : current === 'settings' ? t('nav.profile') : current === 'help' ? t('nav.help') : t('nav.workbench')
+ const currentItem = [HOME_NAV, ...CREATION_NAV, ...RESOURCE_NAV, ...PERSONAL_NAV].find((item) => item.key === current)
+ const currentLabel = inMarketplace ? (locale === 'en' ? 'Marketplace' : '数字资产市场') : currentItem ? t(currentItem.label) : current ? t(`nav.${current === 'settings' ? 'profile' : current}`) : t('nav.home')
+
+ /** 产品菜单与头像菜单互斥,回调保持稳定以免重复移动焦点。 */
+ const changeAccountOpen = useCallback((open: boolean) => {
+ setAccountOpen(open)
+ if (open) setMenuOpen(false)
+ }, [])
useEffect(() => {
let active = true
@@ -89,11 +86,12 @@ export default function SiteNav({ active }: Props) {
return () => { active = false; generation += 1; window.removeEventListener(USER_UPDATED_EVENT, onUserUpdated) }
}, [])
- useEffect(() => { setMenuOpen(false) }, [location.pathname, location.search])
+ useEffect(() => { setMenuOpen(false); setAccountOpen(false) }, [location.pathname, location.search])
useEffect(() => {
- const desktop = window.matchMedia('(min-width: 1001px)')
+ const desktop = window.matchMedia('(min-width: 1024px)')
function closeOnDesktop() { if (desktop.matches) setMenuOpen(false) }
+ closeOnDesktop()
desktop.addEventListener('change', closeOnDesktop)
return () => desktop.removeEventListener('change', closeOnDesktop)
}, [])
@@ -101,28 +99,28 @@ export default function SiteNav({ active }: Props) {
useEffect(() => {
if (!menuOpen) return
const previousOverflow = document.body.style.overflow
+ const menuButton = menuButtonRef.current
document.body.style.overflow = 'hidden'
- // 等抽屉解除 visibility:hidden 后再移动焦点。
const focusFrame = window.requestAnimationFrame(() => closeButtonRef.current?.focus())
function keepFocusInside(event: KeyboardEvent) {
- // 独立弹窗接管自己的键盘事件;普通下拉仍归属当前抽屉。
- const modal = document.querySelector<HTMLElement>('[role="dialog"][aria-modal="true"]:not(#pf-app-sidebar)')
- if (modal && !sidebarRef.current?.contains(modal)) return
+ // 独立弹窗优先接管键盘事件。
+ const modal = document.querySelector<HTMLElement>('[role="dialog"][aria-modal="true"]:not(#pf-topbar-menu)')
+ if (modal && !menuRef.current?.contains(modal)) return
if (event.key === 'Escape') {
event.preventDefault()
setMenuOpen(false)
return
}
- if (event.key !== 'Tab' || !sidebarRef.current) return
- const focusable = Array.from(sidebarRef.current.querySelectorAll<HTMLElement>(
+ if (event.key !== 'Tab' || !menuRef.current) return
+ const focusable = Array.from(menuRef.current.querySelectorAll<HTMLElement>(
'a[href], button:not(:disabled), summary, input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])',
)).filter((element) => element.getClientRects().length > 0 && !element.closest('[inert]'))
const first = focusable[0]
const last = focusable[focusable.length - 1]
if (!first || !last) { event.preventDefault(); return }
const focused = document.activeElement
- if (!sidebarRef.current.contains(focused) || (event.shiftKey && focused === first)) {
+ if (!menuRef.current.contains(focused) || (event.shiftKey && focused === first)) {
event.preventDefault()
;(event.shiftKey ? last : first).focus()
} else if (!event.shiftKey && focused === last) {
@@ -131,17 +129,20 @@ export default function SiteNav({ active }: Props) {
}
}
- document.addEventListener('keydown', keepFocusInside)
+ document.addEventListener('keydown', keepFocusInside, true)
return () => {
window.cancelAnimationFrame(focusFrame)
document.body.style.overflow = previousOverflow
- document.removeEventListener('keydown', keepFocusInside)
- menuButtonRef.current?.focus()
+ document.removeEventListener('keydown', keepFocusInside, true)
+ if (menuButton?.getClientRects().length) menuButton.focus()
}
}, [menuOpen])
+ /** 根据会话打开创作选择或登录页。 */
function goCreate() {
setMenuOpen(false)
+ setAccountOpen(false)
+ selectTeam(null)
if (!user && !localStorage.getItem('token')) {
nav('/auth?next=/')
return
@@ -149,65 +150,83 @@ export default function SiteNav({ active }: Props) {
setCreateOpen(true)
}
- function renderLink(item: NavItem) {
+ /** 个人入口始终使用个人空间,清理原有团队选择。 */
+ function goPersonal() {
+ selectTeam(null)
+ setAccountOpen(false)
+ }
+
+ /** 沿用账户页的退出流程,同步所有会话订阅者。 */
+ function logout() {
+ localStorage.removeItem('token')
+ setUser(null)
+ setAccountOpen(false)
+ selectTeam(null)
+ window.dispatchEvent(new Event(USER_UPDATED_EVENT))
+ nav('/')
+ }
+
+ /** 顶栏使用文字导航,展开菜单补充图标;所有入口沿用同一份路由配置。 */
+ function renderLink(item: NavItem, expanded = false) {
const Icon = NAV_ICONS[item.key]
const selected = current === item.key
return <Link
key={item.key}
to={item.path}
- className={`pf-sidebar-link${selected ? ' is-active' : ''}`}
+ className={`pf-topbar-link${expanded ? ' pf-topbar-menu-link' : ''}${selected ? ' is-active' : ''}`}
aria-current={selected ? 'page' : undefined}
onClick={() => {
- if (item.key !== 'team' && item.key !== 'home') selectTeam(null)
+ selectTeam(null)
setMenuOpen(false)
}}
>
- <Icon size={19} strokeWidth={1.8} aria-hidden />
+ {expanded && <Icon size={18} strokeWidth={1.8} aria-hidden />}
<span>{t(item.label)}</span>
- {selected && <ChevronRight size={15} className="pf-sidebar-link-arrow" aria-hidden />}
+ {expanded && selected && <ChevronRight size={15} className="pf-topbar-link-arrow" aria-hidden />}
+ </Link>
+ }
+
+ /** 市场入口遵从服务端能力开关,进入个人市场时清理团队请求范围。 */
+ function renderMarketplace(expanded = false) {
+ if (!marketplace?.enabled) return null
+ return <Link to="/marketplace" className={`pf-topbar-link${expanded ? ' pf-topbar-menu-link' : ''}${inMarketplace ? ' is-active' : ''}`} aria-current={inMarketplace ? 'page' : undefined} onClick={() => { selectTeam(null); setMenuOpen(false) }}>
+ {expanded && <Store size={18} strokeWidth={1.8} aria-hidden />}
+ <span>{locale === 'en' ? 'Marketplace' : '数字资产市场'}</span>
+ {expanded && inMarketplace && <ChevronRight size={15} className="pf-topbar-link-arrow" aria-hidden />}
</Link>
}
return <>
- <header className="pf-app-mobile-header">
- <button ref={menuButtonRef} type="button" className="pf-sidebar-icon-button" aria-label={t('nav.openMenu')} aria-controls="pf-app-sidebar" aria-expanded={menuOpen} onClick={() => setMenuOpen(true)}><Menu size={21} aria-hidden /></button>
- <BrandMark />
- <span className="pf-mobile-current">{currentLabel}</span>
- <button type="button" className="pf-mobile-create" aria-label={t('nav.startCreate')} onClick={goCreate}><Plus size={20} aria-hidden /></button>
- </header>
- {menuOpen && <button type="button" className="pf-sidebar-backdrop" aria-label={t('nav.closeMenu')} tabIndex={-1} onClick={() => setMenuOpen(false)} />}
- <aside ref={sidebarRef} id="pf-app-sidebar" className={`pf-app-sidebar${menuOpen ? ' is-open' : ''}`} role={menuOpen ? 'dialog' : undefined} aria-modal={menuOpen ? true : undefined} aria-label={t('nav.main')}
- onTransitionEnd={(event) => {
- if (menuOpen && event.target === event.currentTarget && event.propertyName === 'transform') closeButtonRef.current?.focus()
- }}>
- <div className="pf-sidebar-top">
- <div className="pf-sidebar-brand"><BrandMark /><button ref={closeButtonRef} type="button" className="pf-sidebar-icon-button pf-sidebar-close" aria-label={t('nav.closeMenu')} onClick={() => setMenuOpen(false)}><X size={19} aria-hidden /></button></div>
- <div className="pf-sidebar-workspace"><WorkspaceSwitcher /></div>
- <button type="button" className="pf-sidebar-create" onClick={goCreate}><Plus size={19} aria-hidden /><span>{t('nav.startCreate')}</span><ArrowUpRight size={17} aria-hidden /></button>
- </div>
- <nav className="pf-sidebar-navigation" aria-label={t('nav.main')}>
- <div className="pf-sidebar-group"><span className="pf-sidebar-group-label">{t('nav.creation')}</span>{CREATION_NAV.map(renderLink)}</div>
- <div className="pf-sidebar-group"><span className="pf-sidebar-group-label">{t('nav.resources')}</span>{RESOURCE_NAV.map(renderLink)}
- {marketplace?.enabled && <Link to="/marketplace" className={`pf-sidebar-link${inMarketplace ? ' is-active' : ''}`} aria-current={inMarketplace ? 'page' : undefined} onClick={() => { selectTeam(null); setMenuOpen(false) }}>
- <Store size={19} strokeWidth={1.8} aria-hidden />
- <span>数字资产市场</span>
- {inMarketplace && <ChevronRight size={15} className="pf-sidebar-link-arrow" aria-hidden />}
- </Link>}
- </div>
+ <header className={`pf-app-topbar${accountOpen ? ' pf-app-topbar--account-open' : ''}`} data-locale={locale}>
+ <div className="pf-topbar-brand" onClick={() => selectTeam(null)}><BrandMark /></div>
+ <nav className="pf-topbar-links" aria-label={t('nav.main')}>
+ {renderMarketplace()}
+ {CREATION_NAV.map((item) => renderLink(item))}
+ {RESOURCE_NAV.map((item) => renderLink(item))}
</nav>
- <div className="pf-sidebar-bottom">
- <div className="pf-sidebar-utilities">
- <Link to="/help" className={current === 'help' ? 'is-active' : undefined} aria-current={current === 'help' ? 'page' : undefined} onClick={() => setMenuOpen(false)}><CircleHelp size={17} aria-hidden /><span>{t('nav.help')}</span></Link>
- <a href={GITHUB_REPO_URL} target="_blank" rel="noopener noreferrer" title={t('nav.githubTitle')} onClick={() => setMenuOpen(false)}><IconGithub size={17} /><span>{t('nav.github')}</span></a>
- </div>
- <div className="pf-sidebar-language"><span>{t('nav.language')}</span><LanguageSwitch /></div>
- <Link to={user ? '/settings' : '/auth?next=/'} className={`pf-sidebar-account${current === 'settings' ? ' is-active' : ''}`} aria-current={current === 'settings' ? 'page' : undefined} onClick={() => setMenuOpen(false)}>
- {user ? <UserAvatar user={user} size="sm" /> : <span className="pf-sidebar-account-guest"><UserRound size={19} aria-hidden /></span>}
- <span><strong>{user?.nickname || t('nav.login')}</strong><small>{user ? t('nav.profile') : t('nav.loginHint')}</small></span>
- <Settings2 size={17} aria-hidden />
- </Link>
+ <div className="pf-topbar-actions">
+ <div className="pf-topbar-language"><LanguageSwitch /></div>
+ <Link to="/help" className={`pf-topbar-help${current === 'help' ? ' is-active' : ''}`} aria-label={t('nav.helpCenter')} aria-current={current === 'help' ? 'page' : undefined}><CircleHelp size={18} aria-hidden /><span>{t('nav.help')}</span></Link>
+ <AccountMenu user={user} open={accountOpen} marketplaceEnabled={Boolean(marketplace?.enabled)} onOpenChange={changeAccountOpen} onNavigate={goPersonal} onLogout={logout} />
+ <button type="button" className="pf-topbar-create" aria-label={t('nav.startCreate')} onClick={goCreate}><Plus size={17} aria-hidden /><span>{t('nav.startCreate')}</span></button>
+ <button ref={menuButtonRef} type="button" className="pf-topbar-menu-toggle" aria-label={t('nav.openMenu')} aria-controls="pf-topbar-menu" aria-expanded={menuOpen} onClick={() => { setAccountOpen(false); setMenuOpen(true) }}><Menu size={21} aria-hidden /></button>
</div>
- </aside>
+ </header>
+ {menuOpen && <>
+ <button type="button" className="pf-topbar-backdrop" aria-label={t('nav.closeMenu')} tabIndex={-1} onClick={() => setMenuOpen(false)} />
+ <section ref={menuRef} id="pf-topbar-menu" className="pf-topbar-menu" role="dialog" aria-modal="true" aria-label={t('nav.mobileNav')}>
+ <div className="pf-topbar-menu-heading"><div><span>{t('nav.main')}</span><strong>{currentLabel}</strong></div><button ref={closeButtonRef} type="button" className="pf-topbar-menu-close" aria-label={t('nav.closeMenu')} onClick={() => setMenuOpen(false)}><X size={20} aria-hidden /></button></div>
+ <nav aria-label={t('nav.main')}>
+ <div className="pf-topbar-menu-home">{renderMarketplace(true)}</div>
+ <div className="pf-topbar-menu-group"><span>{t('nav.creation')}</span><div>{CREATION_NAV.map((item) => renderLink(item, true))}</div></div>
+ <div className="pf-topbar-menu-group"><div>{RESOURCE_NAV.map((item) => renderLink(item, true))}</div></div>
+ </nav>
+ <div className="pf-topbar-menu-footer">
+ <LanguageSwitch />
+ <Link to="/help" onClick={() => setMenuOpen(false)}><CircleHelp size={17} aria-hidden /><span>{t('nav.help')}</span></Link>
+ </div>
+ </section>
+ </>}
<CreateChoiceModal open={createOpen} onClose={() => setCreateOpen(false)} />
</>
}
diff --git a/frontend/src/components/layout/sidebar.css b/frontend/src/components/layout/sidebar.css
index 49ed2d9..3482092 100644
--- a/frontend/src/components/layout/sidebar.css
+++ b/frontend/src/components/layout/sidebar.css
@@ -44,6 +44,7 @@
.pf-sidebar-create > svg:last-child { margin-left: auto; }
.pf-sidebar-create:hover { background: #aaf000; transform: translateY(-1px); }
.pf-sidebar-navigation { flex: 1; min-height: 0; padding: 8px 14px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #e0e5dc transparent; }
+.pf-sidebar-navigation > .pf-sidebar-link + .pf-sidebar-group { margin-top: 12px; }
.pf-sidebar-group + .pf-sidebar-group { margin-top: 21px; }
.pf-sidebar-group-label { display: block; padding: 9px 14px 10px; color: #90978f; font-size: 10px; font-weight: 550; letter-spacing: .1em; }
.pf-sidebar-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 3px 0; padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; color: #6e756e; font-size: 14px; transition: background .15s, color .15s, border-color .15s; }
diff --git a/frontend/src/components/layout/topbar.css b/frontend/src/components/layout/topbar.css
new file mode 100644
index 0000000..fb64921
--- /dev/null
+++ b/frontend/src/components/layout/topbar.css
@@ -0,0 +1,160 @@
+/* 全站顶栏:白色底、石墨文字、荧光绿当前位置;内容区恢复完整宽度。 */
+.pf-shell.pf-shell--topbar {
+ --pf-content-top: var(--pf-nav-h, 64px);
+ padding-inline-start: 0;
+}
+
+.pf-shell--topbar .pf-shell-main { min-width: 0; }
+.pf-shell--topbar .pf-shell-main:focus { outline: none; }
+.pf-shell--topbar .pf-shell-main:not(.flush) { padding: 34px clamp(24px, 3vw, 48px) 48px; }
+.pf-shell--topbar .pf-settings-side,
+.pf-shell--topbar .pf-history-side,
+.pf-shell--topbar .pf-team-sidebar { top: calc(var(--pf-content-top) + 24px); }
+.pf-shell--topbar .pf-create { min-height: calc(100dvh - var(--pf-content-top) - 5rem); }
+.pf-shell--topbar .pf-editor,
+.pf-shell--topbar .drama-workspace { min-height: calc(100dvh - var(--pf-content-top)); }
+.pf-shell--topbar .creation-workspace { min-height: calc(100dvh - var(--pf-content-top) - 40px); }
+.pf-shell--topbar .drama-workspace-top { top: var(--pf-content-top); }
+.pf-shell--topbar .drama-outline-sidebar { top: calc(var(--pf-content-top) + 76px); max-height: calc(100dvh - var(--pf-content-top) - 88px); }
+.pf-shell--topbar .drama-episodes-page > .drama-episode-dir { top: calc(var(--pf-content-top) + 64px); max-height: calc(100dvh - var(--pf-content-top) - 72px); }
+.pf-shell--topbar .sv-settings { top: calc(var(--pf-content-top) + 20px); }
+
+.pf-app-topbar {
+ position: sticky;
+ top: 0;
+ z-index: 45;
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) auto;
+ align-items: center;
+ gap: clamp(16px, 1.8vw, 36px);
+ height: var(--pf-nav-h, 64px);
+ flex: none;
+ padding: 0 clamp(20px, 1.8vw, 36px);
+ border-bottom: 1px solid #e8e9ec;
+ background: #fff;
+ color: var(--pf-ink);
+}
+
+.pf-topbar-brand { justify-self: start; }
+.pf-app-topbar--account-open { z-index: 95; }
+.pf-topbar-brand .brand-mark { gap: 10px; }
+.pf-topbar-brand .brand-logo { width: 32px; height: 32px; }
+.pf-topbar-brand .brand-word { font-size: 19px; letter-spacing: .09em; }
+.pf-topbar-links { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 1.15vw, 24px); min-width: 0; height: 100%; white-space: nowrap; }
+.pf-topbar-link { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 100%; flex: none; padding: 2px 0 0; color: #7e8490; font-size: 14px; font-weight: 550; text-decoration: none; transition: color .15s; }
+.pf-topbar-link:hover { color: #20242b; }
+.pf-topbar-link.is-active { color: #14171c; font-weight: 700; }
+.pf-topbar-link.is-active::after { position: absolute; right: 0; bottom: 15px; left: 0; height: 3px; border-radius: 2px; background: var(--pf-lime); content: ''; }
+.pf-topbar-link-arrow { flex: none; color: #9198a0; }
+.pf-topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
+.pf-topbar-language { display: flex; }
+.pf-app-topbar .pf-nav-lang { height: 31px; background: #fff; border-color: #e6e8eb; }
+.pf-app-topbar .pf-nav-lang button { font-size: 11px; padding-inline: 9px; }
+.pf-topbar-help { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; flex: none; color: #828895; font-size: 13px; font-weight: 550; white-space: nowrap; }
+.pf-topbar-help:hover, .pf-topbar-help.is-active { color: #252b34; }
+.pf-topbar-account { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border: 1px solid #e8e9ec; border-radius: 50%; background: #f5f6f8; color: #717987; }
+.pf-topbar-account .pf-user-avatar { width: 100%; height: 100%; }
+.pf-topbar-account:hover, .pf-topbar-account.is-active { border-color: #a9d256; box-shadow: 0 0 0 3px #b6ff001f; }
+.pf-topbar-account { padding: 0; cursor: pointer; }
+.pf-topbar-account-wrap { position: relative; flex: none; }
+.pf-topbar-account-panel { position: absolute; top: calc(100% + 15px); right: 0; width: 264px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 80px); overflow-y: auto; padding: 10px; border: 1px solid #e7eae2; border-radius: 14px; background: #fff; box-shadow: 0 16px 50px #18201b20; }
+.pf-topbar-account-heading { display: grid; gap: 5px; padding: 10px 10px 13px; border-bottom: 1px solid #edf0e8; }
+.pf-topbar-account-heading strong { overflow: hidden; color: #242b20; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
+.pf-topbar-account-heading > span { overflow: hidden; color: #92998a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
+.pf-topbar-account-group { padding-block: 8px; }
+.pf-topbar-account-group + .pf-topbar-account-group { border-top: 1px solid #edf0e8; }
+.pf-topbar-account-group > span { display: block; padding: 4px 10px 7px; color: #949c89; font-size: 10px; }
+.pf-topbar-account-group a, .pf-topbar-account-logout { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 39px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #515b49; font-size: 13px; text-align: start; }
+.pf-topbar-account-group a:hover { background: #f2f7e9; color: #304b0f; }
+.pf-topbar-account-group svg, .pf-topbar-account-logout svg { flex: none; }
+.pf-topbar-account-logout { margin-top: 4px; border-top: 1px solid #edf0e8; border-radius: 0 0 8px 8px; color: #9a5e56; cursor: pointer; }
+.pf-topbar-account-logout:hover { background: #fdf4f1; }
+.pf-topbar-create { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 36px; flex: none; padding: 0 16px; border: 1px solid var(--pf-lime); border-radius: 999px; background: var(--pf-lime); color: #172100; font-size: 13px; font-weight: 650; white-space: nowrap; transition: background .15s; }
+.pf-topbar-create:hover { border-color: #a6eb00; background: #a6eb00; }
+.pf-topbar-menu-toggle, .pf-topbar-menu-close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; padding: 0; border: 1px solid #e7e9ed; border-radius: 9px; background: #fff; color: #515b68; }
+.pf-topbar-menu-toggle { display: none; }
+.pf-topbar-menu-toggle:hover, .pf-topbar-menu-close:hover { background: #f5f7f2; }
+.pf-app-topbar :focus-visible, .pf-topbar-menu :focus-visible { outline: 2px solid #719b2e; outline-offset: 3px; }
+.pf-skip-content { position: fixed; top: -60px; left: 20px; z-index: 120; padding: 10px 16px; border-radius: 8px; background: #18201b; color: #fff; }
+.pf-skip-content:focus { top: 12px; }
+
+.pf-topbar-backdrop { position: fixed; inset: 0; z-index: 100; width: 100%; height: 100%; border: 0; background: #1d273846; backdrop-filter: blur(3px); }
+.pf-topbar-menu { position: fixed; top: 12px; right: 12px; z-index: 110; width: 410px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 22px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #e5e8e1; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px #18201b24; }
+.pf-topbar-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
+.pf-topbar-menu-heading > div { display: grid; gap: 5px; }
+.pf-topbar-menu-heading > div > span { color: #929a87; font-size: 10px; }
+.pf-topbar-menu-heading strong { color: #1d2520; font-size: 17px; font-weight: 650; }
+.pf-topbar-menu-group { margin-top: 17px; }
+.pf-topbar-menu-group > span { display: block; margin-bottom: 6px; color: #98a08f; font-size: 10px; letter-spacing: .05em; }
+.pf-topbar-menu-group > div, .pf-topbar-menu-home { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
+.pf-topbar-menu .pf-topbar-menu-link { height: auto; min-height: 43px; min-width: 0; padding: 10px; border: 1px solid transparent; border-radius: 8px; gap: 9px; font-size: 13px; }
+.pf-topbar-menu-link > svg { flex: none; }
+.pf-topbar-menu-link > span { min-width: 0; }
+.pf-topbar-menu-link > .pf-topbar-link-arrow { margin-left: auto; }
+.pf-topbar-menu-link:hover { background: #f5f7f1; }
+.pf-topbar-menu-link.is-active { border-color: #e1edce; background: #f0f8e3; color: #405926; }
+.pf-topbar-menu-link.is-active::after { display: none; }
+.pf-topbar-menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 17px; border-top: 1px solid #edf0e8; }
+.pf-topbar-menu-footer > a { display: inline-flex; align-items: center; gap: 6px; color: #7f8875; font-size: 12px; }
+.pf-project-list-intro { margin: 8px 0 0; color: #8b9288; font-size: 13px; line-height: 1.7; }
+.pf-dialog-root .pf-create-choice { grid-template-columns: repeat(3, minmax(0, 1fr)); }
+.pf-dialog-root .pf-create-choice-card { min-width: 0; padding: 16px 13px; }
+.pf-dialog-root .pf-create-choice-card .pf-muted { font-size: 11px; line-height: 1.7; }
+
+@media (max-width: 1859px) {
+ .pf-app-topbar { gap: 18px; padding-inline: 24px; }
+ .pf-topbar-brand .brand-word { font-size: 16px; letter-spacing: .065em; }
+ .pf-topbar-brand .brand-logo { width: 30px; height: 30px; }
+ .pf-topbar-links { gap: 14px; }
+ .pf-topbar-link { font-size: 13px; }
+ .pf-topbar-actions { gap: 8px; }
+ .pf-topbar-help { width: 32px; padding: 0; }
+ .pf-topbar-help > span { display: none; }
+ .pf-topbar-create { padding-inline: 12px; }
+}
+
+@media (max-width: 1023px) {
+ .pf-app-topbar { grid-template-columns: auto minmax(0, 1fr); }
+ .pf-topbar-links { display: none; }
+ .pf-topbar-menu-toggle { display: inline-flex; }
+ .pf-shell--topbar .pf-shell-main:not(.flush) { padding: 28px 24px 40px; }
+}
+
+@media (max-width: 767px) {
+ .pf-app-topbar { gap: 12px; padding-inline: 16px; }
+ .pf-topbar-brand .brand-word { font-size: 15px; }
+ .pf-topbar-brand .brand-logo { width: 29px; height: 29px; }
+ .pf-topbar-language, .pf-topbar-help { display: none; }
+ .pf-topbar-actions { gap: 9px; }
+ .pf-topbar-account-panel { position: fixed; top: calc(var(--pf-nav-h, 64px) + 8px); right: 12px; }
+ .pf-shell--topbar .pf-shell-main:not(.flush) { padding: 24px 18px 36px; }
+ .pf-shell--topbar .pf-settings { grid-template-columns: minmax(0, 1fr); }
+ .pf-shell--topbar .pf-settings-side { position: static; }
+ .pf-shell--topbar .pf-land-hero,
+ .pf-shell--topbar .pf-land-products,
+ .pf-shell--topbar .pf-land-pipeline-list,
+ .pf-shell--topbar .pf-land-who-grid,
+ .pf-shell--topbar .pf-land-cap-grid,
+ .pf-shell--topbar .pf-template-grid { grid-template-columns: minmax(0, 1fr); max-width: none; }
+ .pf-shell--topbar .pf-land-hero { gap: 28px; padding-top: 20px; }
+ .pf-shell--topbar .pf-land-frames { width: 100%; max-width: 300px; margin-inline: auto; }
+}
+
+@media (max-width: 400px) {
+ .pf-app-topbar { padding-inline: 12px; }
+ .pf-topbar-brand .brand-mark { gap: 8px; }
+ .pf-topbar-brand .brand-word { font-size: 14px; }
+ .pf-topbar-actions { gap: 7px; }
+ .pf-topbar-create { width: 34px; height: 34px; padding: 0; }
+ .pf-topbar-create > span { display: none; }
+ .pf-topbar-menu { padding: 18px; }
+ .pf-topbar-menu .pf-topbar-menu-link { gap: 7px; padding: 9px 7px; font-size: 12px; }
+}
+
+@media (max-width: 560px) {
+ .pf-dialog-root .pf-create-choice { grid-template-columns: minmax(0, 1fr); }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .pf-topbar-link, .pf-topbar-create { transition: none; }
+}
diff --git a/frontend/src/components/tools/GenerationLayout.tsx b/frontend/src/components/tools/GenerationLayout.tsx
index d19580f..76b12dc 100644
--- a/frontend/src/components/tools/GenerationLayout.tsx
+++ b/frontend/src/components/tools/GenerationLayout.tsx
@@ -6,7 +6,7 @@ import '../../styles/generation-controls.css'
/** 生成工作台与任务页共用布局,主侧栏按当前媒体类型高亮。 */
export default function GenerationLayout({ children, tasks = false, kind }: { children: ReactNode; tasks?: boolean; kind?: MediaKind }) {
- return <AppShell active={tasks ? 'tasks' : kind === 'video' || kind === 'image' ? kind : 'tools'} wide hideFooter>
+ return <AppShell active={tasks ? 'tasks' : kind} wide hideFooter>
<div className="gen-layout">
<div className="gen-main">{children}</div>
</div>
diff --git a/frontend/src/components/ui/CreateChoiceModal.tsx b/frontend/src/components/ui/CreateChoiceModal.tsx
index 020f6ee..f390b31 100644
--- a/frontend/src/components/ui/CreateChoiceModal.tsx
+++ b/frontend/src/components/ui/CreateChoiceModal.tsx
@@ -1,7 +1,8 @@
-import { Link, useNavigate } from 'react-router-dom'
+import { useNavigate } from 'react-router-dom'
import { Clapperboard, PanelsTopLeft, Video } from 'lucide-react'
import { useI18n } from '../../i18n'
import { SHORT_VIDEO_CREATE_PATH } from '../../lib/shortVideoRoutes'
+import { FILM_SKILLS_URL } from '../../lib/siteLinks'
import Modal from './Modal'
type Props = {
@@ -12,7 +13,7 @@ type Props = {
/** 开始创作:选择漫剧、自由画布或短视频。 */
export default function CreateChoiceModal({ open, onClose }: Props) {
const nav = useNavigate()
- const { t } = useI18n()
+ const { t, m } = useI18n()
// 跳转到目标产品并关闭弹层
function go(path: string) {
@@ -48,10 +49,10 @@ export default function CreateChoiceModal({ open, onClose }: Props) {
</div>
<p className="pf-create-choice-foot">
{t('create.toolsFootPrefix')}{' '}
- <Link to="/tools" onClick={onClose}>
+ <a href={FILM_SKILLS_URL} target="_blank" rel="noopener noreferrer" onClick={onClose}>
{t('create.toolsFootLink')}
- </Link>
- {t('create.toolsFootSuffix') ? ` ${t('create.toolsFootSuffix')}` : ''}
+ </a>
+ {m.create.toolsFootSuffix ? ` ${m.create.toolsFootSuffix}` : ''}
</p>
</Modal>
)
diff --git a/frontend/src/components/ui/HelpCenter.tsx b/frontend/src/components/ui/HelpCenter.tsx
index 4f9d3e3..2af7370 100644
--- a/frontend/src/components/ui/HelpCenter.tsx
+++ b/frontend/src/components/ui/HelpCenter.tsx
@@ -110,10 +110,10 @@ export default function HelpCenter({ open, onClose }: Props) {
<div className="pf-help-tools-note">
<p>{t('help.toolsNote')}</p>
<div className="pf-help-tools-actions">
- <Link to="/tools" className="pf-btn pf-btn-lime pf-btn-sm" onClick={onClose}>
+ <Link to="/tools/image" className="pf-btn pf-btn-lime pf-btn-sm" onClick={onClose}>
{t('help.openTools')}
</Link>
- <Link to="/settings?tab=tools" className="pf-btn pf-btn-ghost pf-btn-sm" onClick={onClose}>
+ <Link to="/tasks" className="pf-btn pf-btn-ghost pf-btn-sm" onClick={onClose}>
{t('help.toolRecords')}
</Link>
</div>
diff --git a/frontend/src/i18n/locales/en/pages.ts b/frontend/src/i18n/locales/en/pages.ts
index 9f9f5a0..d2f85ff 100644
--- a/frontend/src/i18n/locales/en/pages.ts
+++ b/frontend/src/i18n/locales/en/pages.ts
@@ -4,13 +4,12 @@ export const enPages = {
home: {
headlineBefore: 'Turn stories into',
headlineEm: 'films you can play',
- lede: 'AI drama from script to episodic film. For short videos, start with an idea, refine the copy and storyboard, create images and narration, then compose your film.',
+ lede: 'Self-hosted Drama takes scripts to episodic films. For short videos, start with an idea, refine the copy and storyboard, create images and narration, then compose your film.',
startCreate: 'Start creating',
- browseTools: 'Browse tools',
githubCta: 'Open source · View on GitHub',
products: 'Products',
- dramaTitle: 'AI Drama',
- dramaFor: 'For short-drama makers',
+ dramaTitle: 'Self-hosted Drama',
+ dramaFor: 'Built for large-scale self-hosted compute, with one-click short-drama production',
dramaDesc: 'Generate a script from one line, lock characters and scenes, then board each episode.',
kepuTitle: 'AI Short Video',
kepuTag: 'Step-by-step creation',
@@ -22,17 +21,14 @@ export const enPages = {
howKicker: 'How it works',
howTitle: 'A clear path from idea to film',
capsKicker: 'Capabilities',
- capsTitle: 'What the studio actually does',
- toolsKicker: 'Tools',
- toolsTitle: 'One-shot creation tools',
- allTools: 'All tools →',
+ capsTitle: 'Create from story to finished film',
whoKicker: 'For',
whoTitle: 'Who it’s for',
closeTitle: 'Start from one idea',
- closeLead: 'Sign in, pick Drama or AI Short Video, and enter the matching workspace.',
+ closeLead: 'Sign in, pick Self-hosted Drama or AI Short Video, and enter the matching workspace.',
viewPricing: 'View pricing',
methodLink: 'Lead-gen method',
- footBrand: 'AI drama and AI short video studio',
+ footBrand: 'Self-hosted Drama and AI Short Video studio',
footNav: 'Footer',
dramaSteps: ['AI script', 'Cast & scenes', 'Episode boards', 'Export'],
kepuSteps: ['Share an idea', 'Copy & storyboard', 'Images & voice', 'Compose your film'],
@@ -62,7 +58,7 @@ export const enPages = {
guideTitle: 'Four steps to start',
faqTitle: 'FAQ',
noMatch: 'No matching questions. Try “download”, “tools”, or “top-up”.',
- morePrefix: 'See projects and runs in',
+ morePrefix: 'Manage profile and security in',
profile: 'your account',
moreMid: ', or',
pricing: 'add credits',
@@ -78,17 +74,17 @@ export const enPages = {
noFaq: 'No matching questions',
cats: [
{ id: 'start', title: 'Quick start', desc: 'Pick a product on Home', href: '/' },
- { id: 'drama', title: 'Drama', desc: 'Script · episodes · film', href: '/drama' },
+ { id: 'drama', title: 'Self-hosted Drama', desc: 'Script · episodes · film', href: '/drama' },
{ id: 'kepu', title: 'AI Short Video', desc: 'Storyboard pipeline', href: '/history' },
- { id: 'tools', title: 'Tools', desc: 'Text-to-image / video', href: '/tools' },
- { id: 'settings', title: 'Account', desc: 'Projects · runs · downloads', href: '/settings?tab=tools' },
+ { id: 'tools', title: 'Tools', desc: 'Text-to-image / video', href: '/tools/image' },
+ { id: 'tasks', title: 'My tasks', desc: 'Progress · results · downloads', href: '/tasks' },
{ id: 'billing', title: 'Billing', desc: 'Pay as you go, no expiry', href: '/pricing' },
],
steps: [
{
n: '01',
title: 'Choose an entry',
- body: 'Open AI Drama or AI Short Video from Home. For a single image or clip, use Tools in the top nav.',
+ body: 'Open Self-hosted Drama or AI Short Video from Home. Open My tasks from your avatar to track generation progress and results.',
},
{
n: '02',
@@ -103,13 +99,13 @@ export const enPages = {
{
n: '04',
title: 'Save and download',
- body: 'Outputs land in cloud storage. AI Short Video downloads from History; drama from the project workspace; tool runs from Account.',
+ body: 'Outputs land in cloud storage. AI Short Video downloads from History; drama from the project workspace. All generation results are also available in your avatar menu → My tasks.',
},
],
faq: [
{
q: 'Where should I start?',
- a: 'Open Home and pick AI Drama or AI Short Video. Drama is for episodic stories and character consistency; AI Short Video is positioned for lead-gen storyboards. For a single image or clip, go to Tools.',
+ a: 'Open Home and pick Self-hosted Drama or AI Short Video. Drama is for episodic stories and character consistency; AI Short Video is positioned for lead-gen storyboards. Open your avatar menu → My tasks to check generation progress and results.',
},
{
q: 'What’s the difference between AI video and stills-to-film?',
@@ -117,7 +113,7 @@ export const enPages = {
},
{
q: 'Can I leave the page while it generates?',
- a: 'Yes. Jobs keep running on the server. Check AI Short Video History, the drama project workspace, or Account for tool-run status. For in-page video tools, staying until it finishes is safer.',
+ a: 'Yes. Jobs keep running on the server. Open your avatar menu → My tasks for generation status, or return to AI Short Video History or the drama project workspace.',
},
{
q: 'What can the tool hub do?',
@@ -125,23 +121,23 @@ export const enPages = {
},
{
q: 'Where are tool results stored?',
- a: 'Each successful run is saved, and media syncs to object storage. Open your avatar → Account → Tool runs to see covers, status, and prompts.',
+ a: 'Generation jobs are registered in My tasks, and media syncs to object storage. Open your avatar → My tasks to see covers, status, and prompts.',
},
{
q: 'How do I view or download tool results?',
- a: 'In Account → Tool runs, use View to preview and Download to save from the cloud URL. The tool page also links back to Account after a success.',
+ a: 'In your avatar menu → My tasks, use View to preview an image or video and Download to save the result.',
},
{
q: 'Where do I download finished films or assets?',
- a: 'AI Short Video: History in the top nav. Drama: the project workspace. Global assets: Assets in the top nav.',
+ a: 'AI Short Video: History in the top nav. Drama: the project workspace. Global assets: My assets in your avatar menu.',
},
{
q: 'What’s in Account?',
- a: 'Profile, drama projects, AI Short Video history, tool runs, asset library entry, and plan & balance. Team workspace and account security are available; notification preferences are still in progress.',
+ a: 'Account contains your profile, team and collaboration settings, notification preferences, and security. Open My tasks, My assets, or Balance & billing from your avatar menu for generation records, assets, or usage. Notification preferences are still in progress.',
},
{
q: 'How do top-ups and charges work?',
- a: 'Open Pricing, pick a pack, and pay with Alipay or WeChat. Usage is metered; balance never expires and there is no forced subscription.',
+ a: 'Open Pricing, pick a pack, and pay with Alipay or WeChat. Usage is metered; balance never expires and there is no forced subscription. Open your avatar menu → Balance & billing to review usage.',
},
{
q: 'Generation failed or the image is off?',
@@ -154,9 +150,9 @@ export const enPages = {
{ id: 'tools', title: 'Tools', desc: 'Images and short video' },
],
toolsNote:
- 'The tool hub includes text-to-image, image-to-image, product shots, text-to-video, video-to-video, and e-commerce collages. Results are stored in the cloud and can be viewed or downloaded under Account → Tool runs.',
+ 'Independent generation supports text-to-image, image-to-image, product shots, text-to-video, video-to-video, and e-commerce collages. Results are stored in the cloud and can be viewed or downloaded from your avatar menu → My tasks.',
openTools: 'Open tools',
- toolRecords: 'Run history',
+ toolRecords: 'My tasks',
},
contact: {
crumb: 'Contact',
@@ -216,132 +212,6 @@ export const enPages = {
'Other',
],
},
- tools: {
- title: 'AI creation tools',
- lead: 'Open a tool workspace to generate images and short video.',
- goDrama: 'Go to Drama',
- goDramaHint: 'Script · episodes · film',
- goKepu: 'AI Short Video',
- goKepuHint: 'Storyboard pipeline',
- generating: 'Generating…',
- generatingVideo: 'Generating video…',
- generatingShort: 'Generating',
- generatingVideoShort: 'Generating video',
- savedPrefix: 'Saved. View it in',
- savedLink: 'Account · Tool runs',
- savedSuffix: '',
- allTools: 'All tools',
- uploadHint: 'Click or drag to upload',
- filesSelected: '{count} file(s) selected',
- inputPlaceholder: 'Enter {label}…',
- resultArea: 'Results',
- resultEmpty: 'Preview area',
- resultEmptyHint: 'Output will appear here when ready',
- videoWaitHint: 'Usually 1–3 minutes — you can stay on this page',
- imageWaitHint: 'Images usually take about 20–40 seconds',
- previewAlt: 'Still preview',
- resultAlt: 'Generated output',
- downloadVideo: 'Download video',
- downloadImage: 'Download image',
- errors: {
- fillPrompt: 'Please enter a prompt',
- uploadRef: 'Please upload a reference image',
- fillScript: 'Please enter a video script',
- uploadSource: 'Please upload a source video or first frame',
- uploadProduct: 'Please upload a product image',
- uploadTwoImages: 'Upload at least 2 images for a collage',
- videoFailed: 'Video generation failed',
- pollFailed: 'Could not refresh task status',
- generateFailed: 'Generation failed',
- notLoggedIn: 'Not signed in',
- },
- items: {
- audio: {
- title: 'Audio generation', desc: 'Give your words a voice',
- panelHint: 'Enter text and choose a voice.', cta: 'Generate speech',
- fields: { prompt: { label: 'Text to read', placeholder: 'Enter the text you want to read…' } },
- },
- t2i: {
- title: 'Text to image',
- desc: 'Describe a scene and generate a still',
- panelHint: 'Describe the frame, pick an aspect ratio, then generate.',
- cta: 'Generate',
- fields: {
- prompt: { label: 'Prompt', placeholder: 'Subject, scene, light, and style…' },
- negative: { label: 'Negative prompt', placeholder: 'What to avoid, e.g. text, watermark…' },
- ratio: { label: 'Aspect ratio' },
- },
- },
- i2i: {
- title: 'Image to image',
- desc: 'Upload a reference and generate a matching variant',
- panelHint: 'Upload a reference and describe what to keep or change.',
- cta: 'Generate',
- fields: {
- ref: { label: 'Reference' },
- prompt: { label: 'Prompt', placeholder: 'Keep the subject, night cinematic lighting…' },
- strength: { label: 'Similarity' },
- },
- },
- i2p: {
- title: 'Product shots',
- desc: 'White-background and lifestyle product images',
- panelHint: 'Upload a product photo, then pick white, scene, or long-detail.',
- cta: 'Generate product shot',
- fields: {
- product: { label: 'Product image' },
- mode: { label: 'Output' },
- prompt: { label: 'Extra notes (optional)', placeholder: 'Material, placement, setting…' },
- },
- },
- t2v: {
- title: 'Text to video',
- desc: 'Turn a script into a short clip',
- panelHint: 'Write a script, generate a still first, then a short video (about 1–3 min).',
- cta: 'Generate video',
- fields: {
- script: { label: 'Script', placeholder: 'Camera move, action, and mood…' },
- duration: { label: 'Duration' },
- ratio: { label: 'Aspect ratio' },
- },
- },
- v2v: {
- title: 'Video to video',
- desc: 'Restyle motion and look of an existing clip',
- panelHint: 'Upload a source video or first frame, then describe style and motion.',
- cta: 'Transform',
- fields: {
- source: { label: 'Source / first frame' },
- prompt: { label: 'Transform', placeholder: 'Cyberpunk night, slow push-in…' },
- motion: { label: 'Motion' },
- },
- },
- ecom: {
- title: 'E-commerce tools',
- desc: 'Hero collages, detail layouts, and selling posters',
- panelHint: 'Collage needs at least 2 images. Selling posters need 1 product photo.',
- cta: 'Start',
- fields: {
- pack: { label: 'Tool' },
- images: { label: 'Images' },
- prompt: { label: 'Selling points (poster, optional)', placeholder: 'Material and use case…' },
- },
- },
- },
- chips: {
- 低: 'Low',
- 中: 'Medium',
- 高: 'High',
- 弱: 'Subtle',
- 强: 'Strong',
- 白底图: 'White bg',
- 场景图: 'Lifestyle',
- 详情长图: 'Long detail',
- 主图拼接: 'Hero collage',
- 详情排版: 'Detail layout',
- 卖点海报: 'Selling poster',
- },
- },
pricing: {
title: 'Pay as you go',
lead: 'Metered by actual token use. Credits never expire.',
@@ -410,7 +280,7 @@ export const enPages = {
selectProject: 'Select {title} for download',
progress: 'Production progress',
newKepu: 'New short',
- goDrama: 'Go to Drama',
+ goDrama: 'Open Self-hosted Drama',
statTotal: 'Projects',
statRunning: 'In progress',
runningNow: 'Generating now',
@@ -447,8 +317,8 @@ export const enPages = {
pagination: 'AI Short Video pages',
},
dramaList: {
- title: 'My drama projects',
- description: 'Manage your series from the first story idea to the storyboard.',
+ title: 'Self-hosted Drama',
+ description: 'Built for large-scale self-hosted compute, from story ideas to multi-episode dramas.',
emptyTitle: 'No drama projects yet',
emptyDescription: 'Write a story idea to create your first drama.',
assets: 'Asset library',
diff --git a/frontend/src/i18n/locales/en/shell.ts b/frontend/src/i18n/locales/en/shell.ts
index 68b4b5c..c270a13 100644
--- a/frontend/src/i18n/locales/en/shell.ts
+++ b/frontend/src/i18n/locales/en/shell.ts
@@ -4,7 +4,7 @@ export const enShell = {
meta: {
title: 'PRINTFILM · AI short video',
description:
- 'PRINTFILM: turn scripts into episodic AI dramas, or offers into AI short videos.',
+ 'PRINTFILM: create episodic films with Self-hosted Drama, or turn offers into AI short videos.',
},
common: {
comingSoon: 'Coming soon',
@@ -46,8 +46,8 @@ export const enShell = {
cancel: 'Cancel',
},
nav: {
- workbench: 'Home',
- drama: 'Drama',
+ home: 'Home',
+ drama: 'Self-hosted Drama',
canvas: 'Free canvas',
creation: 'CREATE',
resources: 'LIBRARY & TEAM',
@@ -57,8 +57,15 @@ export const enShell = {
kepu: 'AI Short Video',
video: 'Video',
image: 'Image',
- tools: 'Tools',
+ skills: 'Drama Skills',
+ audio: 'Audio',
tasks: 'My tasks',
+ accountMenu: 'Account menu',
+ myCreation: 'My creations',
+ myAssets: 'My assets',
+ myPublishing: 'My publishing',
+ accountManagement: 'Account',
+ balanceBilling: 'Balance & billing',
assets: 'Assets',
pricing: 'Pricing',
help: 'Help',
@@ -99,7 +106,7 @@ export const enShell = {
registerTitle: 'Create a creator account',
forgotTitle: 'Reset your password',
resetTitle: 'Choose a new password',
- lede: 'PRINTFILM · AI drama and AI short video',
+ lede: 'PRINTFILM · Self-hosted Drama and AI Short Video',
nickname: 'Display name',
email: 'Email',
password: 'Password',
@@ -126,14 +133,14 @@ export const enShell = {
create: {
title: 'Start creating',
hint: 'Pick a product and enter its workflow',
- drama: 'AI Drama',
+ drama: 'Self-hosted Drama',
dramaHint: 'Script · episodes · film',
canvas: 'Free canvas',
canvasHint: 'Infinite canvas · images · video',
kepu: 'AI Short Video',
kepuHint: 'Idea · Copy & storyboard · Images & voice · Compose',
- toolsFootPrefix: 'Or browse standalone tools in the',
- toolsFootLink: 'tool hub',
+ toolsFootPrefix: 'Or explore short-drama skills at',
+ toolsFootLink: 'Drama Skills',
toolsFootSuffix: '',
},
settings: {
@@ -144,7 +151,7 @@ export const enShell = {
account: 'Profile',
projects: 'Drama projects',
kepu: 'AI Short Video',
- tools: 'Tool runs',
+ tools: 'Generations',
assets: 'Assets',
subscription: 'Plan & balance',
team: 'Team',
diff --git a/frontend/src/i18n/locales/zh/pages.ts b/frontend/src/i18n/locales/zh/pages.ts
index 79f1db7..9795e6f 100644
--- a/frontend/src/i18n/locales/zh/pages.ts
+++ b/frontend/src/i18n/locales/zh/pages.ts
@@ -4,13 +4,12 @@ export const zhPages = {
home: {
headlineBefore: '把故事做成',
headlineEm: '能播的片子',
- lede: 'AI 漫剧从剧本到分集成片。AI短视频从想法开始,分步完善文案、分镜、画面与配音,再合成短片。',
+ lede: '漫剧自建算力模式从剧本到分集成片。AI短视频从想法开始,分步完善文案、分镜、画面与配音,再合成短片。',
startCreate: '开始创作',
- browseTools: '浏览工具',
githubCta: '开源仓库 · 在 GitHub 查看',
products: '主产品',
- dramaTitle: 'AI 漫剧',
- dramaFor: '给短剧创作者',
+ dramaTitle: '漫剧自建算力模式',
+ dramaFor: '适合大规模自有算力,可一键出短剧',
dramaDesc: '从一句话生成剧本,沉淀角色与场景,再按集分镜成片。',
kepuTitle: 'AI短视频',
kepuTag: '分步创作',
@@ -22,17 +21,14 @@ export const zhPages = {
howKicker: 'How it works',
howTitle: '从想法到成片,每一步都清楚',
capsKicker: 'Capabilities',
- capsTitle: '工作台里真正能用的',
- toolsKicker: 'Tools',
- toolsTitle: '单点创作工具',
- allTools: '全部工具 →',
+ capsTitle: '从故事到成片的创作能力',
whoKicker: 'For',
whoTitle: '适合谁用',
closeTitle: '从一条创意开始',
- closeLead: '登录后选择漫剧或 AI短视频,进入对应工作台。',
+ closeLead: '登录后选择漫剧自建算力模式或 AI短视频,进入对应工作台。',
viewPricing: '查看定价',
methodLink: '获客短视频方法论',
- footBrand: 'AI 漫剧与 AI短视频创作平台',
+ footBrand: '漫剧自建算力模式与 AI短视频创作平台',
footNav: '页脚导航',
dramaSteps: ['AI 生剧本', '角色与场景', '分集分镜', '成片导出'],
kepuSteps: ['输入想法', '文案与分镜', '画面与配音', '合成成片'],
@@ -64,7 +60,7 @@ export const zhPages = {
noMatch: '没有匹配的问题,试试「下载」「工具」「充值」',
morePrefix: '更多操作可在',
profile: '个人中心',
- moreMid: '查看项目与创作记录,或前往',
+ moreMid: '管理账号资料与安全设置,或前往',
pricing: '定价',
moreMid2: '充值后继续创作。也可查阅',
terms: '用户协议',
@@ -77,18 +73,18 @@ export const zhPages = {
drawerSearch: '搜索指南或常见问题',
noFaq: '没有匹配的问题',
cats: [
- { id: 'start', title: '快速开始', desc: '工作台选产品入口', href: '/' },
- { id: 'drama', title: '漫剧创作', desc: '剧本 · 分集 · 成片', href: '/drama' },
+ { id: 'start', title: '快速开始', desc: '首页选择创作入口', href: '/' },
+ { id: 'drama', title: '漫剧自建算力模式', desc: '剧本 · 分集 · 成片', href: '/drama' },
{ id: 'kepu', title: 'AI短视频', desc: '分镜流水线与成片', href: '/history' },
- { id: 'tools', title: '创作工具', desc: '文生图 / 图生图 / 视频', href: '/tools' },
- { id: 'settings', title: '个人中心', desc: '项目 · 记录 · 下载', href: '/settings?tab=tools' },
+ { id: 'tools', title: '创作工具', desc: '文生图 / 图生图 / 视频', href: '/tools/image' },
+ { id: 'tasks', title: '我的任务', desc: '进度 · 结果 · 下载', href: '/tasks' },
{ id: 'billing', title: '充值说明', desc: '按量计费,余额永久有效', href: '/pricing' },
],
steps: [
{
n: '01',
title: '选创作入口',
- body: '工作台进入「AI 漫剧」或「AI短视频」;单点能力也可从顶栏「工具」进入文生图、图生图、文生视频等。',
+ body: '从首页进入「漫剧自建算力模式」或「AI短视频」。从头像菜单进入「我的任务」,统一查看生成进度与结果。',
},
{
n: '02',
@@ -103,13 +99,13 @@ export const zhPages = {
{
n: '04',
title: '保存与下载',
- body: '结果会写入云端存储。AI短视频在历史页下载;漫剧在项目工作台查看;工具创作在个人中心查看详情并下载。',
+ body: '结果会写入云端存储。AI短视频在历史页下载;漫剧在项目工作台查看;所有生成任务可从头像菜单进入「我的任务」查看与下载。',
},
],
faq: [
{
q: '第一次使用从哪开始?',
- a: '打开工作台,选择「AI 漫剧」或「AI短视频」。漫剧适合分集叙事与角色一致性;AI短视频定位获客,适合卖点讲解与分镜流水线。若只要单张图或短片段,可直接进入「工具」。',
+ a: '打开首页,选择「漫剧自建算力模式」或「AI短视频」。漫剧适合分集叙事与角色一致性;AI短视频定位获客,适合卖点讲解与分镜流水线。生成进度与结果可从头像菜单进入「我的任务」查看。',
},
{
q: '「AI 视频」和「静图成片」有什么区别?',
@@ -117,7 +113,7 @@ export const zhPages = {
},
{
q: '生成中可以离开页面吗?',
- a: '可以。任务在服务端继续执行。AI短视频可回历史页看进度;漫剧回对应项目工作台;工具视频任务请尽量停留在当前页等待完成,或稍后在个人中心查看状态。',
+ a: '可以。任务在服务端继续执行。从头像菜单进入「我的任务」可统一查看生成状态;AI短视频和漫剧也可回历史页或对应项目工作台查看。',
},
{
q: '工具中心能做什么?',
@@ -125,23 +121,23 @@ export const zhPages = {
},
{
q: '工具生成结果保存在哪里?',
- a: '每次成功生成都会写入创作记录,媒体文件同步到云端对象存储(OSS)。可在头像 → 个人中心 →「工具创作」查看封面、状态与提示词。',
+ a: '生成任务统一登记到「我的任务」,媒体文件同步到云端对象存储(OSS)。可从头像 →「我的任务」查看封面、状态与提示词。',
},
{
q: '如何查看和下载工具结果?',
- a: '打开个人中心「工具创作」,点击「查看」可预览大图或视频;点击「下载」将从云端地址保存到本地。生成页右侧成功后也会提示可前往个人中心回看。',
+ a: '从头像菜单打开「我的任务」,点击「查看」可预览大图或视频;点击「下载」将结果保存到本地。',
},
{
q: '成片或素材在哪里下载?',
- a: 'AI短视频:顶栏「AI短视频」历史页,已完成项目可下载或打包。漫剧:进入对应项目工作台查看分镜与成片。全局资产:顶栏「资产」管理角色、场景、道具与音色。',
+ a: 'AI短视频:顶栏「AI短视频」历史页,已完成项目可下载或打包。漫剧:进入对应项目工作台查看分镜与成片。全局资产:头像菜单「我的资产」管理角色、场景、道具与音色。',
},
{
q: '个人中心有哪些内容?',
- a: '包含账号信息、漫剧项目、AI短视频历史、工具创作记录、资产管理入口,以及订阅与余额。可进入团队空间并管理账号安全,通知偏好仍在建设中。',
+ a: '个人中心保留账号信息、团队与协作、通知偏好和账号安全。生成记录与资产分别从头像菜单「我的任务」「我的资产」进入,余额及用量从「余额与账单」查看。通知偏好仍在建设中。',
},
{
q: '如何充值?余额怎么扣?',
- a: '打开「定价」选择充值档位,支持支付宝与微信支付;未登录会先引导登录。按实际调用量扣费,余额永久有效,无强制订阅。用量可在定价页或个人中心「订阅与余额」查看。',
+ a: '打开「定价」选择充值档位,支持支付宝与微信支付;未登录会先引导登录。按实际调用量扣费,余额永久有效,无强制订阅。用量可在定价页或头像菜单「余额与账单」查看。',
},
{
q: '生成失败或画面不符合预期怎么办?',
@@ -154,9 +150,9 @@ export const zhPages = {
{ id: 'tools', title: '工具说明', desc: '文生图与短视频' },
],
toolsNote:
- '工具中心已开放文生图、图生图、图生产品、文生视频、视频生视频与电商拼图。生成结果会保存到云端,并在个人中心「工具创作」中支持查看与下载。',
+ '独立生成支持文生图、图生图、图生产品、文生视频、视频生视频与电商拼图。生成结果会保存到云端,可从头像菜单「我的任务」查看与下载。',
openTools: '打开工具',
- toolRecords: '创作记录',
+ toolRecords: '我的任务',
},
contact: {
crumb: '联系我们',
@@ -209,132 +205,6 @@ export const zhPages = {
],
topics: ['账号与登录', '充值与到账', '创作任务异常', '下载与素材', '隐私与账号注销', '其他'],
},
- tools: {
- title: 'AI 创作工具',
- lead: '进入工具工作台,生成图片与短视频。',
- goDrama: '去漫剧创作',
- goDramaHint: '剧本 · 分集 · 成片',
- goKepu: '去AI短视频',
- goKepuHint: '分镜流水线出片',
- generating: '生成中…',
- generatingVideo: '视频生成中…',
- generatingShort: '正在生成',
- generatingVideoShort: '视频生成中',
- savedPrefix: '已保存,可在',
- savedLink: '个人中心 · 工具创作',
- savedSuffix: '查看',
- allTools: '全部工具',
- uploadHint: '点击或拖拽上传',
- filesSelected: '已选 {count} 个文件',
- inputPlaceholder: '输入{label}…',
- resultArea: '生成结果',
- resultEmpty: '结果预览区',
- resultEmptyHint: '生成完成后将在此展示',
- videoWaitHint: '通常需要 1–3 分钟,可停留在本页等待',
- imageWaitHint: '画面生成大约 20–40 秒',
- previewAlt: '静帧预览',
- resultAlt: '生成结果',
- downloadVideo: '下载视频',
- downloadImage: '下载图片',
- errors: {
- fillPrompt: '请填写提示词',
- uploadRef: '请上传参考图',
- fillScript: '请填写视频脚本',
- uploadSource: '请上传源视频或首帧图',
- uploadProduct: '请上传商品图',
- uploadTwoImages: '拼接至少上传 2 张图片',
- videoFailed: '视频生成失败',
- pollFailed: '查询失败',
- generateFailed: '生成失败',
- notLoggedIn: '未登录',
- },
- items: {
- audio: {
- title: '音频生成', desc: '选择音色,让文字成为有温度的声音',
- panelHint: '输入文字,选择音色,生成配音。', cta: '生成语音',
- fields: { prompt: { label: '朗读文字', placeholder: '输入你想朗读的文字…' } },
- },
- t2i: {
- title: '文生图',
- desc: '用文字描述生成高质量画面',
- panelHint: '用文字描述画面,选择画幅后即可生成。',
- cta: '生成',
- fields: {
- prompt: { label: '提示词', placeholder: '描述主体、场景、光线与风格…' },
- negative: { label: '反向提示词', placeholder: '不想出现的内容,如文字、水印…' },
- ratio: { label: '画幅' },
- },
- },
- i2i: {
- title: '图生图',
- desc: '上传参考图,生成风格一致的变体',
- panelHint: '上传参考图,描述希望保留或改变的部分。',
- cta: '生成',
- fields: {
- ref: { label: '参考图' },
- prompt: { label: '提示词', placeholder: '保持主体,改为电影感夜景…' },
- strength: { label: '相似度' },
- },
- },
- i2p: {
- title: '图生产品',
- desc: '一键生成白底图与场景商品图',
- panelHint: '上传商品图,选择白底、场景或详情长图。',
- cta: '生成商品图',
- fields: {
- product: { label: '商品图' },
- mode: { label: '输出类型' },
- prompt: { label: '补充描述(可选)', placeholder: '材质、摆放、使用场景…' },
- },
- },
- t2v: {
- title: '文生视频',
- desc: '从脚本生成短视频片段',
- panelHint: '填写脚本后先出静帧,再生成短视频(约 1–3 分钟)。',
- cta: '生成视频',
- fields: {
- script: { label: '视频脚本', placeholder: '描述镜头运动、主体动作与氛围…' },
- duration: { label: '时长' },
- ratio: { label: '画幅' },
- },
- },
- v2v: {
- title: '视频生视频',
- desc: '对已有视频做风格与运动变换',
- panelHint: '上传源视频或首帧图,描述风格与运动强度。',
- cta: '开始变换',
- fields: {
- source: { label: '源视频 / 首帧' },
- prompt: { label: '变换描述', placeholder: '改为赛博朋克夜景,镜头缓缓推进…' },
- motion: { label: '运动强度' },
- },
- },
- ecom: {
- title: '电商工具',
- desc: '主图拼接、详情排版等小工具合集',
- panelHint: '拼接至少 2 张图;卖点海报上传 1 张商品图即可生成。',
- cta: '开始制作',
- fields: {
- pack: { label: '工具包' },
- images: { label: '图片' },
- prompt: { label: '卖点描述(海报可选)', placeholder: '突出材质与使用场景…' },
- },
- },
- },
- chips: {
- 低: '低',
- 中: '中',
- 高: '高',
- 弱: '弱',
- 强: '强',
- 白底图: '白底图',
- 场景图: '场景图',
- 详情长图: '详情长图',
- 主图拼接: '主图拼接',
- 详情排版: '详情排版',
- 卖点海报: '卖点海报',
- },
- },
pricing: {
title: '按需充值,灵活使用',
lead: '按实际消耗 token 计费,余量永久有效,不设过期',
@@ -403,7 +273,7 @@ export const zhPages = {
selectProject: '选择下载 {title}',
progress: '制作进度',
newKepu: '新建短视频',
- goDrama: '去漫剧',
+ goDrama: '进入漫剧自建算力模式',
statTotal: '总作品数',
statRunning: '生成中',
runningNow: '正在生成中',
@@ -440,8 +310,8 @@ export const zhPages = {
pagination: 'AI短视频分页',
},
dramaList: {
- title: '我的漫剧项目',
- description: '从故事到分镜,管理你的系列漫剧创作。',
+ title: '漫剧自建算力模式',
+ description: '适合大规模自有算力,从故事创意到多集短剧。',
emptyTitle: '还没有漫剧项目',
emptyDescription: '写下故事创意,创建你的第一部漫剧。',
assets: '资产库',
diff --git a/frontend/src/i18n/locales/zh/shell.ts b/frontend/src/i18n/locales/zh/shell.ts
index bc3e372..98ffbb2 100644
--- a/frontend/src/i18n/locales/zh/shell.ts
+++ b/frontend/src/i18n/locales/zh/shell.ts
@@ -3,7 +3,7 @@
export const zhShell = {
meta: {
title: 'PRINTFILM · AI短视频平台',
- description: 'PRINTFILM:AI 漫剧从剧本到分集成片,AI短视频从卖点到分镜成片。',
+ description: 'PRINTFILM:漫剧自建算力模式从剧本到分集成片,AI短视频从卖点到分镜成片。',
},
common: {
comingSoon: '即将推出',
@@ -45,8 +45,8 @@ export const zhShell = {
cancel: '取消',
},
nav: {
- workbench: '工作台',
- drama: '漫剧',
+ home: '首页',
+ drama: '漫剧自建算力模式',
canvas: '自由画布',
creation: '创作',
resources: '资源与协作',
@@ -56,8 +56,15 @@ export const zhShell = {
kepu: 'AI短视频',
video: '视频',
image: '图片',
- tools: '小工具',
+ skills: '短剧Skills',
+ audio: '音频',
tasks: '我的任务',
+ accountMenu: '个人菜单',
+ myCreation: '我的创作',
+ myAssets: '我的资产',
+ myPublishing: '我的发布',
+ accountManagement: '账户管理',
+ balanceBilling: '余额与账单',
assets: '资产',
pricing: '定价',
help: '帮助',
@@ -94,11 +101,11 @@ export const zhShell = {
tip: '添加微信号 gitpp88,备注「入群」即可拉你进用户群。',
},
auth: {
- loginTitle: '回到工作台',
+ loginTitle: '欢迎回来',
registerTitle: '创建创作者账号',
forgotTitle: '找回密码',
resetTitle: '设置新密码',
- lede: 'PRINTFILM · AI 漫剧与 AI短视频创作平台',
+ lede: 'PRINTFILM · 漫剧自建算力模式与 AI短视频创作平台',
nickname: '昵称',
email: '邮箱',
password: '密码',
@@ -125,15 +132,15 @@ export const zhShell = {
create: {
title: '开始创作',
hint: '选择一个产品线,进入对应工作流',
- drama: 'AI 漫剧',
+ drama: '漫剧自建算力模式',
dramaHint: '剧本 · 分集 · 成片',
canvas: '自由画布',
canvasHint: '无限画布 · 图像 · 视频',
kepu: 'AI短视频',
kepuHint: '输入想法 · 文案分镜 · 画面配音 · 合成成片',
toolsFootPrefix: '也可以先去',
- toolsFootLink: '工具中心',
- toolsFootSuffix: '浏览独立能力',
+ toolsFootLink: '短剧Skills',
+ toolsFootSuffix: '查看短剧创作技能',
},
settings: {
nav: '设置导航',
@@ -143,7 +150,7 @@ export const zhShell = {
account: '账号信息',
projects: '漫剧项目',
kepu: '科普历史',
- tools: '工具创作',
+ tools: '生成记录',
assets: '资产管理',
subscription: '订阅与余额',
team: '团队管理',
diff --git a/frontend/src/lib/helpContent.ts b/frontend/src/lib/helpContent.ts
index 41ac727..7e925f5 100644
--- a/frontend/src/lib/helpContent.ts
+++ b/frontend/src/lib/helpContent.ts
@@ -19,11 +19,11 @@ export type HelpGuideStep = {
}
export const HELP_CATS: HelpCatItem[] = [
- { id: 'start', title: '快速开始', desc: '工作台选产品入口', href: '/' },
- { id: 'drama', title: '漫剧创作', desc: '剧本 · 分集 · 成片', href: '/drama' },
+ { id: 'start', title: '快速开始', desc: '首页选择创作入口', href: '/' },
+ { id: 'drama', title: '漫剧自建算力模式', desc: '剧本 · 分集 · 成片', href: '/drama' },
{ id: 'kepu', title: 'AI短视频', desc: '分镜流水线与成片', href: '/history' },
- { id: 'tools', title: '创作工具', desc: '文生图 / 图生图 / 视频', href: '/tools' },
- { id: 'settings', title: '个人中心', desc: '项目 · 记录 · 下载', href: '/settings?tab=tools' },
+ { id: 'tools', title: '创作工具', desc: '文生图 / 图生图 / 视频', href: '/tools/image' },
+ { id: 'tasks', title: '我的任务', desc: '进度 · 结果 · 下载', href: '/tasks' },
{ id: 'billing', title: '充值说明', desc: '按量计费,余额永久有效', href: '/pricing' },
]
@@ -31,7 +31,7 @@ export const HELP_GUIDE_STEPS: HelpGuideStep[] = [
{
n: '01',
title: '选创作入口',
- body: '工作台进入「AI 漫剧」或「AI短视频」;单点能力也可从顶栏「工具」进入文生图、图生图、文生视频等。',
+ body: '从首页进入「漫剧自建算力模式」或「AI短视频」。从头像菜单进入「我的任务」,统一查看生成进度与结果。',
},
{
n: '02',
@@ -46,14 +46,14 @@ export const HELP_GUIDE_STEPS: HelpGuideStep[] = [
{
n: '04',
title: '保存与下载',
- body: '结果会写入云端存储。AI短视频在历史页下载;漫剧在项目工作台查看;工具创作在个人中心查看详情并下载。',
+ body: '结果会写入云端存储。AI短视频在历史页下载;漫剧在项目工作台查看;所有生成任务可从头像菜单进入「我的任务」查看与下载。',
},
]
export const HELP_FAQ_ITEMS: HelpFaqItem[] = [
{
q: '第一次使用从哪开始?',
- a: '打开工作台,选择「AI 漫剧」或「AI短视频」。漫剧适合分集叙事与角色一致性;AI短视频定位获客,适合卖点讲解与分镜流水线。若只要单张图或短片段,可直接进入「工具」。',
+ a: '打开首页,选择「漫剧自建算力模式」或「AI短视频」。漫剧适合分集叙事与角色一致性;AI短视频定位获客,适合卖点讲解与分镜流水线。生成进度与结果可从头像菜单进入「我的任务」查看。',
},
{
q: '「AI 视频」和「静图成片」有什么区别?',
@@ -61,7 +61,7 @@ export const HELP_FAQ_ITEMS: HelpFaqItem[] = [
},
{
q: '生成中可以离开页面吗?',
- a: '可以。任务在服务端继续执行。AI短视频可回历史页看进度;漫剧回对应项目工作台;工具视频任务请尽量停留在当前页等待完成,或稍后在个人中心查看状态。',
+ a: '可以。任务在服务端继续执行。从头像菜单进入「我的任务」可统一查看生成状态;AI短视频和漫剧也可回历史页或对应项目工作台查看。',
},
{
q: '工具中心能做什么?',
@@ -69,23 +69,23 @@ export const HELP_FAQ_ITEMS: HelpFaqItem[] = [
},
{
q: '工具生成结果保存在哪里?',
- a: '每次成功生成都会写入创作记录,媒体文件同步到云端对象存储(OSS)。可在头像 → 个人中心 →「工具创作」查看封面、状态与提示词。',
+ a: '生成任务统一登记到「我的任务」,媒体文件同步到云端对象存储(OSS)。可从头像 →「我的任务」查看封面、状态与提示词。',
},
{
q: '如何查看和下载工具结果?',
- a: '打开个人中心「工具创作」,点击「查看」可预览大图或视频;点击「下载」将从云端地址保存到本地。生成页右侧成功后也会提示可前往个人中心回看。',
+ a: '从头像菜单打开「我的任务」,点击「查看」可预览大图或视频;点击「下载」将结果保存到本地。',
},
{
q: '成片或素材在哪里下载?',
- a: 'AI短视频:顶栏「AI短视频」历史页,已完成项目可下载或打包。漫剧:进入对应项目工作台查看分镜与成片。全局资产:顶栏「资产」管理角色、场景、道具与音色。',
+ a: 'AI短视频:顶栏「AI短视频」历史页,已完成项目可下载或打包。漫剧:进入对应项目工作台查看分镜与成片。全局资产:头像菜单「我的资产」管理角色、场景、道具与音色。',
},
{
q: '个人中心有哪些内容?',
- a: '包含账号信息、漫剧项目、AI短视频历史、工具创作记录、资产管理入口,以及订阅与余额。团队、API、通知偏好等能力仍在建设中。',
+ a: '个人中心保留账号信息、团队与协作、通知偏好和账号安全。生成记录与资产分别从头像菜单「我的任务」「我的资产」进入,余额及用量从「余额与账单」查看。通知偏好仍在建设中。',
},
{
q: '如何充值?余额怎么扣?',
- a: '打开「定价」选择充值档位,支持支付宝与微信支付;未登录会先引导登录。按实际调用量扣费,余额永久有效,无强制订阅。用量可在定价页或个人中心「订阅与余额」查看。',
+ a: '打开「定价」选择充值档位,支持支付宝与微信支付;未登录会先引导登录。按实际调用量扣费,余额永久有效,无强制订阅。用量可在定价页或头像菜单「余额与账单」查看。',
},
{
q: '生成失败或画面不符合预期怎么办?',
diff --git a/frontend/src/lib/siteLinks.ts b/frontend/src/lib/siteLinks.ts
index d3a2462..1d664d4 100644
--- a/frontend/src/lib/siteLinks.ts
+++ b/frontend/src/lib/siteLinks.ts
@@ -1,3 +1,4 @@
/** 站外固定链接(开源仓库等) */
export const GITHUB_REPO_URL = 'https://github.com/yi1108/printfilm'
+export const FILM_SKILLS_URL = 'https://www.gitcc.com/ai1/film-skills'
diff --git a/frontend/src/lib/siteNavigation.ts b/frontend/src/lib/siteNavigation.ts
index 9cdbd08..0158744 100644
--- a/frontend/src/lib/siteNavigation.ts
+++ b/frontend/src/lib/siteNavigation.ts
@@ -1,25 +1,26 @@
-/** 主导航路由:创作产品、独立生成与资源协作共用同一份入口配置。 */
+/** 导航入口:公开产品位于顶栏,个人资源收进头像菜单。 */
import { SHORT_VIDEO_LIST_PATH } from './shortVideoRoutes.ts'
-export type NavActive = 'home' | 'canvas' | 'drama' | 'kepu' | 'video' | 'image' | 'tools' | 'assets' | 'pricing' | 'templates' | 'studio' | 'history' | 'team' | 'tasks' | 'help' | 'settings'
+export type NavActive = 'home' | 'canvas' | 'drama' | 'kepu' | 'video' | 'image' | 'audio' | 'assets' | 'pricing' | 'templates' | 'studio' | 'history' | 'team' | 'tasks' | 'help' | 'settings'
+
+/** 首页是全站总览入口,独立于具体创作产品分组。 */
+export const HOME_NAV = { key: 'home', path: '/', label: 'nav.home' } as const
export const CREATION_NAV = [
- { key: 'home', path: '/', label: 'nav.workbench' },
{ key: 'drama', path: '/drama', label: 'nav.drama' },
{ key: 'canvas', path: '/canvas', label: 'nav.canvas' },
{ key: 'kepu', path: SHORT_VIDEO_LIST_PATH, label: 'nav.kepu' },
- { key: 'video', path: '/tools/video', label: 'nav.video' },
- { key: 'image', path: '/tools/image', label: 'nav.image' },
- { key: 'tools', path: '/tools', label: 'nav.tools' },
] as const
export const RESOURCE_NAV = [
- { key: 'tasks', path: '/tasks', label: 'nav.tasks' },
- { key: 'assets', path: '/assets', label: 'nav.assets' },
- { key: 'team', path: '/teams', label: 'nav.team' },
{ key: 'pricing', path: '/pricing', label: 'nav.pricing' },
] as const
+export const PERSONAL_NAV = [
+ { key: 'tasks', path: '/tasks', label: 'nav.tasks' },
+ { key: 'assets', path: '/assets', label: 'nav.myAssets' },
+] as const
+
/** 路由段精确匹配,避免 /canvas-unknown 等非业务地址误高亮。 */
export function resolveNavActive(pathname: string, active?: NavActive): NavActive | undefined {
if (active === 'studio' || active === 'templates' || active === 'history') return 'kepu'
@@ -32,7 +33,7 @@ export function resolveNavActive(pathname: string, active?: NavActive): NavActiv
if (['/studio', '/templates', '/history'].some(within)) return 'kepu'
if (within('/tools/video')) return 'video'
if (within('/tools/image')) return 'image'
- if (within('/tools')) return 'tools'
+ if (within('/tools/audio')) return 'audio'
if (within('/tasks')) return 'tasks'
if (within('/pricing')) return 'pricing'
if (within('/help')) return 'help'
diff --git a/frontend/src/lib/toolsCatalog.ts b/frontend/src/lib/toolsCatalog.ts
deleted file mode 100644
index a99eaed..0000000
--- a/frontend/src/lib/toolsCatalog.ts
+++ /dev/null
@@ -1,172 +0,0 @@
-import { AudioLines, Clapperboard, Image, Images, Play, ShoppingBag, Sparkles, Video } from 'lucide-react'
-import type { LucideIcon } from 'lucide-react'
-import type { Messages } from '../i18n'
-
-export type ToolId = 't2i' | 'i2i' | 'i2p' | 't2v' | 'v2v' | 'ecom' | 'audio'
-
-export type ToolField = {
- key: string
- label: string
- kind: 'textarea' | 'upload' | 'chips'
- options?: string[]
- multiple?: boolean
- accept?: string
- placeholder?: string
-}
-
-export type ToolDef = {
- id: ToolId
- title: string
- desc: string
- soon: boolean
- icon: LucideIcon
- /** 左侧控件区文案提示 */
- panelHint: string
- fields: ToolField[]
- cta: string
-}
-
-export const TOOL_DEFS: ToolDef[] = [
- {
- id: 'audio', title: '音频生成', desc: '让文字成为有温度的声音', soon: false, icon: AudioLines,
- panelHint: '输入文字,选择音色,生成可下载的配音。', cta: '生成语音',
- fields: [{ key: 'prompt', label: '朗读文字', kind: 'textarea', placeholder: '输入你想朗读的文字…' }],
- },
- {
- id: 't2i',
- title: '文生图',
- desc: '用文字描述生成高质量画面',
- soon: false,
- icon: Image,
- panelHint: '用文字描述画面,选择画幅后即可生成。',
- fields: [
- { key: 'prompt', label: '提示词', kind: 'textarea', placeholder: '描述主体、场景、光线与风格…' },
- { key: 'negative', label: '反向提示词', kind: 'textarea', placeholder: '不想出现的内容,如文字、水印…' },
- { key: 'ratio', label: '画幅', kind: 'chips', options: ['1:1', '16:9', '9:16'] },
- ],
- cta: '生成',
- },
- {
- id: 'i2i',
- title: '图生图',
- desc: '上传参考图,生成风格一致的变体',
- soon: false,
- icon: Sparkles,
- panelHint: '上传参考图,描述希望保留或改变的部分。',
- fields: [
- { key: 'ref', label: '参考图', kind: 'upload', accept: 'image/*' },
- { key: 'prompt', label: '提示词', kind: 'textarea', placeholder: '保持主体,改为电影感夜景…' },
- { key: 'strength', label: '相似度', kind: 'chips', options: ['低', '中', '高'] },
- ],
- cta: '生成',
- },
- {
- id: 'i2p',
- title: '图生产品',
- desc: '一键生成白底图与场景商品图',
- soon: false,
- icon: ShoppingBag,
- panelHint: '上传商品图,选择白底、场景或详情长图。',
- fields: [
- { key: 'product', label: '商品图', kind: 'upload', accept: 'image/*' },
- { key: 'mode', label: '输出类型', kind: 'chips', options: ['白底图', '场景图', '详情长图'] },
- { key: 'prompt', label: '补充描述(可选)', kind: 'textarea', placeholder: '材质、摆放、使用场景…' },
- ],
- cta: '生成商品图',
- },
- {
- id: 't2v',
- title: '文生视频',
- desc: '从脚本生成短视频片段',
- soon: false,
- icon: Play,
- panelHint: '填写脚本后先出静帧,再生成短视频(约 1–3 分钟)。',
- fields: [
- { key: 'script', label: '视频脚本', kind: 'textarea', placeholder: '描述镜头运动、主体动作与氛围…' },
- { key: 'duration', label: '时长', kind: 'chips', options: ['5s', '10s', '15s'] },
- { key: 'ratio', label: '画幅', kind: 'chips', options: ['16:9', '9:16'] },
- ],
- cta: '生成视频',
- },
- {
- id: 'v2v',
- title: '视频生视频',
- desc: '对已有视频做风格与运动变换',
- soon: false,
- icon: Clapperboard,
- panelHint: '上传源视频或首帧图,描述风格与运动强度。',
- fields: [
- {
- key: 'source',
- label: '源视频 / 首帧',
- kind: 'upload',
- accept: 'video/mp4,video/quicktime,video/webm,image/*',
- },
- { key: 'prompt', label: '变换描述', kind: 'textarea', placeholder: '改为赛博朋克夜景,镜头缓缓推进…' },
- { key: 'motion', label: '运动强度', kind: 'chips', options: ['弱', '中', '强'] },
- ],
- cta: '开始变换',
- },
- {
- id: 'ecom',
- title: '电商工具',
- desc: '主图拼接、详情排版等小工具合集',
- soon: false,
- icon: Images,
- panelHint: '拼接至少 2 张图;卖点海报上传 1 张商品图即可生成。',
- fields: [
- { key: 'pack', label: '工具包', kind: 'chips', options: ['主图拼接', '详情排版', '卖点海报'] },
- { key: 'images', label: '图片', kind: 'upload', multiple: true, accept: 'image/*' },
- { key: 'prompt', label: '卖点描述(海报可选)', kind: 'textarea', placeholder: '突出材质与使用场景…' },
- ],
- cta: '开始制作',
- },
-]
-
-// 按 id 查找工具定义
-export function getToolDef(id: string | undefined): ToolDef | undefined {
- return TOOL_DEFS.find((t) => t.id === id)
-}
-
-export const PRODUCT_ICONS = { drama: Clapperboard, kepu: Video }
-
-// 芯片字段的默认选中项(取 options 第一项;值为中文枚举,给后端)
-export function defaultToolChips(tool: ToolDef): Record<string, string> {
- const chips: Record<string, string> = {}
- for (const field of tool.fields) {
- if (field.kind === 'chips' && field.options?.[0]) chips[field.key] = field.options[0]
- }
- return chips
-}
-
-// 用当前语言覆盖工具标题、说明与字段文案(options 值保持中文给 API)
-export function localizeToolDef(tool: ToolDef, m: Messages): ToolDef {
- const pack = m.tools.items[tool.id]
- return {
- ...tool,
- title: pack.title,
- desc: pack.desc,
- panelHint: pack.panelHint,
- cta: pack.cta,
- fields: tool.fields.map((field) => {
- const f = pack.fields[field.key as keyof typeof pack.fields] as
- | { label?: string; placeholder?: string }
- | undefined
- return {
- ...field,
- label: f?.label || field.label,
- placeholder: f?.placeholder || field.placeholder,
- }
- }),
- }
-}
-
-export function localizeToolDefs(m: Messages): ToolDef[] {
- return TOOL_DEFS.filter((tool) => tool.id !== 'audio').map((tool) => localizeToolDef(tool, m))
-}
-
-// 芯片展示文案;未知值原样返回
-export function chipDisplayLabel(value: string, m: Messages): string {
- const chips = m.tools.chips as Record<string, string>
- return chips[value] || value
-}
diff --git a/frontend/src/pages/GenerationPage.tsx b/frontend/src/pages/GenerationPage.tsx
index 83ce9d0..a7bc36a 100644
--- a/frontend/src/pages/GenerationPage.tsx
+++ b/frontend/src/pages/GenerationPage.tsx
@@ -1,5 +1,5 @@
import { useEffect, useMemo, useRef, useState } from 'react'
-import { Link, Navigate, useParams } from 'react-router-dom'
+import { Link, Navigate } from 'react-router-dom'
import { ArrowRight, AudioLines, Check, Clock3, Download, Eye, ImagePlus, Layers, Loader2, Mic, Plus, RectangleHorizontal, RectangleVertical, Sparkles, Square, X } from 'lucide-react'
import { getGenerationConfig, listToolRuns, resolveToolMediaUrl, runStudioTool, type ToolRunRecord } from '../api/tools'
import BillingErrorNotice from '../components/billing/BillingErrorNotice'
@@ -17,16 +17,10 @@ import { useGenerationEstimate } from '../hooks/useGenerationEstimate'
import { generationReferenceLimits, serializeGenerationReferences, validateGenerationReferences, type GenerationReference, type VideoGenerationMode } from '../lib/generationReferences'
import { detectPromptMentionTrigger, measureTextareaCaretRect, type MentionCaretRect } from '../lib/promptMention'
-const aliases: Record<string, MediaKind> = { video: 'video', t2v: 'video', v2v: 'video', image: 'image', t2i: 'image', i2i: 'image', i2p: 'image', ecom: 'image', audio: 'audio' }
-
-/** 展示指定媒体的生成工作台,同时兼容原来的工具分类参数。 */
-export default function GenerationPage({ kind }: { kind?: MediaKind }) {
- const { toolId } = useParams()
- // 显式分类供固定路由使用,旧动态路由仍按工具别名归类。
- const requestedKind = kind || toolId
- if (!localStorage.getItem('token')) return <Navigate to={`/auth?next=${encodeURIComponent(`/tools/${requestedKind || 'video'}`)}`} replace />
- if (!requestedKind || aliases[requestedKind] !== requestedKind) return <Navigate to={`/tools/${aliases[requestedKind || 'video'] || 'video'}`} replace />
- return <GenerationWorkspace kind={aliases[requestedKind]} key={requestedKind} />
+/** 图片、视频、音频使用明确的独立生成入口。 */
+export default function GenerationPage({ kind }: { kind: MediaKind }) {
+ if (!localStorage.getItem('token')) return <Navigate to={`/auth?next=${encodeURIComponent(`/tools/${kind}`)}`} replace />
+ return <GenerationWorkspace kind={kind} key={kind} />
}
function GenerationWorkspace({ kind }: { kind: MediaKind }) {
diff --git a/frontend/src/pages/HelpPage.tsx b/frontend/src/pages/HelpPage.tsx
index cda2670..447eead 100644
--- a/frontend/src/pages/HelpPage.tsx
+++ b/frontend/src/pages/HelpPage.tsx
@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'
import AppShell from '../components/layout/AppShell'
import { useI18n } from '../i18n'
import { filterHelpFaq } from '../lib/helpContent'
+import { GITHUB_REPO_URL } from '../lib/siteLinks'
/** 帮助中心整页:分类入口、上手步骤、可搜索 FAQ */
export default function HelpPage() {
@@ -83,6 +84,7 @@ export default function HelpPage() {
</section>
<section className="pf-help-more">
+ <p><a href={GITHUB_REPO_URL} target="_blank" rel="noopener noreferrer">{t('nav.github')}</a></p>
<p className="pf-muted">
{t('help.morePrefix')}{' '}
<Link to="/settings">{t('help.profile')}</Link>
diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx
index 9f93a64..bcbd1c4 100644
--- a/frontend/src/pages/HomePage.tsx
+++ b/frontend/src/pages/HomePage.tsx
@@ -1,16 +1,14 @@
-/** PRINTFILM 官网首页:产品主张、漫剧/科普入口、成片流程与工具 */
+/** PRINTFILM 官网首页:产品主张、漫剧/科普入口、成片流程与创作入口 */
import { useEffect, useState } from 'react'
import { Link, useNavigate } from 'react-router-dom'
-import { ArrowRight } from 'lucide-react'
+import { ArrowRight, ArrowUpRight, Clapperboard as DramaIcon, Video as KepuIcon } from 'lucide-react'
import AppShell from '../components/layout/AppShell'
import Button from '../components/ui/Button'
import { IconGithub } from '../components/ui/Icons'
-import ComingSoon from '../components/ui/ComingSoon'
import CreateChoiceModal from '../components/ui/CreateChoiceModal'
import { useI18n } from '../i18n'
import { getDramaImageStylePreviewUrl } from '../lib/dramaImageStylePreviews'
-import { GITHUB_REPO_URL } from '../lib/siteLinks'
-import { PRODUCT_ICONS, localizeToolDefs } from '../lib/toolsCatalog'
+import { FILM_SKILLS_URL, GITHUB_REPO_URL } from '../lib/siteLinks'
import { api, type Template } from '../api'
import { SHORT_VIDEO_LIST_PATH, shortVideoCreatePath } from '../lib/shortVideoRoutes'
@@ -21,9 +19,6 @@ export default function HomePage() {
const [createOpen, setCreateOpen] = useState(false)
const [templates, setTemplates] = useState<Template[]>([])
const [templatesError, setTemplatesError] = useState(false)
- const DramaIcon = PRODUCT_ICONS.drama
- const KepuIcon = PRODUCT_ICONS.kepu
- const tools = localizeToolDefs(m)
useEffect(() => {
let active = true
@@ -65,10 +60,10 @@ export default function HomePage() {
{t('home.startCreate')}
<ArrowRight size={16} strokeWidth={2} aria-hidden />
</Button>
- <Button variant="ghost" size="lg" icon to="/tools">
- {t('home.browseTools')}
- <ArrowRight size={16} strokeWidth={2} aria-hidden />
- </Button>
+ <a className="pf-btn pf-btn-ghost pf-btn-lg pf-btn-icon" href={FILM_SKILLS_URL} target="_blank" rel="noopener noreferrer">
+ {t('nav.skills')}
+ <ArrowUpRight size={16} strokeWidth={2} aria-hidden />
+ </a>
</div>
<a
className="pf-land-github"
@@ -191,37 +186,6 @@ export default function HomePage() {
</div>
</section>
- <section className="pf-land-tools" id="tools">
- <header className="pf-land-section-head is-row">
- <div>
- <p className="pf-land-kicker">{t('home.toolsKicker')}</p>
- <h2>{t('home.toolsTitle')}</h2>
- </div>
- <Link to="/tools" className="pf-link">
- {t('home.allTools')}
- </Link>
- </header>
- <div className="pf-land-tool-grid">
- {tools.map((tool) => {
- const Icon = tool.icon
- return (
- <Link
- key={tool.id}
- to={`/tools/${tool.id}`}
- className={`pf-land-tool-card${tool.soon ? ' is-soon' : ''}`}
- >
- <span className="pf-land-tool-icon" aria-hidden>
- <Icon size={20} strokeWidth={1.7} />
- </span>
- <strong>{tool.title}</strong>
- <span>{tool.desc}</span>
- {tool.soon ? <ComingSoon /> : null}
- </Link>
- )
- })}
- </div>
- </section>
-
<section className="pf-land-who" aria-labelledby="pf-land-who-title">
<header className="pf-land-section-head">
<p className="pf-land-kicker">{t('home.whoKicker')}</p>
@@ -262,7 +226,7 @@ export default function HomePage() {
<Link to="/drama">{t('nav.drama')}</Link>
<Link to={SHORT_VIDEO_LIST_PATH}>{t('nav.kepu')}</Link>
<Link to="/method">{t('home.methodLink')}</Link>
- <Link to="/tools">{t('nav.tools')}</Link>
+ <a href={FILM_SKILLS_URL} target="_blank" rel="noopener noreferrer">{t('nav.skills')}</a>
<Link to="/pricing">{t('nav.pricing')}</Link>
<Link to="/help">{t('nav.help')}</Link>
<Link to="/terms">{t('footer.terms')}</Link>
diff --git a/frontend/src/pages/SettingsPage.tsx b/frontend/src/pages/SettingsPage.tsx
index 9c782be..193c6f1 100644
--- a/frontend/src/pages/SettingsPage.tsx
+++ b/frontend/src/pages/SettingsPage.tsx
@@ -1,145 +1,83 @@
-import { useEffect, useState } from 'react'
-import { Link, useNavigate, useSearchParams } from 'react-router-dom'
+import { useEffect, useState } from 'react'
+import { Link, Navigate, useNavigate, useSearchParams } from 'react-router-dom'
import AppShell from '../components/layout/AppShell'
import UserAvatar from '../components/UserAvatar'
import { api, type User, type Wallet } from '../api'
-import { dramaApi, type DramaProjectListItem } from '../api/drama'
import MonthlyUsageCard from '../components/billing/MonthlyUsageCard'
import UsageChargeRecords from '../components/billing/UsageChargeRecords'
import AccountProfileCard from './settings/AccountProfileCard'
import ChangePasswordCard from './settings/ChangePasswordCard'
import ComingSoon from '../components/ui/ComingSoon'
-import { dramaProjectEntryPath, formatDramaCardMeta } from '../lib/dramaWorkflow'
-import { STATUS_CN } from '../lib/status'
-import SettingsToolRunsPanel from './SettingsToolRunsPanel'
-import { formatDateTime, useI18n } from '../i18n'
+import { useI18n } from '../i18n'
import TeamDirectory from '../features/teams/TeamDirectory'
import { USER_UPDATED_EVENT } from '../lib/userEvents'
-type SettingsTab =
- | 'account'
- | 'projects'
- | 'kepu'
- | 'tools'
- | 'assets'
- | 'subscription'
- | 'team'
- | 'notify'
- | 'security'
+type SettingsTab = 'account' | 'subscription' | 'team' | 'notify' | 'security'
-type KepuItem = {
- id: number
- title: string
- status: string
- updated_at?: string
- created_at: string
-}
-
-/*
- * SIDE_ITEMS 侧栏导航项
- * TAB_IDS 合法 tab 集合(用于 URL 校验)
- */
-const SIDE_ITEMS: { id: SettingsTab; soon?: boolean; group?: 'work' | 'account' }[] = [
- { id: 'account', group: 'account' },
- { id: 'projects', group: 'work' },
- { id: 'kepu', group: 'work' },
- { id: 'tools', group: 'work' },
- { id: 'assets', group: 'work' },
- { id: 'subscription', group: 'account' },
- { id: 'team', group: 'account' },
- { id: 'notify', soon: true, group: 'account' },
- { id: 'security', group: 'account' },
+/* 侧栏只保留账户设置;余额与账单通过头像菜单独立进入。 */
+const SIDE_ITEMS: { id: Exclude<SettingsTab, 'subscription'>; soon?: boolean }[] = [
+ { id: 'account' },
+ { id: 'team' },
+ { id: 'notify', soon: true },
+ { id: 'security' },
]
-
-const TAB_IDS = new Set(SIDE_ITEMS.map((i) => i.id))
-
-// 解析 URL tab,非法时回落到账号信息
+const TAB_IDS = new Set<string>([...SIDE_ITEMS.map((item) => item.id), 'subscription'])
+const LEGACY_TAB_PATHS = new Map([
+ ['projects', '/drama'],
+ ['kepu', '/history'],
+ ['tools', '/tasks'],
+ ['assets', '/assets'],
+])
+
+/** 解析账户分区,保留头像余额入口,未知 tab 回落到账号信息。 */
function parseTab(raw: string | null): SettingsTab {
- if (raw && TAB_IDS.has(raw as SettingsTab)) return raw as SettingsTab
- return 'account'
+ return raw && TAB_IDS.has(raw) ? raw as SettingsTab : 'account'
}
-// 格式化相对时间展示
-function formatWhen(iso: string | undefined, locale: 'zh' | 'en') {
- return formatDateTime(iso, locale)
+/** 旧项目与记录分区直接转到统一页面,不再加载重复列表。 */
+export default function SettingsPage() {
+ const [params] = useSearchParams()
+ const legacyPath = LEGACY_TAB_PATHS.get(params.get('tab') || '')
+ return legacyPath ? <Navigate to={legacyPath} replace /> : <AccountSettings />
}
-export default function SettingsPage() {
+/** 个人中心维护账户资料、安全和团队设置,账单保留专用直达视图。 */
+function AccountSettings() {
const nav = useNavigate()
- const { t, locale } = useI18n()
+ const { t } = useI18n()
const [params, setParams] = useSearchParams()
- /*
- * tab 当前侧栏分区
- * user 当前登录用户
- * wallet 钱包余额
- * dramaItems 最近漫剧项目
- * kepuItems 最近科普项目
- * listError 列表加载错误
- * listLoading 列表加载中
- */
- const [tab, setTab] = useState<SettingsTab>(() => parseTab(params.get('tab')))
+ /* tab 由地址决定;user 当前账户;wallet 为账单直达视图提供余额。 */
+ const tab = parseTab(params.get('tab'))
const [user, setUser] = useState<User | null>(null)
const [wallet, setWallet] = useState<Wallet | null>(null)
- const [dramaItems, setDramaItems] = useState<DramaProjectListItem[]>([])
- const [kepuItems, setKepuItems] = useState<KepuItem[]>([])
- const [listError, setListError] = useState('')
- const [listLoading, setListLoading] = useState(false)
useEffect(() => {
if (!localStorage.getItem('token')) {
nav('/auth')
return
}
- api
- .me()
- .then(setUser)
- .catch(() => {
- localStorage.removeItem('token')
- nav('/auth')
- })
- api.wallet().then(setWallet).catch(() => undefined)
+ api.me().then(setUser).catch(() => {
+ localStorage.removeItem('token')
+ nav('/auth')
+ })
}, [nav])
useEffect(() => {
- const next = parseTab(params.get('tab'))
- setTab(next)
- }, [params])
-
- useEffect(() => {
- if (tab !== 'projects' && tab !== 'kepu') return
- let cancelled = false
- setListLoading(true)
- setListError('')
- const load = async () => {
- try {
- if (tab === 'projects') {
- const res = await dramaApi.listProjects({ page: 1, page_size: 8 })
- if (!cancelled) setDramaItems(res.items)
- } else {
- const res = await api.listProjects({ page: 1, page_size: 8 })
- if (!cancelled) setKepuItems(res.items)
- }
- } catch (e) {
- if (!cancelled) setListError(e instanceof Error ? e.message : t('common.loadFailed'))
- } finally {
- if (!cancelled) setListLoading(false)
- }
- }
- void load()
- return () => {
- cancelled = true
- }
+ if (tab !== 'subscription' || !localStorage.getItem('token')) return
+ let active = true
+ api.wallet().then((value) => { if (active) setWallet(value) }).catch(() => undefined)
+ return () => { active = false }
}, [tab])
- // 切换侧栏并同步到 URL
+ /** 切换账户分区并同步到 URL。 */
function selectTab(next: SettingsTab) {
- setTab(next)
const sp = new URLSearchParams(params)
if (next === 'account') sp.delete('tab')
else sp.set('tab', next)
setParams(sp, { replace: true })
}
+ /** 退出后同步所有会话订阅者并回到首页。 */
function logout() {
localStorage.removeItem('token')
window.dispatchEvent(new Event(USER_UPDATED_EVENT))
@@ -159,12 +97,7 @@ export default function SettingsPage() {
</div>
<nav className="pf-settings-nav" aria-label={t('settings.nav')}>
{SIDE_ITEMS.map((item) => (
- <button
- key={item.id}
- type="button"
- className={tab === item.id ? 'active' : ''}
- onClick={() => selectTab(item.id)}
- >
+ <button key={item.id} type="button" className={tab === item.id ? 'active' : ''} onClick={() => selectTab(item.id)}>
{t(`settings.tabs.${item.id}`)}
{item.soon ? <ComingSoon /> : null}
</button>
@@ -178,149 +111,25 @@ export default function SettingsPage() {
<main className="pf-settings-main">
{tab === 'account' ? <AccountProfileCard user={user} onUserChange={setUser} /> : null}
- {tab === 'projects' ? (
- <section className="pf-settings-card">
- <div className="pf-settings-card-head">
- <div>
- <h1>{t('settings.tabs.projects')}</h1>
- <p className="pf-muted">{t('settings.dramaLead')}</p>
- </div>
- <div className="pf-settings-actions">
- <Link className="pf-btn pf-btn-lime pf-btn-sm" to="/drama">
- {t('settings.allProjects')}
- </Link>
- <Link className="pf-btn pf-btn-ghost pf-btn-sm" to="/drama">
- {t('settings.newDrama')}
- </Link>
- </div>
- </div>
- {listLoading ? <p className="pf-muted">{t('common.loading')}</p> : null}
- {listError ? <p className="pf-error">{listError}</p> : null}
- {!listLoading && !listError && dramaItems.length === 0 ? (
- <div className="pf-settings-empty">
- <p>{t('settings.noDrama')}</p>
- <Link className="pf-btn pf-btn-lime pf-btn-sm" to="/drama">
- {t('settings.goCreate')}
- </Link>
- </div>
- ) : null}
- {dramaItems.length > 0 ? (
- <ul className="pf-settings-list">
- {dramaItems.map((item) => (
- <li key={item.id}>
- <Link to={dramaProjectEntryPath(item)} className="pf-settings-list-row">
- <span className="pf-settings-list-main">
- <strong>{item.title || t('settings.projectFallback', { id: item.id })}</strong>
- <em className="pf-muted">{formatDramaCardMeta(item)}</em>
- </span>
- <span className="pf-settings-list-meta pf-muted">
- {formatWhen(item.updated_at || item.created_at, locale)}
- </span>
- </Link>
- </li>
- ))}
- </ul>
- ) : null}
- </section>
- ) : null}
-
- {tab === 'kepu' ? (
- <section className="pf-settings-card">
- <div className="pf-settings-card-head">
- <div>
- <h1>{t('settings.tabs.kepu')}</h1>
- <p className="pf-muted">{t('settings.kepuLead')}</p>
- </div>
- <div className="pf-settings-actions">
- <Link className="pf-btn pf-btn-lime pf-btn-sm" to="/history">
- {t('settings.allHistory')}
- </Link>
- <Link className="pf-btn pf-btn-ghost pf-btn-sm" to="/studio/new">
- {t('settings.newKepu')}
- </Link>
- </div>
- </div>
- {listLoading ? <p className="pf-muted">{t('common.loading')}</p> : null}
- {listError ? <p className="pf-error">{listError}</p> : null}
- {!listLoading && !listError && kepuItems.length === 0 ? (
- <div className="pf-settings-empty">
- <p>{t('settings.noKepu')}</p>
- <Link className="pf-btn pf-btn-lime pf-btn-sm" to="/studio/new">
- {t('settings.goCreate')}
- </Link>
- </div>
- ) : null}
- {kepuItems.length > 0 ? (
- <ul className="pf-settings-list">
- {kepuItems.map((item) => (
- <li key={item.id}>
- <Link to={`/studio/${item.id}`} className="pf-settings-list-row">
- <span className="pf-settings-list-main">
- <strong>{item.title || t('settings.projectFallback', { id: item.id })}</strong>
- <em className="pf-muted">{STATUS_CN[item.status] || item.status}</em>
- </span>
- <span className="pf-settings-list-meta pf-muted">
- {formatWhen(item.updated_at || item.created_at, locale)}
- </span>
- </Link>
- </li>
- ))}
- </ul>
- ) : null}
- </section>
- ) : null}
-
- {tab === 'tools' ? <SettingsToolRunsPanel /> : null}
-
- {tab === 'assets' ? (
- <section className="pf-settings-card">
- <h1>{t('settings.tabs.assets')}</h1>
- <p className="pf-muted">{t('settings.assetsLead')}</p>
- <div className="pf-settings-actions">
- <Link className="pf-btn pf-btn-lime pf-btn-sm" to="/assets">
- {t('settings.openAssets')}
- </Link>
- <Link className="pf-btn pf-btn-ghost pf-btn-sm" to="/drama">
- {t('settings.tabs.projects')}
- </Link>
- <Link className="pf-btn pf-btn-ghost pf-btn-sm" to="/history">
- {t('settings.tabs.kepu')}
- </Link>
- </div>
- </section>
- ) : null}
-
{tab === 'subscription' ? (
<section className="pf-settings-card">
- <h1>{t('settings.tabs.subscription')}</h1>
+ <h1>{t('nav.balanceBilling')}</h1>
<p className="pf-muted">{t('settings.subLead')}</p>
<div className="pf-settings-balance">
- <div>
- <span className="pf-muted">{t('settings.balance')}</span>
- <strong>¥{(wallet?.balance_yuan ?? 0).toFixed(2)}</strong>
- </div>
- <div>
- <span className="pf-muted">{t('settings.frozen')}</span>
- <em>¥{(wallet?.frozen_yuan ?? 0).toFixed(2)}</em>
- </div>
+ <div><span className="pf-muted">{t('settings.balance')}</span><strong>¥{(wallet?.balance_yuan ?? 0).toFixed(2)}</strong></div>
+ <div><span className="pf-muted">{t('settings.frozen')}</span><em>¥{(wallet?.frozen_yuan ?? 0).toFixed(2)}</em></div>
</div>
<MonthlyUsageCard variant="compact" showTopup={false} />
<UsageChargeRecords variant="compact" />
- <div className="pf-settings-actions">
- <Link className="pf-btn pf-btn-lime pf-btn-sm" to="/pricing">
- {t('settings.goTopup')}
- </Link>
- </div>
+ <div className="pf-settings-actions"><Link className="pf-btn pf-btn-lime pf-btn-sm" to="/pricing">{t('settings.goTopup')}</Link></div>
</section>
) : null}
{tab === 'security' ? <ChangePasswordCard email={user?.email || ''} /> : null}
-
{tab === 'team' ? <TeamDirectory compact /> : null}
-
{tab === 'notify' ? (
<section className="pf-settings-card">
- <h1>{t(`settings.tabs.${tab}`)}</h1>
+ <h1>{t('settings.tabs.notify')}</h1>
<p className="pf-muted">{t('settings.soonModule')}</p>
<ComingSoon />
</section>
diff --git a/frontend/src/pages/SettingsToolRunsPanel.tsx b/frontend/src/pages/SettingsToolRunsPanel.tsx
deleted file mode 100644
index dfcfdbf..0000000
--- a/frontend/src/pages/SettingsToolRunsPanel.tsx
+++ /dev/null
@@ -1,343 +0,0 @@
-import { useEffect, useState } from 'react'
-import { Link } from 'react-router-dom'
-import { Download, Eye } from 'lucide-react'
-import BillingErrorNotice from '../components/billing/BillingErrorNotice'
-import Modal from '../components/ui/Modal'
-import Pagination from '../components/ui/Pagination'
-import { fetchMediaBlob, triggerBlobDownload } from '../lib/clientDownload'
-import {
- getToolRun,
- listToolRuns,
- resolveToolMediaUrl,
- type ToolRunRecord,
-} from '../api/tools'
-import { getToolDef } from '../lib/toolsCatalog'
-import { pageCountOf } from '../lib/pagination'
-
-const PAGE_SIZE_DEFAULT = 8
-
-const STATUS_CN: Record<string, string> = {
- cancelled: '已取消',
- queued: '生成中',
- running: '生成中',
- succeeded: '已完成',
- failed: '失败',
-}
-
-// 格式化记录时间
-function formatWhen(iso?: string) {
- if (!iso) return '—'
- const d = new Date(iso)
- if (Number.isNaN(d.getTime())) return '—'
- return d.toLocaleString('zh-CN', {
- month: '2-digit',
- day: '2-digit',
- hour: '2-digit',
- minute: '2-digit',
- })
-}
-
-// 封面:预览图或结果首张
-function coverOf(item: ToolRunRecord): string {
- return resolveToolMediaUrl(item.preview_url || item.urls[0] || '')
-}
-
-// 是否视频类结果
-function isVideoRecord(item: ToolRunRecord, url?: string): boolean {
- if (item.kind === 'video') return true
- const target = url || item.urls[0] || item.preview_url || ''
- return /\.mp4($|\?)/i.test(target)
-}
-
-// 下载文件名:工具名 + 记录 id
-function downloadName(item: ToolRunRecord, url: string): string {
- const tool = getToolDef(item.tool_id)
- const title = (tool?.title || item.tool_id).replace(/\s+/g, '')
- const ext = isVideoRecord(item, url) ? 'mp4' : url.match(/\.([a-z0-9]{3,4})($|\?)/i)?.[1] || 'png'
- return `${title}_${item.id}.${ext}`
-}
-
-/** 个人中心「工具创作」列表:服务端分页 + 详情查看/下载 */
-export default function SettingsToolRunsPanel() {
- /*
- * page 页码
- * pageSize 每页条数
- * items 当前页记录
- * total 总数
- * loading 加载中
- * error 错误
- * detail 详情弹窗记录
- * detailLoading 详情加载中
- * downloading 正在下载的 url
- * actionError 下载/详情错误
- */
- const [page, setPage] = useState(1)
- const [pageSize, setPageSize] = useState(PAGE_SIZE_DEFAULT)
- const [items, setItems] = useState<ToolRunRecord[]>([])
- const [total, setTotal] = useState(0)
- const [loading, setLoading] = useState(true)
- const [error, setError] = useState('')
- const [detail, setDetail] = useState<ToolRunRecord | null>(null)
- const [detailLoading, setDetailLoading] = useState(false)
- const [downloading, setDownloading] = useState('')
- const [actionError, setActionError] = useState('')
-
- useEffect(() => {
- let cancelled = false
- setLoading(true)
- setError('')
- listToolRuns(page, pageSize)
- .then((res) => {
- if (cancelled) return
- setItems(res.items)
- setTotal(res.total)
- })
- .catch((err) => {
- if (!cancelled) setError(err instanceof Error ? err.message : '加载失败')
- })
- .finally(() => {
- if (!cancelled) setLoading(false)
- })
- return () => {
- cancelled = true
- }
- }, [page, pageSize])
-
- const pageCount = pageCountOf(total, pageSize)
-
- // 打开详情:再拉一次接口,确保 OSS 地址最新
- async function openDetail(item: ToolRunRecord) {
- setActionError('')
- setDetail(item)
- setDetailLoading(true)
- try {
- const fresh = await getToolRun(item.id)
- setDetail(fresh)
- setItems((prev) => prev.map((row) => (row.id === fresh.id ? fresh : row)))
- } catch (err) {
- setActionError(err instanceof Error ? err.message : '加载详情失败')
- } finally {
- setDetailLoading(false)
- }
- }
-
- // 从 OSS/公网地址下载结果
- async function downloadUrl(item: ToolRunRecord, url: string) {
- const abs = resolveToolMediaUrl(url)
- if (!abs) return
- setActionError('')
- setDownloading(abs)
- try {
- const blob = await fetchMediaBlob(abs)
- triggerBlobDownload(blob, downloadName(item, abs))
- } catch (err) {
- setActionError(err instanceof Error ? err.message : '下载失败')
- } finally {
- setDownloading('')
- }
- }
-
- return (
- <section className="pf-settings-card">
- <div className="pf-settings-card-head">
- <div>
- <h1>工具创作</h1>
- <p className="pf-muted">文生图、图生图、视频等独立工具的生成记录</p>
- </div>
- <div className="pf-settings-actions">
- <Link className="pf-btn pf-btn-lime pf-btn-sm" to="/tools">
- 去创作
- </Link>
- </div>
- </div>
- {loading ? <p className="pf-muted">加载中…</p> : null}
- {error ? <BillingErrorNotice message={error} /> : null}
- {actionError ? <BillingErrorNotice message={actionError} /> : null}
- {!loading && !error && items.length === 0 ? (
- <div className="pf-settings-empty">
- <p>还没有工具创作记录</p>
- <Link className="pf-btn pf-btn-lime pf-btn-sm" to="/tools">
- 去创作
- </Link>
- </div>
- ) : null}
- {items.length > 0 ? (
- <ul className="pf-settings-list">
- {items.map((item) => {
- const tool = getToolDef(item.tool_id)
- const cover = coverOf(item)
- const video = isVideoRecord(item, cover)
- const firstUrl = item.urls[0] || item.preview_url || ''
- const canDownload = item.status === 'succeeded' && Boolean(firstUrl)
- return (
- <li key={item.id}>
- <div className="pf-settings-list-row pf-settings-tool-row">
- <button type="button" className="pf-settings-tool-main" onClick={() => void openDetail(item)}>
- {cover && item.kind !== 'audio' ? (
- video && !item.preview_url ? (
- <video className="pf-settings-thumb" src={cover} muted />
- ) : (
- <img className="pf-settings-thumb" src={cover} alt="" />
- )
- ) : (
- <span className="pf-settings-thumb is-empty" aria-hidden />
- )}
- <span className="pf-settings-list-main">
- <strong>{tool?.title || item.tool_id}</strong>
- <em className="pf-muted">
- {STATUS_CN[item.status] || item.status}
- {item.prompt ? ` · ${item.prompt.slice(0, 36)}` : ''}
- </em>
- </span>
- </button>
- <span className="pf-settings-tool-actions">
- <span className="pf-settings-list-meta pf-muted">{formatWhen(item.created_at)}</span>
- <button
- type="button"
- className="pf-btn pf-btn-ghost pf-btn-sm"
- onClick={() => void openDetail(item)}
- >
- <Eye size={14} aria-hidden />
- 查看
- </button>
- <button
- type="button"
- className="pf-btn pf-btn-ghost pf-btn-sm"
- disabled={!canDownload || downloading === resolveToolMediaUrl(firstUrl)}
- onClick={() => void downloadUrl(item, firstUrl)}
- >
- <Download size={14} aria-hidden />
- {downloading === resolveToolMediaUrl(firstUrl) ? '下载中…' : '下载'}
- </button>
- </span>
- </div>
- </li>
- )
- })}
- </ul>
- ) : null}
- <Pagination
- page={page}
- pageCount={pageCount}
- total={total}
- pageSize={pageSize}
- onPageSizeChange={(size) => {
- setPageSize(size)
- setPage(1)
- }}
- onChange={setPage}
- ariaLabel="工具创作分页"
- />
-
- <Modal
- open={Boolean(detail)}
- onClose={() => setDetail(null)}
- title={detail ? getToolDef(detail.tool_id)?.title || '创作详情' : '创作详情'}
- size="lg"
- className="pf-tool-run-modal"
- footer={
- detail ? (
- <div className="pf-tool-run-foot">
- <Link className="pf-btn pf-btn-ghost pf-btn-sm" to={`/tools/${detail.tool_id}`} onClick={() => setDetail(null)}>
- 再创作
- </Link>
- {detail.urls[0] || detail.preview_url ? (
- <button
- type="button"
- className="pf-btn pf-btn-lime pf-btn-sm"
- disabled={
- detail.status !== 'succeeded' ||
- downloading === resolveToolMediaUrl(detail.urls[0] || detail.preview_url || '')
- }
- onClick={() => void downloadUrl(detail, detail.urls[0] || detail.preview_url || '')}
- >
- <Download size={14} aria-hidden />
- 下载结果
- </button>
- ) : null}
- </div>
- ) : null
- }
- >
- {detailLoading && !detail?.urls.length ? <p className="pf-muted">加载中…</p> : null}
- {detail ? (
- <div className="pf-tool-run-detail">
- <div className="pf-tool-run-media">
- {detail.urls.length || detail.preview_url ? (
- detail.kind === 'audio' ? <audio src={resolveToolMediaUrl(detail.urls[0])} controls /> : isVideoRecord(detail) && (detail.urls[0] || '').match(/\.mp4/i) ? (
- <video src={resolveToolMediaUrl(detail.urls[0])} controls playsInline />
- ) : (
- <img
- src={resolveToolMediaUrl(detail.urls[0] || detail.preview_url)}
- alt="生成结果"
- />
- )
- ) : (
- <p className="pf-muted">
- {STATUS_CN[detail.status] || detail.status}
- {detail.error ? ` · ${detail.error}` : ' · 结果尚未就绪'}
- </p>
- )}
- </div>
- <dl className="pf-tool-run-meta">
- <div>
- <dt>状态</dt>
- <dd>{STATUS_CN[detail.status] || detail.status}</dd>
- </div>
- <div>
- <dt>时间</dt>
- <dd>{formatWhen(detail.created_at)}</dd>
- </div>
- {detail.prompt ? (
- <div className="is-block">
- <dt>提示词</dt>
- <dd>{detail.prompt}</dd>
- </div>
- ) : null}
- {detail.params?.ratio ? (
- <div>
- <dt>画幅</dt>
- <dd>{detail.params.ratio}</dd>
- </div>
- ) : null}
- {detail.params?.mode ? (
- <div>
- <dt>输出类型</dt>
- <dd>{detail.params.mode}</dd>
- </div>
- ) : null}
- {detail.params?.pack ? (
- <div>
- <dt>工具包</dt>
- <dd>{detail.params.pack}</dd>
- </div>
- ) : null}
- {detail.error ? (
- <div className="is-block">
- <dt>错误</dt>
- <dd className="pf-error">{detail.error}</dd>
- </div>
- ) : null}
- </dl>
- {detail.urls.length > 1 ? (
- <div className="pf-tool-run-files">
- {detail.urls.map((url, idx) => (
- <button
- key={url}
- type="button"
- className="pf-btn pf-btn-ghost pf-btn-sm"
- disabled={downloading === resolveToolMediaUrl(url)}
- onClick={() => void downloadUrl(detail, url)}
- >
- <Download size={14} aria-hidden />
- 下载文件 {idx + 1}
- </button>
- ))}
- </div>
- ) : null}
- </div>
- ) : null}
- </Modal>
- </section>
- )
-}
diff --git a/frontend/src/pages/ToolDetailPage.tsx b/frontend/src/pages/ToolDetailPage.tsx
deleted file mode 100644
index f76768a..0000000
--- a/frontend/src/pages/ToolDetailPage.tsx
+++ /dev/null
@@ -1,367 +0,0 @@
-import { useEffect, useMemo, useRef, useState } from 'react'
-import type { ChangeEvent, DragEvent, FormEvent } from 'react'
-import { Link, Navigate, useNavigate, useParams } from 'react-router-dom'
-import { ArrowLeft, Download, Loader2 } from 'lucide-react'
-import BillingErrorNotice from '../components/billing/BillingErrorNotice'
-import AppShell from '../components/layout/AppShell'
-import Button from '../components/ui/Button'
-import { pollStudioToolTask, resolveToolMediaUrl, runStudioTool } from '../api/tools'
-import { defaultToolChips, getToolDef, localizeToolDef, chipDisplayLabel, type ToolDef } from '../lib/toolsCatalog'
-import { useI18n } from '../i18n'
-
-const VIDEO_POLL_MS = 3000
-
-/** 独立工具工作台:表单生成、结果预览、视频任务轮询 */
-export default function ToolDetailPage() {
- const { toolId } = useParams()
- const tool = useMemo(() => getToolDef(toolId), [toolId])
-
- if (!tool) return <Navigate to="/tools" replace />
- if (!localStorage.getItem('token')) {
- return <Navigate to={`/auth?next=/tools/${tool.id}`} replace />
- }
-
- return <ToolWorkspace tool={tool} />
-}
-
-/** 已登录后的工具表单与结果区 */
-function ToolWorkspace({ tool: baseTool }: { tool: ToolDef }) {
- const { t, m } = useI18n()
- const tool = useMemo(() => localizeToolDef(baseTool, m), [baseTool, m])
- /*
- * text 文本框
- * chips 画幅/时长等选项
- * files 待上传文件
- * previews 本地预览 URL
- * busy 生成中
- * error 错误文案
- * resultUrls 结果媒体
- * previewUrl 视频静帧预览
- * taskId 视频任务
- * status 任务状态
- */
- const [text, setText] = useState<Record<string, string>>({})
- const [chips, setChips] = useState(() => defaultToolChips(tool))
- const [files, setFiles] = useState<File[]>([])
- const [previews, setPreviews] = useState<string[]>([])
- const [busy, setBusy] = useState(false)
- const [error, setError] = useState('')
- const [resultUrls, setResultUrls] = useState<string[]>([])
- const [previewUrl, setPreviewUrl] = useState('')
- const [taskId, setTaskId] = useState('')
- const [status, setStatus] = useState('')
- const fileRef = useRef<HTMLInputElement>(null)
- const nav = useNavigate()
- const Icon = tool.icon
-
- useEffect(() => {
- setText({})
- setChips(defaultToolChips(tool))
- setFiles([])
- setPreviews([])
- setBusy(false)
- setError('')
- setResultUrls([])
- setPreviewUrl('')
- setTaskId('')
- setStatus('')
- }, [tool.id])
-
- useEffect(() => {
- return () => {
- for (const url of previews) URL.revokeObjectURL(url)
- }
- }, [previews])
-
- useEffect(() => {
- if (!taskId || (status !== 'queued' && status !== 'running')) return
- let cancelled = false
- const tick = async () => {
- try {
- const data = await pollStudioToolTask(taskId)
- if (cancelled) return
- setStatus(data.status)
- if (data.status === 'succeeded' && data.urls.length) {
- setResultUrls(data.urls)
- setBusy(false)
- } else if (data.status === 'failed') {
- setError(data.error || t('tools.errors.videoFailed'))
- setBusy(false)
- }
- } catch (err) {
- if (cancelled) return
- setError(err instanceof Error ? err.message : t('tools.errors.pollFailed'))
- setBusy(false)
- }
- }
- const timer = window.setInterval(() => void tick(), VIDEO_POLL_MS)
- void tick()
- return () => {
- cancelled = true
- window.clearInterval(timer)
- }
- }, [taskId, status])
-
- // 替换上传文件并刷新本地预览
- function applyFiles(next: File[]) {
- setPreviews((prev) => {
- for (const url of prev) URL.revokeObjectURL(url)
- return next.map((file) => URL.createObjectURL(file))
- })
- setFiles(next)
- }
-
- // 选择本地文件并生成缩略预览
- function onPick(event: ChangeEvent<HTMLInputElement>) {
- const list = Array.from(event.target.files || [])
- event.target.value = ''
- if (!list.length) return
- applyFiles(list)
- }
-
- // 拖拽上传
- function onDrop(event: DragEvent<HTMLDivElement>) {
- event.preventDefault()
- const list = Array.from(event.dataTransfer.files || [])
- if (!list.length) return
- applyFiles(list)
- }
-
- // 提交生成;视频任务进入轮询
- async function onSubmit(event: FormEvent) {
- event.preventDefault()
- if (busy) return
- const prompt = (text.prompt || text.script || '').trim()
- if (tool.id === 't2i' && prompt.length < 4) {
- setError(t('tools.errors.fillPrompt'))
- return
- }
- if ((tool.id === 'i2i' || tool.id === 'i2p') && !files.length) {
- setError(t('tools.errors.uploadRef'))
- return
- }
- if (tool.id === 't2v' && prompt.length < 4) {
- setError(t('tools.errors.fillScript'))
- return
- }
- if (tool.id === 'v2v' && !files.length) {
- setError(t('tools.errors.uploadSource'))
- return
- }
- if (tool.id === 'ecom' && chips.pack === '卖点海报' && !files.length) {
- setError(t('tools.errors.uploadProduct'))
- return
- }
- if (tool.id === 'ecom' && chips.pack !== '卖点海报' && files.length < 2) {
- setError(t('tools.errors.uploadTwoImages'))
- return
- }
- setError('')
- setResultUrls([])
- setPreviewUrl('')
- setTaskId('')
- setStatus('')
- setBusy(true)
- try {
- const data = await runStudioTool({
- toolId: tool.id,
- prompt,
- negative: (text.negative || '').trim(),
- ratio: chips.ratio,
- strength: chips.strength,
- mode: chips.mode,
- pack: chips.pack,
- duration: chips.duration,
- motion: chips.motion,
- files,
- })
- setStatus(data.status)
- if (data.preview_url) setPreviewUrl(data.preview_url)
- if (data.urls.length) {
- setResultUrls(data.urls)
- setBusy(false)
- return
- }
- if (data.task_id) {
- setTaskId(data.task_id)
- setStatus(data.status || 'queued')
- return
- }
- setBusy(false)
- } catch (err) {
- const message = err instanceof Error ? err.message : t('tools.errors.generateFailed')
- if (message === t('tools.errors.notLoggedIn') || message === '未登录') {
- nav(`/auth?next=/tools/${tool.id}`, { replace: true })
- return
- }
- setError(message)
- setBusy(false)
- }
- }
-
- const uploadField = tool.fields.find((field) => field.kind === 'upload')
- const hasMedia = resultUrls.length > 0 || Boolean(previewUrl)
- const waitingVideo = busy && Boolean(taskId)
-
- return (
- <AppShell active="tools">
- <div className="pf-tool-detail">
- <Link to="/tools" className="pf-tool-back">
- <ArrowLeft size={16} strokeWidth={2} aria-hidden />
- {t('tools.allTools')}
- </Link>
- <header className="pf-tool-detail-head">
- <span className="pf-ws-tool-icon" aria-hidden>
- <Icon size={22} strokeWidth={1.6} />
- </span>
- <div>
- <h1>{tool.title}</h1>
- <p className="pf-muted">{tool.desc}</p>
- </div>
- </header>
-
- <div className="pf-tool-workspace">
- <form className="pf-tool-panel" onSubmit={onSubmit}>
- <p className="pf-muted pf-tool-panel-hint">{tool.panelHint}</p>
- {tool.fields.map((field) => (
- <label key={field.key} className="pf-tool-field">
- <span>{field.label}</span>
- {field.kind === 'textarea' ? (
- <textarea
- rows={4}
- placeholder={field.placeholder || t('tools.inputPlaceholder', { label: field.label })}
- value={text[field.key] || ''}
- onChange={(e) => setText((prev) => ({ ...prev, [field.key]: e.target.value }))}
- />
- ) : null}
- {field.kind === 'upload' ? (
- <div
- className="pf-tool-upload"
- onClick={() => fileRef.current?.click()}
- onDragOver={(e) => e.preventDefault()}
- onDrop={onDrop}
- role="button"
- tabIndex={0}
- onKeyDown={(e) => {
- if (e.key === 'Enter' || e.key === ' ') fileRef.current?.click()
- }}
- >
- {files.length ? (
- <span>
- {t('tools.filesSelected', { count: files.length })}
- {files[0] ? ` · ${files[0].name}` : ''}
- </span>
- ) : (
- t('tools.uploadHint')
- )}
- {previews.length ? (
- <div className="pf-tool-upload-thumbs">
- {previews.map((url, idx) =>
- files[idx]?.type.startsWith('video/') ? (
- <video key={url} src={url} muted />
- ) : (
- <img key={url} src={url} alt="" />
- ),
- )}
- </div>
- ) : null}
- </div>
- ) : null}
- {field.kind === 'chips' && field.options ? (
- <div className="pf-tool-chips">
- {field.options.map((opt) => (
- <button
- key={opt}
- type="button"
- className={chips[field.key] === opt ? 'active' : ''}
- onClick={() => setChips((prev) => ({ ...prev, [field.key]: opt }))}
- >
- {chipDisplayLabel(opt, m)}
- </button>
- ))}
- </div>
- ) : null}
- </label>
- ))}
- {uploadField ? (
- <input
- ref={fileRef}
- type="file"
- hidden
- accept={uploadField.accept}
- multiple={Boolean(uploadField.multiple)}
- onChange={onPick}
- />
- ) : null}
- {error ? <BillingErrorNotice message={error} className="pf-tool-error" /> : null}
- <Button type="submit" variant="lime" block disabled={busy}>
- {busy ? (
- <>
- <Loader2 size={16} className="pf-tool-spin" aria-hidden />
- {waitingVideo ? t('tools.generatingVideo') : t('tools.generating')}
- </>
- ) : (
- tool.cta
- )}
- </Button>
- </form>
-
- <section
- className={`pf-tool-result${hasMedia ? ' has-media' : ''}`}
- aria-label={t('tools.resultArea')}
- >
- {!hasMedia && !busy ? (
- <div className="pf-tool-result-empty">
- <p>{t('tools.resultEmpty')}</p>
- <span className="pf-muted">{t('tools.resultEmptyHint')}</span>
- </div>
- ) : null}
- {busy && !hasMedia ? (
- <div className="pf-tool-result-empty">
- <Loader2 size={28} className="pf-tool-spin" aria-hidden />
- <p>{waitingVideo ? t('tools.generatingVideoShort') : t('tools.generatingShort')}</p>
- <span className="pf-muted">
- {waitingVideo ? t('tools.videoWaitHint') : t('tools.imageWaitHint')}
- </span>
- </div>
- ) : null}
- {previewUrl && !resultUrls.length ? (
- <img src={resolveToolMediaUrl(previewUrl)} alt={t('tools.previewAlt')} />
- ) : null}
- {resultUrls.map((url) => {
- const abs = resolveToolMediaUrl(url)
- const isVideo = tool.id === 't2v' || tool.id === 'v2v' || /\.mp4($|\?)/i.test(url)
- if (isVideo) {
- return (
- <div key={url} className="pf-tool-result-item">
- <video src={abs} controls playsInline />
- <a className="pf-tool-download" href={abs} download>
- <Download size={14} aria-hidden />
- {t('tools.downloadVideo')}
- </a>
- </div>
- )
- }
- return (
- <div key={url} className="pf-tool-result-item">
- <img src={abs} alt={t('tools.resultAlt')} />
- <a className="pf-tool-download" href={abs} download>
- <Download size={14} aria-hidden />
- {t('tools.downloadImage')}
- </a>
- </div>
- )
- })}
- {resultUrls.length ? (
- <p className="pf-muted pf-tool-saved">
- {t('tools.savedPrefix')}{' '}
- <Link to="/settings?tab=tools">{t('tools.savedLink')}</Link>
- {m.tools.savedSuffix ? ` ${t('tools.savedSuffix')}` : null}
- </p>
- ) : null}
- </section>
- </div>
- </div>
- </AppShell>
- )
-}
diff --git a/frontend/src/pages/ToolsPage.tsx b/frontend/src/pages/ToolsPage.tsx
deleted file mode 100644
index 0ce91f6..0000000
--- a/frontend/src/pages/ToolsPage.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import { Link } from 'react-router-dom'
-import { ArrowRight } from 'lucide-react'
-import AppShell from '../components/layout/AppShell'
-import ComingSoon from '../components/ui/ComingSoon'
-import { useI18n } from '../i18n'
-import { PRODUCT_ICONS, localizeToolDefs } from '../lib/toolsCatalog'
-
-export default function ToolsPage() {
- const { t, m } = useI18n()
- const DramaIcon = PRODUCT_ICONS.drama
- const KepuIcon = PRODUCT_ICONS.kepu
- const tools = localizeToolDefs(m)
-
- return (
- <AppShell active="tools">
- <div className="pf-page-head">
- <div>
- <h1>{t('tools.title')}</h1>
- <p className="pf-muted">{t('tools.lead')}</p>
- </div>
- </div>
- <div className="pf-tools-grid pf-tools-grid-lg">
- {tools.map((tool) => {
- const Icon = tool.icon
- return (
- <Link
- key={tool.id}
- to={`/tools/${tool.id}`}
- className={`pf-tools-card pf-tools-card-lg${tool.soon ? ' is-soon' : ''}`}
- >
- <div className="pf-tools-card-top">
- <span className="pf-ws-tool-icon" aria-hidden>
- <Icon size={22} strokeWidth={1.6} />
- </span>
- <span className="pf-tools-arrow" aria-hidden>
- <ArrowRight size={14} strokeWidth={2} />
- </span>
- </div>
- <h3>
- {tool.title}
- {tool.soon ? <ComingSoon /> : null}
- </h3>
- <p>{tool.desc}</p>
- </Link>
- )
- })}
- </div>
- <section className="pf-ws-products" style={{ marginTop: '2.5rem' }}>
- <Link to="/drama" className="pf-ws-product pf-ws-product-drama">
- <span className="pf-ws-product-icon" aria-hidden>
- <DramaIcon size={26} strokeWidth={1.6} />
- </span>
- <span className="pf-ws-product-body">
- <strong>{t('tools.goDrama')}</strong>
- <span>{t('tools.goDramaHint')}</span>
- </span>
- <span className="pf-ws-product-go" aria-hidden>
- <ArrowRight size={16} strokeWidth={2} />
- </span>
- </Link>
- <Link to="/history" className="pf-ws-product pf-ws-product-kepu">
- <span className="pf-ws-product-icon" aria-hidden>
- <KepuIcon size={26} strokeWidth={1.6} />
- </span>
- <span className="pf-ws-product-body">
- <strong>{t('tools.goKepu')}</strong>
- <span>{t('tools.goKepuHint')}</span>
- </span>
- <span className="pf-ws-product-go" aria-hidden>
- <ArrowRight size={16} strokeWidth={2} />
- </span>
- </Link>
- </section>
- </AppShell>
- )
-}
diff --git a/frontend/src/styles/printfilm.css b/frontend/src/styles/printfilm.css
index c9d2de4..8ce2518 100644
--- a/frontend/src/styles/printfilm.css
+++ b/frontend/src/styles/printfilm.css
@@ -709,7 +709,6 @@
}
.pf-land-caps,
-.pf-land-tools,
.pf-land-who {
margin: 0 0 3rem;
}
@@ -748,50 +747,6 @@
line-height: 1.55;
}
-.pf-land-tool-grid {
- display: grid;
- grid-template-columns: repeat(6, minmax(0, 1fr));
- gap: 0.75rem;
-}
-
-.pf-land-tool-card {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- gap: 0.4rem;
- min-height: 148px;
- padding: 1rem 0.95rem;
- background: #fff;
- border: 1px solid var(--pf-line);
- border-radius: 16px;
- text-decoration: none;
- color: inherit;
-}
-
-.pf-land-tool-card:hover {
- box-shadow: var(--pf-shadow);
-}
-
-.pf-land-tool-icon {
- width: 34px;
- height: 34px;
- border-radius: 10px;
- background: var(--pf-lime-soft);
- display: grid;
- place-items: center;
- color: var(--pf-ink);
-}
-
-.pf-land-tool-card strong {
- font-size: 0.92rem;
-}
-
-.pf-land-tool-card > span:not(.pf-land-tool-icon):not(.pf-coming) {
- color: var(--pf-muted);
- font-size: 0.76rem;
- line-height: 1.4;
-}
-
.pf-land-close {
display: flex;
align-items: center;
@@ -1329,32 +1284,6 @@
font-weight: 700;
}
-.pf-tools-grid-lg {
- grid-template-columns: repeat(3, minmax(0, 1fr));
-}
-
-.pf-tools-card-lg {
- min-height: 180px;
- padding: 1.35rem;
-}
-
-.pf-tools-card-top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 0.35rem;
-}
-
-.pf-tools-arrow {
- width: 32px;
- height: 32px;
- border-radius: 999px;
- border: 1px solid var(--pf-line);
- display: grid;
- place-items: center;
- color: var(--pf-muted);
-}
-
.pf-board-settings .pf-board-field {
display: flex;
flex-direction: column;
@@ -1829,225 +1758,6 @@
color: var(--pf-muted);
}
-.pf-tool-detail {
- max-width: 1100px;
-}
-
-.pf-tool-back {
- display: inline-flex;
- align-items: center;
- gap: 0.35rem;
- font-size: 0.9rem;
- color: var(--pf-muted);
- text-decoration: none;
- margin-bottom: 1rem;
-}
-
-.pf-tool-back:hover {
- color: var(--pf-ink);
-}
-
-.pf-tool-detail-head {
- display: flex;
- align-items: flex-start;
- gap: 0.85rem;
- margin-bottom: 1.25rem;
-}
-
-.pf-tool-detail-head h1 {
- margin: 0;
- font-size: 1.55rem;
- display: flex;
- align-items: center;
- gap: 0.45rem;
-}
-
-.pf-tool-detail-head p {
- margin: 0.25rem 0 0;
-}
-
-.pf-tool-workspace {
- display: grid;
- grid-template-columns: minmax(280px, 360px) 1fr;
- gap: 1.15rem;
- align-items: start;
-}
-
-.pf-tool-panel,
-.pf-tool-result {
- background: #fff;
- border: 1px solid var(--pf-line);
- border-radius: 16px;
- box-shadow: var(--pf-shadow);
-}
-
-.pf-tool-panel {
- padding: 1.15rem;
- display: flex;
- flex-direction: column;
- gap: 0.9rem;
-}
-
-.pf-tool-panel-hint {
- margin: 0;
- font-size: 0.85rem;
-}
-
-.pf-tool-field {
- display: flex;
- flex-direction: column;
- gap: 0.4rem;
- font-size: 0.9rem;
-}
-
-.pf-tool-field textarea {
- border: 1px solid var(--pf-line);
- border-radius: 12px;
- padding: 0.65rem 0.75rem;
- font: inherit;
- resize: vertical;
- background: var(--pf-bg);
-}
-
-.pf-tool-upload {
- border: 1px dashed rgba(17, 19, 24, 0.22);
- border-radius: 12px;
- padding: 1.5rem 1rem;
- text-align: center;
- color: var(--pf-muted);
- background: var(--pf-bg);
- font-size: 0.9rem;
- cursor: pointer;
-}
-
-.pf-tool-upload-thumbs {
- display: flex;
- flex-wrap: wrap;
- gap: 0.4rem;
- justify-content: center;
- margin-top: 0.75rem;
-}
-
-.pf-tool-upload-thumbs img,
-.pf-tool-upload-thumbs video {
- width: 64px;
- height: 64px;
- object-fit: cover;
- border-radius: 8px;
-}
-
-.pf-tool-error {
- margin: 0;
- color: #b42318;
- font-size: 0.85rem;
-}
-
-.pf-tool-spin {
- animation: pf-tool-spin 0.8s linear infinite;
-}
-
-@keyframes pf-tool-spin {
- to {
- transform: rotate(360deg);
- }
-}
-
-.pf-tool-chips {
- display: flex;
- flex-wrap: wrap;
- gap: 0.4rem;
-}
-
-.pf-tool-chips button {
- border: 1px solid var(--pf-line);
- background: #fff;
- border-radius: 999px;
- padding: 0.35rem 0.75rem;
- font: inherit;
- font-size: 0.85rem;
- cursor: pointer;
- color: var(--pf-muted);
-}
-
-.pf-tool-chips button.active {
- background: var(--pf-lime-soft);
- color: var(--pf-ink);
- border-color: transparent;
- font-weight: 600;
-}
-
-.pf-tool-chips button:disabled,
-.pf-tool-field textarea:disabled {
- opacity: 0.7;
- cursor: not-allowed;
-}
-
-.pf-tool-result {
- min-height: 420px;
- display: grid;
- place-items: center;
- padding: 1.5rem;
-}
-
-.pf-tool-result.has-media {
- display: flex;
- flex-direction: column;
- align-items: stretch;
- justify-content: flex-start;
- gap: 0.85rem;
- place-items: unset;
-}
-
-.pf-tool-result img,
-.pf-tool-result video {
- width: 100%;
- max-height: 560px;
- object-fit: contain;
- border-radius: 12px;
- background: #111;
-}
-
-.pf-tool-result-item {
- display: flex;
- flex-direction: column;
- gap: 0.55rem;
-}
-
-.pf-tool-download {
- display: inline-flex;
- align-items: center;
- gap: 0.3rem;
- align-self: flex-start;
- font-size: 0.85rem;
- color: var(--pf-ink);
- text-decoration: none;
-}
-
-.pf-tool-download:hover {
- text-decoration: underline;
-}
-
-.pf-tool-saved {
- margin: 0;
- font-size: 0.85rem;
-}
-
-.pf-tool-saved a {
- text-decoration: underline;
-}
-
-.pf-tool-result-empty {
- text-align: center;
- display: grid;
- justify-items: center;
- gap: 0.35rem;
-}
-
-.pf-tool-result-empty p {
- margin: 0 0 0.35rem;
- font-weight: 650;
-}
-
.pf-help-page {
max-width: 880px;
margin: 0 auto;
@@ -2389,50 +2099,6 @@
color: #3f4d12;
}
-.pf-tools-grid {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 1rem;
-}
-
-.pf-tools-card {
- background: #fff;
- border: 1px solid var(--pf-line);
- border-radius: 18px;
- padding: 1.25rem;
- display: flex;
- flex-direction: column;
- gap: 0.65rem;
- box-shadow: var(--pf-shadow);
- text-decoration: none;
- color: inherit;
- transition: border-color 0.15s ease;
-}
-
-.pf-tools-card:hover {
- border-color: rgba(17, 19, 24, 0.2);
-}
-
-.pf-tools-card h3 {
- margin: 0;
- font-size: 1.1rem;
- display: flex;
- align-items: center;
- gap: 0.5rem;
- flex-wrap: wrap;
-}
-
-.pf-tools-card p {
- margin: 0;
- color: var(--pf-muted);
- font-size: 0.9rem;
- flex: 1;
-}
-
-.pf-tools-card.is-soon {
- opacity: 0.85;
-}
-
.pf-icon-btn {
position: relative;
width: 36px;
@@ -6745,13 +6411,11 @@ button.pf-shot-editable:disabled {
.pf-stats,
.pf-home-steps,
.pf-outline-grid,
- .pf-style-grid,
- .pf-tools-grid {
+ .pf-style-grid {
grid-template-columns: 1fr 1fr;
}
- .pf-ws-tool-grid,
- .pf-land-tool-grid {
+ .pf-ws-tool-grid {
grid-template-columns: repeat(3, 1fr);
}
@@ -6849,13 +6513,11 @@ button.pf-shot-editable:disabled {
.pf-land-products,
.pf-land-pipeline-list,
.pf-land-who-grid,
- .pf-land-cap-grid,
- .pf-tools-grid {
+ .pf-land-cap-grid {
grid-template-columns: 1fr;
}
- .pf-ws-tool-grid,
- .pf-land-tool-grid {
+ .pf-ws-tool-grid {
grid-template-columns: repeat(2, 1fr);
}
@@ -6887,11 +6549,7 @@ button.pf-shot-editable:disabled {
position: static;
}
- .pf-tools-grid-lg {
- grid-template-columns: 1fr;
- }
- .pf-tool-workspace,
.pf-create-choice {
grid-template-columns: 1fr;
}
diff --git a/frontend/tests/site-navigation.test.mjs b/frontend/tests/site-navigation.test.mjs
index f749f01..eed3eb4 100644
--- a/frontend/tests/site-navigation.test.mjs
+++ b/frontend/tests/site-navigation.test.mjs
@@ -1,9 +1,9 @@
import assert from 'node:assert/strict'
import test from 'node:test'
-import { CREATION_NAV, RESOURCE_NAV, resolveNavActive } from '../src/lib/siteNavigation.ts'
+import { HOME_NAV, CREATION_NAV, RESOURCE_NAV, PERSONAL_NAV, resolveNavActive } from '../src/lib/siteNavigation.ts'
test('自由画布是独立主导航入口,所有入口路径唯一', () => {
- const entries = [...CREATION_NAV, ...RESOURCE_NAV]
+ const entries = [HOME_NAV, ...CREATION_NAV, ...RESOURCE_NAV, ...PERSONAL_NAV]
assert.equal(CREATION_NAV.find((item) => item.key === 'canvas')?.path, '/canvas')
assert.equal(new Set(entries.map((item) => item.path)).size, entries.length)
assert.equal(resolveNavActive('/canvas'), 'canvas')
@@ -15,8 +15,19 @@ test('资产、团队和旧短视频地址高亮对应入口,不被漫剧前
['/drama/assets', 'assets'], ['/drama/projects/422', 'drama'],
['/teams/12', 'team'], ['/team-invitations', 'team'],
['/studio/3/style', 'kepu'], ['/templates', 'kepu'], ['/history', 'kepu'],
- ['/tools/t2i', 'tools'], ['/settings', 'settings'], ['/help', 'help'],
+ ['/tools/video', 'video'], ['/tools/image', 'image'], ['/tools/audio', 'audio'],
+ ['/settings', 'settings'], ['/help', 'help'],
]) assert.equal(resolveNavActive(path), expected)
assert.equal(resolveNavActive('/studio/3', 'studio'), 'kepu')
assert.equal(resolveNavActive('/drama', 'canvas'), 'canvas')
})
+
+test('公开顶栏只展示核心产品,个人入口归入头像菜单', () => {
+ assert.deepEqual(HOME_NAV, { key: 'home', path: '/', label: 'nav.home' })
+ assert.deepEqual(CREATION_NAV.map((item) => item.key), ['drama', 'canvas', 'kepu'])
+ assert.deepEqual(RESOURCE_NAV.map((item) => item.key), ['pricing'])
+ assert.deepEqual(PERSONAL_NAV.map((item) => item.key), ['tasks', 'assets'])
+ assert.equal(resolveNavActive('/tools'), undefined)
+ assert.equal(resolveNavActive('/tools/t2i'), undefined)
+ assert.equal(resolveNavActive('/'), 'home')
+})