mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-07 13:56:37 +08:00
c094818594
## 色彩体系重构 - tailwind.config.js: sand/ink 全新色阶 + shadow 阴影预设 - index.css: 全组件系统重写 (card/input/btn/badge/table) ## 核心页面重写 - LoginPage: 纯白卡片 + 品牌光晕 + Framer Motion 入场动画 - HomePage: Billboard 推荐位 + 剧集卡片联动媒体库 - Layout: 白色侧边栏 + 路由过渡动画 - MediaCard: 新增 linkTo prop, 悬停浮层优化 ## 剧集合并显示 - LibraryPage: 使用 groupSeries 合并剧集, 分季选集详情 - 首页剧集卡片自动链接到媒体库详情 ## 全量类名迁移 (43 文件) - text-slate-* -> text-ink-*/text-sand-* - text-primary-* -> text-brand-* - text-white -> text-ink-600 - bg/border-slate-* -> bg/border-sand-* - 500+ 深色硬编码类名清零
56 lines
1.8 KiB
TypeScript
56 lines
1.8 KiB
TypeScript
import { useEffect, useState } from 'react'
|
|
import { useParams } from 'react-router-dom'
|
|
import { X } from 'lucide-react'
|
|
import toast from 'react-hot-toast'
|
|
|
|
import { playbackAPI, type PlaylistDetail } from '../api/playback'
|
|
import { MediaCard } from '../components/MediaCard'
|
|
|
|
export function PlaylistDetailPage() {
|
|
const { id = '' } = useParams()
|
|
const [detail, setDetail] = useState<PlaylistDetail | null>(null)
|
|
|
|
const refresh = () =>
|
|
playbackAPI.getPlaylist(id).then(setDetail).catch(() => setDetail(null))
|
|
|
|
useEffect(() => {
|
|
refresh()
|
|
}, [id])
|
|
|
|
if (!detail) {
|
|
return <p className="text-sand-500">加载中…</p>
|
|
}
|
|
|
|
return (
|
|
<div className="space-y-6">
|
|
<header>
|
|
<h1 className="font-display text-3xl font-bold text-ink-600">{detail.playlist.name}</h1>
|
|
<p className="text-sm text-ink-50">{detail.items.length} 部影片</p>
|
|
</header>
|
|
|
|
{detail.items.length === 0 && (
|
|
<p className="text-ink-50">暂无内容,前往媒体详情页通过「加入播放列表」添加。</p>
|
|
)}
|
|
|
|
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6">
|
|
{detail.items.map((m) => (
|
|
<div key={m.id} className="relative">
|
|
<MediaCard media={m} />
|
|
<button
|
|
className="absolute right-2 top-2 rounded-full bg-black/70 p-1 text-ink-600 transition hover:bg-red-600"
|
|
onClick={async () => {
|
|
await playbackAPI.removeFromPlaylist(detail.playlist.id, m.id)
|
|
toast.success('已移除')
|
|
await refresh()
|
|
}}
|
|
title="从播放列表移除"
|
|
>
|
|
<X size={14} />
|
|
</button>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|