一分钟搭建影视站,支持Docker等部署方式
feat(brand): 统一图标为 icon-512,播放器品牌占位图,首页品牌化标题
bestZweie97975cbb56b
diff --git a/public/favicon.svg b/public/favicon.svgdeleted file mode 100644index 6bf63e1..0000000--- a/public/favicon.svg+++ /dev/null@@ -1,4 +0,0 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">- <rect width="64" height="64" rx="14" fill="#111111"/>- <path d="M22 18v28h20" fill="none" stroke="#23ade5" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/>-</svg>diff --git a/public/icons/icon-512.png b/public/icons/icon-512.pngnew file mode 100644index 0000000..feaca51Binary files /dev/null and b/public/icons/icon-512.png differdiff --git a/public/player-poster.png b/public/player-poster.pngnew file mode 100644index 0000000..946d083Binary files /dev/null and b/public/player-poster.png differdiff --git a/src/app/globals.css b/src/app/globals.cssindex eb0e952..9ba6ee5 100644--- a/src/app/globals.css+++ b/src/app/globals.css@@ -87,3 +87,12 @@ body {border-color: rgb(var(--c-accent)) !important;color: #fff;}++/* 品牌渐变字(沿用旧版 LibreTV 的霓虹蓝→霓虹粉) */+.brand-gradient {+ background: linear-gradient(to right, #00ccff, #ff3c78);+ -webkit-background-clip: text;+ background-clip: text;+ -webkit-text-fill-color: transparent;+ color: transparent;+}diff --git a/src/app/layout.tsx b/src/app/layout.tsxindex 673c1d4..5180820 100644--- a/src/app/layout.tsx+++ b/src/app/layout.tsx@@ -11,7 +11,8 @@ export const metadata: Metadata = {'LibreTV 是一个免费的在线视频搜索平台,无广告、安全,提供来自多个视频源的内容搜索与观看服务,无需注册即可使用。',manifest: '/manifest.webmanifest',icons: {- icon: '/favicon.svg',+ icon: '/icons/icon-512.png',+ apple: '/icons/icon-512.png',},};diff --git a/src/app/manifest.ts b/src/app/manifest.tsindex 762f512..114a3d9 100644--- a/src/app/manifest.ts+++ b/src/app/manifest.ts@@ -11,9 +11,9 @@ export default function manifest(): MetadataRoute.Manifest {theme_color: '#111111',icons: [{- src: '/favicon.svg',- sizes: 'any',- type: 'image/svg+xml',+ src: '/icons/icon-512.png',+ sizes: '512x512',+ type: 'image/png',purpose: 'any',},],diff --git a/src/app/page.tsx b/src/app/page.tsxindex 017ba6d..3c0a600 100644--- a/src/app/page.tsx+++ b/src/app/page.tsx@@ -113,8 +113,7 @@ function HomeContent() {<section className={cn('flex flex-col items-center', urlQuery ? 'mb-6' : 'mt-10 mb-14')}>{!urlQuery && (<header className="text-center mb-6">- <h1 className="text-2xl sm:text-3xl font-bold text-content">免费在线视频搜索</h1>- <p className="mt-2 text-sm text-faint">多源聚合 · 免注册 · 无广告 · 播放进度本机保存</p>+ <h1 className="text-4xl sm:text-5xl font-bold brand-gradient">LibreTV</h1></header>)}{urlQuery && <h1 className="sr-only">LibreTV 视频搜索</h1>}diff --git a/src/components/header.tsx b/src/components/header.tsxindex f654093..bae8704 100644--- a/src/components/header.tsx+++ b/src/components/header.tsx@@ -20,8 +20,9 @@ export function Header({ showSearch = false }: { showSearch?: boolean }) {<><header className="sticky top-0 z-40 bg-surface/90 backdrop-blur border-b border-line"><div className="max-w-6xl mx-auto px-4 h-14 flex items-center gap-3">- <Link href="/" className="flex items-center gap-2 shrink-0">- <span className="text-lg font-bold text-accent">LibreTV</span>+ <Link href="/" aria-label="LibreTV 首页" className="flex items-center shrink-0">+ {/* eslint-disable-next-line @next/next/no-img-element */}+ <img src="/icons/icon-512.png" alt="LibreTV" className="w-7 h-7 rounded-lg" /></Link>{showSearch && (diff --git a/src/components/player-shell.tsx b/src/components/player-shell.tsxindex d0c444c..171f978 100644--- a/src/components/player-shell.tsx+++ b/src/components/player-shell.tsx@@ -64,6 +64,8 @@ export function PlayerShell({const [loading, setLoading] = useState(true);const [error, setError] = useState('');const [hint, setHint] = useState('');+ // 起播前的品牌占位图(沿用旧版 nomedia 素材),实际开始播放后隐藏+ const [showPoster, setShowPoster] = useState(true);const hintTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);// 用 ref 持有最新回调,避免重建播放器const cbs = useRef({ onTimeUpdate, onEnded, onPause, getRestorePosition });@@ -75,6 +77,7 @@ export function PlayerShell({if (!containerRef.current || !url) return;setLoading(true);setError('');+ setShowPoster(true);// 换集时清理函数在「新回调已挂到 ref 上」之后才执行,// 卸载前保存进度必须用本次挂载(本集)的回调,否则会把上一集的@@ -209,6 +212,7 @@ export function PlayerShell({art.on('video:playing', () => {playbackStarted = true;setLoading(false);+ setShowPoster(false);setError('');});art.on('video:loadedmetadata', () => setLoading(false));@@ -342,6 +346,17 @@ export function PlayerShell({return (<div className="relative w-full h-full"><div ref={containerRef} className="w-full h-full" />+ {showPoster && !error && (+ <div+ className="absolute inset-0 bg-black pointer-events-none"+ style={{+ backgroundImage: 'url(/player-poster.png)',+ backgroundSize: 'contain',+ backgroundPosition: 'center',+ backgroundRepeat: 'no-repeat',+ }}+ />+ )}{loading && !error && (<div className="absolute inset-0 flex flex-col items-center justify-center gap-3 bg-black/60 pointer-events-none"><div className="h-9 w-9 rounded-full border-4 border-line border-t-accent animate-spin" />