Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(player): align time menu and control icons

longmeidaob36f02d18276
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md
index f357b1bd9..32aeccecc 100644
--- a/docs/HANDOFF.md
+++ b/docs/HANDOFF.md
@@ -78,7 +78,7 @@ Claude 的 `.claude/settings.json` 已配置 Stop、StopFailure、SessionEnd hoo
**Vercel Geist Table/Home(2026-08-30)**:同形可比较数据使用语义 `table`,数字列保持 tabular numerals;Peach 因此把系统盘、资源盘、115 与 PikPak 容量放进同一张使用空间表。内容标签是固定 Top 排行和直接筛选,不伪装成可排序数据表,桌面使用保持 DOM 排名顺序的双栏有序列表,手机回到单栏。Vercel Table 的交互 DOM 与计算样式本轮未取得,Home 只确认共享对齐和清晰分区;失败通道、已取得原则与有意差异见 `vercel-geist-table-ranking.md`。
默认 Note、只读提示和 info 入口统一复用图片详情已有的本地 Lucide 圆圈 `i`,并显式使用 2px 描边与圆端点保证 `i` 的圆点可见,不复制未开放许可的 Geist 私有 SVG。**Vercel Command Menu/Search Input/Spinner/Loading Dots(2026-08-30)**:设置覆盖层使用锁定 Dialog CSS 的 350ms、`cubic-bezier(.4,0,.2,1)` 与 -40px 淡入轨迹,普通菜单仍无动画;Search Input 的搜索图标在查询期间原位换成 Spinner。用户直接触发的检查、加载、保存与应用使用 Spinner,后台抓取和扫描进度使用 Loading Dots;“没有更多历史内容”是中性、可关闭的 Note,不得登记为红色故障。证据哈希、未取得面与 Peach 差异见 `vercel-geist-command-search-loading.md`。**Vercel Notifications 中性说明 Note(2026-08-30)**:登录态截图确认底部补充说明使用带圆圈信息图标的整行中性表面,存在真实动作时链接紧跟正文;Peach 的口味归因和隐私说明复用 secondary `noteHtml`,没有真实动作时不伪造链接。实时 DOM/CSS 读取在 30 秒后超时,已取得边界、截图哈希和有意差异见 `vercel-notifications-note.md`。
**Beeg 资料页(2026-08-30)**:Reislin 与 SweetieFox 页面证据锁定的顺序是头像与名称、简介、外部链接、关联艺人轨道、标签轨道、内容;轨道不另加可见标题。Peach 的女优/厂牌资料页和关注页复用这个阅读顺序;资料页有照片时只显示一个 32×32px `PicsIcon`,放在标签左侧,选中代表照片视图,再点一次回到视频,不保留独立的「视频/照片」文字标签栏。合集详情继续使用普通详情的左媒体、右信息,下方另设 Mix/分卷/播放列表/多视频的横向切换带。锁定样式摘要、哈希、未取得面和主动差异见 `beeg-profile-layout.md`。
-YouTube Shorts 沉浸页使用用户截图记录 `docs/reference-snapshots/youtube-shorts-immersive-user-screenshot.md`:竖屏复用中央 9:16 舞台和外置动作列,横屏使用在整个视口视觉居中的 16:9 舞台并把动作列收进视频右侧;Peach 保留自己的反馈语义,不复制订阅或社交动作。沉浸视频每次加载都要带独立 `session`,切片、关闭、失败和页面离开时取消旧会话;只清浏览器的 `src` 不足以停止 CloudDrive 预读或 FFmpeg。普通播放器控制栏另使用用户截图、实际 YouTube `e937390a` 播放器 DOM/CSS/JS 和官方帮助记录 `docs/reference-snapshots/youtube-player-controls-user-screenshot.md`:控制栏为透明 59 px 两排结构;左侧播放是 40 px 圆钮,音量从 40 px 展开到 111 px,提示层允许越过胶囊,时间透明;右侧画中画/设置/影院/全屏不是四个描边圆钮,而是 48×40 px 单钮共用一个 40 px 高、28 px 圆角深色胶囊。已播段、12 px 圆点和卡片观看进度统一使用 Peach 蓝。中央只保留一个 68 px 深色圆形播放/暂停键;键盘仍按设置前后跳转,控制栏和中央层都不画 10 秒按钮。本地时刻预览复用九宫格接触表,在线视频只显示时刻。设置浮层按实测 274 px 宽、12 px 圆角、48 px 行高,只列真实能力:氛围模式全局开关、播放速度和实际清晰度;影院模式用按钮或 `T` 切换为大播放器,展开/收回使用不同图标和「影院模式/默认视图」提示,详情移到下方。Peach 不复制没有实际能力的字幕、睡眠定时或自动播放按钮。
+YouTube Shorts 沉浸页使用用户截图记录 `docs/reference-snapshots/youtube-shorts-immersive-user-screenshot.md`:竖屏复用中央 9:16 舞台和外置动作列,横屏使用在整个视口视觉居中的 16:9 舞台并把动作列收进视频右侧;Peach 保留自己的反馈语义,不复制订阅或社交动作。沉浸视频每次加载都要带独立 `session`,切片、关闭、失败和页面离开时取消旧会话;只清浏览器的 `src` 不足以停止 CloudDrive 预读或 FFmpeg。普通播放器控制栏另使用用户截图、实际 YouTube `e937390a` 播放器 DOM/CSS/JS 和官方帮助记录 `docs/reference-snapshots/youtube-player-controls-user-screenshot.md`:控制栏为透明 59 px 两排结构;左侧播放是 40 px 圆钮,音量从 40 px 展开到 111 px,提示层允许越过胶囊,时间使用 40 px 高、28 px 圆角胶囊并可切换已播/剩余时间;右侧画中画/设置/影院/全屏不是四个描边圆钮,而是 48×40 px 单钮共用一个 40 px 高、28 px 圆角深色胶囊。已播段、12 px 圆点和卡片观看进度统一使用 Peach 蓝。中央只保留一个 68 px 深色圆形播放/暂停键;键盘仍按设置前后跳转,控制栏和中央层都不画 10 秒按钮。本地时刻预览复用九宫格接触表,在线视频只显示时刻。设置浮层按实测 274 px 宽、12 px 圆角、48 px 行高、56 px 图标列和 57 px 子菜单标题栏,只列真实能力:氛围模式全局开关、播放速度和实际清晰度;影院模式用按钮或 `T` 切换为大播放器,展开/收回使用不同图标和「影院模式/默认视图」提示,详情移到下方。音量、画中画和全屏改用统一 24 px 本地图标;Peach 不复制没有实际能力的字幕、睡眠定时或自动播放按钮。
F95 masked 链接与 Gofile 文件列表的凭据边界见 `f95-masked-gofile-media`;Mix 只按已解析且
可播放的视频计数,不按回复数或网盘页数计数。
FANBOX 多图、Gofile Bearer API、Paheal 标签页与跨站出处键见
diff --git a/docs/reference-snapshots/youtube-player-controls-user-screenshot.md b/docs/reference-snapshots/youtube-player-controls-user-screenshot.md
index d89ab1eae..3d4714169 100644
--- a/docs/reference-snapshots/youtube-player-controls-user-screenshot.md
+++ b/docs/reference-snapshots/youtube-player-controls-user-screenshot.md
@@ -49,6 +49,12 @@
`093e41fbbeef96d7bfcf9bef1b2ef2e1ebea66c35fb2338c5fe6abcedb216049`、
`9f14dbd6a4b4d62d45766b245e45bf9bcf764b83451b8461557097886f99e891`、
`27381b857bd80eb76c15314ca47b12144e451c8520ffdeb4cd2911e50c5c71bd`
+- 第九轮用户标注的时间背景、影院音量、设置主层/子层和整栏图标偏差图共 5 张,SHA-256
+ `3199eda86cf160b92fd0f9a27ce27857ab42db6c91438716f1ee9dc96742e97e`、
+ `78bec4f733ab87cbf8eadb1ce10e322a8af30c29b5605b2a109eec32fff0aa27`、
+ `24c91a1804bca776e3244ebd0be6d582cd8bcd425d0a6681005efe6dcd06ebd2`、
+ `732f1d356299e9c2ec0523d55399cb2154eb50c259b87eac2c11c31b5cf6cf44`、
+ `bfaeaef7e620367c4421a00528d83c27fbd052ae7a95bd5ae65cffe1ef421950`
- YouTube 官方氛围模式说明:<https://support.google.com/youtube/answer/12827017?hl=en-GB>,
2026-08-30 复核;说明颜色取自视频并扩散到屏幕背景,深色主题默认开启,设置开关对所有视频生效。
- YouTube 官方播放器大小说明:<https://support.google.com/youtube/answer/6052392?hl=en>,
@@ -65,13 +71,15 @@
| `.ytp-chrome-bottom` | 781×59 px,`padding:3px 0 0`,透明 | 控制栏 59 px、透明、同内边距 |
| 左侧播放 | 40×40 px,圆形,背景 `rgba(0,0,0,.3)`,无边框/阴影 | 同值;悬停用内部 32 px 高亮层 |
| 横向音量 | 收起 40×40 px;悬停 111×40 px;滑轨区 52 px;过渡 200 ms | 同值;保留原生 Video.js 音量契约 |
-| 时间 | 56 px 高、8 px 垂直 padding、透明 | 去掉旧的独立时间胶囊和描边 |
+| 时间 | 外层 56 px;内层 40 px 高、左右 16 px、圆角 28 px、背景 `rgba(0,0,0,.3)`;点击从 `0:01 / 0:19` 切为 `-0:18 / 0:19` | 独立可点击胶囊;按用户亮色视频截图提高为黑色 60% |
| 右侧控制组 | 高 40 px、左右 padding 4 px、圆角 28 px、背景 `rgba(0,0,0,.3)`、模糊 16 px | 画中画/设置/影院/全屏放进同一共享容器;按用户亮色视频截图提高为黑色 60% |
| 右侧单钮 | 48×40 px、透明;悬停伪元素 48×32 px、圆角 40 px、白色 10% | 同值;按下白色 20%,SVG 仅保留 1 px drop-shadow |
| 进度 | 命中区 6 px,轨道 3–4 px,圆点 12 px | 几何同值,已播段和圆点改为 Peach 蓝 |
| 设置浮层 | 宽 274 px、圆角 12 px、背景黑 60%、模糊 16 px、无边框/阴影 | 只保留 Peach 已实现的三项能力 |
| 设置行 | 约 48 px;图标 24 px;图标列 56 px;正文 14/18.2 px;悬停白色 10% | 同值,不再使用旧 58 px 行高和大字号 |
| 设置开关 | 40×24 px、圆角 12 px;圆点 20 px、边距 2 px、开启位移 16 px | 同值,状态仍由 Peach 全局设置持久化 |
+| 设置子层 | 标题栏 57 px;返回钮 32×32 px、白色箭头;标题距返回钮 8 px | 速度与清晰度共用同一标题栏,不再把返回钮画成整行 |
+| 控制图标 | 音量与全屏使用 24×24 viewBox 的实心轮廓;按钮仍分别为 40×40 与 48×40 px | 音量、画中画、全屏改用统一 24 px 本地 SVG,静音/全屏退出各有反向状态 |
### 第八轮 DevTools 状态取证
@@ -83,13 +91,24 @@
「影院模式」和「默认视图」。Peach 使用两枚本地图标表达同一状态语义。
- 用户截图指定的中央交互是单个深色圆形播放/暂停键;左右 10 秒键删除,键盘跳转能力保留。
+### 第九轮 DevTools 状态取证
+
+- 实际 `.ytp-time-wrapper` 为 40 px 高、左右 16 px、28 px 圆角、黑色 30% 胶囊;点击
+ `.ytp-time-contents` 会在已播时间与负号开头的剩余时间间切换,总时长保持不变。
+- 影院模式下实际 `.ytp-volume-area` 收起仍为 40×40 px、28 px 圆角和黑色 30% 背景;模式切换
+ 不移除音量胶囊底色。Peach 为亮色视频保留用户指定的黑色 60%,并显式覆盖影院与全屏状态。
+- 实际设置主层宽 274 px、黑色 60%、12 px 圆角;每行约 48 px,24 px 图标位于 56 px 图标列
+ 左侧 8 px,正文与状态都是 14/18.2 px。子层标题栏 57 px,返回钮 32 px,白色图标,标题紧随其后。
+- 实际底栏音量图标使用 24×24 实心轮廓,全屏按钮 48×40 px 且展开/退出使用反向图形;Peach
+ 用同尺寸本地 SVG 取代 Video.js 字体图标,避免与设置、影院图标产生光学大小漂移。
+
## 可复用证据
| 项 | 截图证据 | Peach 实现 |
| --- | --- | --- |
| 控制层 | 控件悬浮在画面上;用户明确不要整块背景 | 控制栏透明,不再绘制圆角渐变或毛玻璃面板 |
| 进度 | 独占上排,横跨面板可用宽度 | `vjs-progress-control` 脱离底排 flex,绝对定位到上排 |
-| 左下 | 播放、音量、当前时间/总时长共用一条基线 | 播放为 40 px 圆钮;音量胶囊从 40 px 展开;时间透明;前后 10 秒移出控制栏,键盘快进仍保留 |
+| 左下 | 播放、音量、当前时间/总时长共用一条基线 | 播放为 40 px 圆钮;音量胶囊从 40 px 展开;时间胶囊点击切换已播/剩余;前后 10 秒移出控制栏,键盘快进仍保留 |
| 右下 | 实时 DOM 证实四个操作共用一个 40 px 高胶囊,单钮 48×40 px | 使用 Video.js spacer,把四个真实操作推到右侧共享胶囊;按钮只在悬停/按下时显示内部高亮 |
| 进度状态 | 细轨道、品牌色已播段和圆点;卡片缩略图底边显示已观看段 | Peach 把红色替换为 `--tungsten` 蓝,卡片按 `play_seconds / duration` 绘制同色进度 |
| 拖动提示 | 指针时刻上方显示时间;精确拖动时可带缩略图 | 本地媒体复用九宫格接触表近似对应时刻,在线媒体只显示时间,不伪造逐帧预览 |
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 44bd7e025..7bbf5e8ed 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -610,9 +610,12 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains(".vwrap .video-js .vjs-play-progress:before{content:\"\"")
self.assertPageContains("width:12px;height:12px")
self.assertPageContains(".vwrap .video-js .vjs-custom-control-spacer{display:block;flex:1 1 auto}")
- self.assertPageContains(".vwrap .video-js .vjs-current-time{display:flex;margin-left:4px")
- self.assertPageContains(".vwrap .video-js .vjs-duration{display:flex")
- self.assertPageContains("padding-right:8px;border:0;border-radius:0")
+ self.assertPageContains(".vwrap .video-js .vjs-time-control{display:none!important}")
+ self.assertPageContains(".vwrap .video-js .vjs-peach-time{box-sizing:border-box;align-self:flex-end")
+ self.assertPageContains("padding:0 16px;border:0;border-radius:28px;background:rgba(0,0,0,.6)")
+ self.assertPageContains("time.type='button';time.className='vjs-peach-time vjs-control';time.dataset.playerTime=''")
+ self.assertPageContains("remaining=!remaining;syncTime()")
+ self.assertPageContains("time.textContent=`${shown} / ${fmtClock(duration)}`")
self.assertPageContains(".vwrap .video-js.vjs-layout-x-small .vjs-progress-control")
self.assertPageContains(".vwrap .video-js.vjs-layout-small .vjs-current-time")
self.assertPageContains("currentTimeDisplay:true,timeDivider:true")
@@ -622,6 +625,13 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("typeof player.qualityLevels==='function'?player.qualityLevels():null")
self.assertPageContains("activePixels>=2160?'4K':activePixels>=720?'HD':''")
self.assertPageContains("levels[index].enabled=selected==='auto'||selected===String(index)")
+ self.assertPageContains("const syncVolumeIcon=()=>muteUse?.setAttribute('href'")
+ self.assertPageContains("const syncFullscreenIcon=()=>fullscreenUse?.setAttribute('href'")
+ self.assertPageContains("id=\"i-player-volume\"")
+ self.assertPageContains("id=\"i-player-volume-muted\"")
+ self.assertPageContains("id=\"i-player-fullscreen-enter\"")
+ self.assertPageContains("id=\"i-player-fullscreen-exit\"")
+ self.assertPageContains(".vjs-peach-control-icon{position:absolute;z-index:2;left:50%;top:50%;width:24px;height:24px")
self.assertPageContains("function mountDetailPlayer(it,video,autoplay,options={})")
self.assertPageContains("detailPlayer.duration(expected)")
self.assertPageContains("['loadstart','loadedmetadata','durationchange','error']")
@@ -670,10 +680,22 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("applyAmbientMode(!appSettings.ambientMode)")
self.assertPageContains(".vjs-peach-settings-menu{box-sizing:border-box;position:absolute;z-index:5;right:-100px;bottom:52px;width:min(274px")
self.assertPageContains("padding:8px;border:0;border-radius:12px;background:rgba(0,0,0,.6);box-shadow:none")
- self.assertPageContains("min-height:48px;padding:0 8px;border:0;border-radius:8px")
+ self.assertPageContains("min-height:48px;padding:0;border:0;border-radius:8px")
+ self.assertPageContains(".vjs-peach-menu-row>svg{justify-self:start;margin-left:8px;width:24px;height:24px")
+ self.assertPageContains(".video-js .vjs-peach-menu-row{display:grid;grid-template-columns:56px minmax(0,1fr) auto 18px")
+ self.assertPageContains(".vjs-peach-panel-header{box-sizing:border-box;height:57px;padding:8px;display:flex;align-items:center;gap:8px")
+ self.assertPageContains(".video-js .vjs-peach-menu-option{display:flex;align-items:center;justify-content:space-between")
+ self.assertPageContains("class=\"vjs-peach-panel-header\"")
+ self.assertPageContains('aria-label="返回上一个菜单"')
+ self.assertPageContains("color:#eee")
self.assertPageContains(".vjs-peach-switch{position:relative;width:40px;height:24px;border-radius:12px")
self.assertPageLacks("睡眠定时")
+ def test_player_volume_background_survives_theater_and_fullscreen(self):
+ self.assertPageContains(".stage.theater-mode .vwrap .video-js .vjs-control-bar>.vjs-volume-panel")
+ self.assertPageContains(".video-js.vjs-fullscreen .vjs-control-bar>.vjs-volume-panel:hover")
+ self.assertPageContains("background:rgba(0,0,0,.6)!important")
+
def test_theater_mode_has_button_tooltip_keyboard_and_responsive_layout(self):
self.assertPageContains("function mountPlayerTheaterControl(player,settingsRoot)")
self.assertPageContains('data-player-theater aria-label="影院模式"')
diff --git a/web/app.css b/web/app.css
index 94a8d9b98..9f26a11d8 100644
--- a/web/app.css
+++ b/web/app.css
@@ -1034,6 +1034,9 @@ body.index-open #tiers,body.index-open #tagbar{display:none}
.vwrap .video-js.vjs-playing .vjs-control-bar>.vjs-play-control .vjs-icon-placeholder:after{left:56%;width:4px;height:16px;transform:translate(-50%,-50%)}
.vwrap .video-js .vjs-volume-panel>.vjs-mute-control .vjs-icon-placeholder:before,
.vwrap .video-js .vjs-peach-right-controls .vjs-icon-placeholder:before{display:grid;place-items:center;width:100%;height:100%;line-height:normal;filter:drop-shadow(0 0 1px rgba(0,0,0,.8))}
+.vwrap .video-js [data-peach-explicit-icon]>.vjs-icon-placeholder:before{display:none}
+.vjs-peach-control-icon{position:absolute;z-index:2;left:50%;top:50%;width:24px;height:24px;display:block;
+ transform:translate(-50%,-50%);fill:currentColor;stroke:none;filter:drop-shadow(0 0 1px rgba(0,0,0,.8));pointer-events:none}
.vjs-peach-hover{position:absolute;z-index:0;left:0;top:4px;width:100%;height:32px;border-radius:40px;pointer-events:none;
background:transparent;transition:background .2s cubic-bezier(.05,0,0,1)}
.vwrap .video-js .vjs-control-bar>.vjs-play-control:hover>.vjs-peach-hover,
@@ -1048,7 +1051,14 @@ body.index-open #tiers,body.index-open #tagbar{display:none}
margin:0 0 8px 12px;padding:0;border:0;border-radius:28px;background:rgba(0,0,0,.6);box-shadow:none;
overflow:visible;transition:width .2s cubic-bezier(0,0,.2,1),flex-basis .2s cubic-bezier(0,0,.2,1),padding-right .2s cubic-bezier(0,0,.2,1)}
.vwrap .video-js .vjs-control-bar>.vjs-volume-panel:hover,
-.vwrap .video-js .vjs-control-bar>.vjs-volume-panel:focus-within{flex-basis:111px;width:111px;padding-right:16px}
+.vwrap .video-js .vjs-control-bar>.vjs-volume-panel:focus-within{flex-basis:111px;width:111px;padding-right:16px;background:rgba(0,0,0,.6)}
+.stage.theater-mode .vwrap .video-js .vjs-control-bar>.vjs-volume-panel,
+.stage.theater-mode .vwrap .video-js .vjs-control-bar>.vjs-volume-panel:hover,
+.stage.theater-mode .vwrap .video-js .vjs-control-bar>.vjs-volume-panel:focus-within,
+.video-js.vjs-fullscreen .vjs-control-bar>.vjs-volume-panel,
+.video-js.vjs-fullscreen .vjs-control-bar>.vjs-volume-panel:hover,
+.video-js.vjs-fullscreen .vjs-control-bar>.vjs-volume-panel:focus-within{background:rgba(0,0,0,.6)!important;
+ backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.vwrap .video-js .vjs-volume-panel>.vjs-mute-control{flex:0 0 40px;width:40px;height:40px;margin:0;border:0;background:transparent}
.vwrap .video-js .vjs-volume-panel>.vjs-volume-control.vjs-volume-horizontal{display:block;flex:0 0 52px;width:52px;height:40px;margin:0 3px 0 0;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .1s cubic-bezier(0,0,.2,1)}
.vwrap .video-js .vjs-volume-panel:hover>.vjs-volume-control.vjs-volume-horizontal,
@@ -1086,10 +1096,11 @@ body.index-open #tiers,body.index-open #tagbar{display:none}
.vjs-peach-seek-preview span{min-width:58px;margin-top:8px;padding:6px 10px;border-radius:var(--pill-radius);
background:rgba(0,0,0,.68);font-size:var(--fs-sm);font-weight:700;line-height:1;text-align:center;box-shadow:0 2px 8px #0006}
.vwrap .video-js .vjs-custom-control-spacer{display:block;flex:1 1 auto}
-.vwrap .video-js .vjs-time-control{align-self:flex-end;height:56px;padding:8px 0;margin:0;font-size:var(--fs-sm);line-height:40px;background:transparent}
-.vwrap .video-js .vjs-current-time{display:flex;margin-left:4px;padding-left:8px;border:0;border-radius:0}
-.vwrap .video-js .vjs-time-divider{display:flex;min-width:auto;padding:8px 3px;border:0}
-.vwrap .video-js .vjs-duration{display:flex;padding-right:8px;border:0;border-radius:0}
+.vwrap .video-js .vjs-time-control{display:none!important}
+.vwrap .video-js .vjs-peach-time{box-sizing:border-box;align-self:flex-end;flex:0 0 auto;width:auto;height:40px;margin:0 0 8px 12px;
+ padding:0 16px;border:0;border-radius:28px;background:rgba(0,0,0,.6);color:#fff;cursor:pointer;
+ font:400 var(--fs-md)/40px Arial,sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap;text-shadow:0 0 1px rgba(0,0,0,.8)}
+.vwrap .video-js .vjs-peach-time:hover,.vwrap .video-js .vjs-peach-time:focus-visible{background:rgba(0,0,0,.72);outline:0}
.vjs-peach-settings,.vjs-peach-theater{position:relative;flex:0 0 48px;width:48px!important;min-width:48px}
.vjs-peach-settings>button,.vjs-peach-theater>button{width:100%;height:100%;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;display:grid;place-items:center}
.vjs-peach-settings>button>svg,.vjs-peach-theater>button>svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2;filter:drop-shadow(0 0 1px rgba(0,0,0,.8))}
@@ -1100,18 +1111,20 @@ body.index-open #tiers,body.index-open #tagbar{display:none}
padding:8px;border:0;border-radius:12px;background:rgba(0,0,0,.6);box-shadow:none;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
color:#fff;text-shadow:0 0 1px rgba(0,0,0,.8);font:400 var(--fs-md)/1.3 Arial,sans-serif}
.vjs-peach-settings-menu[hidden]{display:none}
-.vjs-peach-settings-menu button{box-sizing:border-box;width:100%;min-height:48px;padding:0 8px;border:0;border-radius:8px;background:transparent;color:#fff;font:inherit;cursor:pointer}
+.vjs-peach-settings-menu button{box-sizing:border-box;width:100%;min-height:48px;padding:0;border:0;border-radius:8px;background:transparent;color:#fff;font:inherit;cursor:pointer}
.vjs-peach-settings-menu button:hover,.vjs-peach-settings-menu button:focus-visible{background:rgba(255,255,255,.1);outline:0}
.vjs-peach-settings-menu button:active{background:rgba(255,255,255,.2)}
-.vjs-peach-menu-row{display:grid;grid-template-columns:56px minmax(0,1fr) auto 18px;gap:0;align-items:center;text-align:left}
-.vjs-peach-menu-row>svg{justify-self:center;width:24px;height:24px;stroke:currentColor;fill:none}.vjs-peach-menu-row>span{font-size:var(--fs-md)}.vjs-peach-menu-row>b{padding-left:8px;font-size:var(--fs-md);font-weight:400;color:rgba(255,255,255,.7);white-space:nowrap}
+.video-js .vjs-peach-menu-row{display:grid;grid-template-columns:56px minmax(0,1fr) auto 18px;gap:0;align-items:center;text-align:left}
+.vjs-peach-menu-row>svg{justify-self:start;margin-left:8px;width:24px;height:24px;stroke:currentColor;fill:none}.vjs-peach-menu-row>span{font-size:var(--fs-md);line-height:18.2px}.vjs-peach-menu-row>b{padding-left:8px;font-size:var(--fs-md);line-height:18.2px;font-weight:400;color:rgba(255,255,255,.7);white-space:nowrap}
.vjs-peach-menu-row>svg:last-child{width:18px;height:18px;color:rgba(255,255,255,.7)}
.vjs-peach-menu-row[data-player-ambient]{grid-template-columns:56px minmax(0,1fr) auto}.vjs-peach-switch{position:relative;width:40px;height:24px;border-radius:12px;background:rgba(255,255,255,.3)}
.vjs-peach-switch:after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:none;transition:transform .2s cubic-bezier(.05,0,0,1)}
.vjs-peach-menu-row[aria-checked="true"] .vjs-peach-switch{background:rgba(255,255,255,.3)}.vjs-peach-menu-row[aria-checked="true"] .vjs-peach-switch:after{transform:translateX(16px)}
-.vjs-peach-menu-back{display:flex;align-items:center;gap:16px;text-align:left;border:0!important;border-radius:8px!important}
-.vjs-peach-menu-back svg{width:24px;height:24px}.vjs-peach-menu-back span{font-size:var(--fs-md);font-weight:600}
-.vjs-peach-menu-option{display:flex;align-items:center;justify-content:space-between;text-align:left;font-size:var(--fs-md)!important}
+.vjs-peach-panel-header{box-sizing:border-box;height:57px;padding:8px;display:flex;align-items:center;gap:8px;color:#eee}
+.vjs-peach-panel-header .vjs-peach-menu-back{flex:0 0 32px;width:32px;min-height:32px;height:32px!important;display:grid;place-items:center;border:0!important;border-radius:50%!important;color:#eee}
+.vjs-peach-panel-header .vjs-peach-menu-back svg{width:24px;height:24px;display:block;stroke:currentColor;fill:none;stroke-width:2}
+.vjs-peach-panel-header strong{font-size:var(--fs-xs);line-height:16px;font-weight:600;color:#eee}
+.video-js .vjs-peach-menu-option{display:flex;align-items:center;justify-content:space-between;padding:0 8px!important;text-align:left;font-size:var(--fs-md)!important;line-height:18.2px}
.vjs-peach-menu-option span,.vjs-peach-menu-option svg{width:18px;height:18px}
.vjs-peach-tooltip{position:absolute;right:50%;bottom:calc(100% + 1em);transform:translateX(50%);display:none;align-items:center;gap:.45em;padding:.65em .85em;border-radius:.75em;background:rgba(40,40,40,.88);box-shadow:0 4px 14px #0007;white-space:nowrap;font-size:1.25em;font-weight:600;pointer-events:none}
.vjs-peach-tooltip kbd{display:inline-grid;place-items:center;min-width:1.55em;height:1.55em;border:1px solid rgba(255,255,255,.42);border-radius:.35em;font:inherit}
diff --git a/web/app.js b/web/app.js
index 34da2dd3e..e8df7a8b1 100644
--- a/web/app.js
+++ b/web/app.js
@@ -527,14 +527,14 @@ function mountPlayerQualityControl(player,video,fallbackHeight=0){
};
const showSpeed=()=>{
const selectedSpeed=Number(player.playbackRate())||1,speeds=[.25,.5,.75,1,1.25,1.5,1.75,2];
- menu.innerHTML=`<button type="button" class="vjs-peach-menu-back" data-player-menu-back>${icon('chevron-left')}<span>播放速度</span></button>${speeds.map(speed=>
+ menu.innerHTML=`<div class="vjs-peach-panel-header"><button type="button" class="vjs-peach-menu-back" data-player-menu-back aria-label="返回上一个菜单">${icon('chevron-left')}</button><strong>播放速度</strong></div>${speeds.map(speed=>
`<button type="button" class="vjs-peach-menu-option" role="menuitemradio" data-player-speed-option="${speed}" aria-checked="${speed===selectedSpeed}">${speed===1?'正常':speed+'×'}<span>${speed===selectedSpeed?icon('check'):''}</span></button>`).join('')}`;
menu.querySelector('[data-player-menu-back]').onclick=showMain;
menu.querySelectorAll('[data-player-speed-option]').forEach(button=>button.onclick=()=>{player.playbackRate(Number(button.dataset.playerSpeedOption));showMain()});
};
const showQuality=()=>{
const {options}=qualityRows();
- menu.innerHTML=`<button type="button" class="vjs-peach-menu-back" data-player-menu-back>${icon('chevron-left')}<span>清晰度</span></button>${options.map(option=>
+ menu.innerHTML=`<div class="vjs-peach-panel-header"><button type="button" class="vjs-peach-menu-back" data-player-menu-back aria-label="返回上一个菜单">${icon('chevron-left')}</button><strong>清晰度</strong></div>${options.map(option=>
`<button type="button" class="vjs-peach-menu-option" role="menuitemradio" data-player-quality-option="${esc(option.key)}" aria-checked="${option.key===selected}">${esc(option.label)}<span>${option.key===selected?icon('check'):''}</span></button>`).join('')}`;
menu.querySelector('[data-player-menu-back]').onclick=showMain;
menu.querySelectorAll('[data-player-quality-option]').forEach(button=>button.onclick=()=>{
@@ -564,11 +564,39 @@ function mountPlayerChromeLayout(player){
const controlBar=player.getChild('controlBar')?.el();if(!controlBar||controlBar.querySelector('.vjs-peach-right-controls'))return;
const play=controlBar.querySelector(':scope>.vjs-play-control');
if(play&&!play.querySelector(':scope>.vjs-peach-hover'))play.insertAdjacentHTML('beforeend','<span class="vjs-peach-hover" aria-hidden="true"></span>');
+ const explicitIcon=(button,name)=>{
+ if(!button)return null;
+ button.dataset.peachExplicitIcon='';
+ button.insertAdjacentHTML('beforeend',icon(name,'vjs-peach-control-icon'));
+ return button.querySelector(':scope>.vjs-peach-control-icon use');
+ };
+ const volume=controlBar.querySelector(':scope>.vjs-volume-panel');
+ const mute=volume?.querySelector(':scope>.vjs-mute-control'),muteUse=explicitIcon(mute,'player-volume');
+ const syncVolumeIcon=()=>muteUse?.setAttribute('href',player.muted()||player.volume()===0?'#i-player-volume-muted':'#i-player-volume');
+ player.on('volumechange',syncVolumeIcon);syncVolumeIcon();
+ const time=document.createElement('button');let remaining=false;
+ time.type='button';time.className='vjs-peach-time vjs-control';time.dataset.playerTime='';
+ const syncTime=()=>{
+ const current=Math.max(0,Number(player.currentTime())||0),duration=Math.max(0,Number(player.duration())||0);
+ const shown=remaining?`-${fmtClock(Math.max(0,duration-current))}`:fmtClock(current);
+ time.textContent=`${shown} / ${fmtClock(duration)}`;
+ time.dataset.remaining=String(remaining);
+ time.setAttribute('aria-label',remaining?`剩余 ${fmtClock(Math.max(0,duration-current))},总时长 ${fmtClock(duration)};点击显示已播放时间`:`已播放 ${fmtClock(current)},总时长 ${fmtClock(duration)};点击显示剩余时间`);
+ };
+ time.onclick=event=>{event.stopPropagation();remaining=!remaining;syncTime()};
+ player.on(['timeupdate','durationchange','loadedmetadata'],syncTime);syncTime();
+ if(volume)volume.insertAdjacentElement('afterend',time);else controlBar.append(time);
+ const pip=controlBar.querySelector(':scope>.vjs-picture-in-picture-control');
+ explicitIcon(pip,'player-pip');
+ const fullscreen=controlBar.querySelector(':scope>.vjs-fullscreen-control');
+ const fullscreenUse=explicitIcon(fullscreen,'player-fullscreen-enter');
+ const syncFullscreenIcon=()=>fullscreenUse?.setAttribute('href',player.isFullscreen()?'#i-player-fullscreen-exit':'#i-player-fullscreen-enter');
+ player.on('fullscreenchange',syncFullscreenIcon);syncFullscreenIcon();
const controls=[
- controlBar.querySelector(':scope>.vjs-picture-in-picture-control'),
+ pip,
controlBar.querySelector(':scope>.vjs-peach-settings'),
controlBar.querySelector(':scope>.vjs-peach-theater'),
- controlBar.querySelector(':scope>.vjs-fullscreen-control'),
+ fullscreen,
].filter(Boolean);
if(!controls.length)return;
const group=document.createElement('div');group.className='vjs-peach-right-controls';group.setAttribute('aria-label','播放器视图控制');
diff --git a/web/index.html b/web/index.html
index daff9c981..8d188d89c 100644
--- a/web/index.html
+++ b/web/index.html
@@ -34,6 +34,13 @@
<symbol id="i-gauge" viewBox="0 0 24 24"><path d="m12 14 4-4" /><path d="M3.34 19a10 10 0 1 1 17.32 0" /></symbol>
<symbol id="i-theater-enter" viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="18" rx="1.5"/><path d="M2 16h20M8.5 7 5.5 10l3 3M15.5 7l3 3-3 3"/></symbol>
<symbol id="i-theater-exit" viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="18" rx="1.5"/><path d="M2 16h20M5.5 7l3 3-3 3M18.5 7l-3 3 3 3"/></symbol>
+ <!-- 播放器控制图标按 YouTube 当前 24px 实心轮廓单独绘制,避免 Video.js 字体图标
+ 与 Peach 的 Lucide 图标在同一控制栏里出现不同的视觉尺寸。 -->
+ <symbol id="i-player-volume" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M11.6 2.08a1 1 0 0 1 1.4.92v18a1 1 0 0 1-1.52.85L3.91 17.31A6 6 0 0 1 1 12v-.17a6 6 0 0 1 2.91-5.15z"/><path d="M15.53 7.05a1 1 0 0 1 1.42 0A7 7 0 0 1 19 12a7 7 0 0 1-2.05 4.95 1 1 0 1 1-1.42-1.42A5 5 0 0 0 17 12a5 5 0 0 0-1.47-3.53 1 1 0 0 1 0-1.42Z"/><path d="M18.36 4.22a1 1 0 0 1 1.41 0A11 11 0 0 1 23 12a11 11 0 0 1-3.23 7.78 1 1 0 0 1-1.41-1.42A9 9 0 0 0 21 12a9 9 0 0 0-2.64-6.36 1 1 0 0 1 0-1.42Z"/></symbol>
+ <symbol id="i-player-volume-muted" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M11.6 2.08a1 1 0 0 1 1.4.92v18a1 1 0 0 1-1.52.85L3.91 17.31A6 6 0 0 1 1 12v-.17a6 6 0 0 1 2.91-5.15z"/><path d="m16.7 8.3 2.3 2.3 2.3-2.3 1.4 1.4-2.3 2.3 2.3 2.3-1.4 1.4-2.3-2.3-2.3 2.3-1.4-1.4 2.3-2.3-2.3-2.3z"/></symbol>
+ <symbol id="i-player-pip" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path fill-rule="evenodd" d="M3 4h18a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm0 2v12h18V6H3Zm10 5h7v5h-7v-5Z"/></symbol>
+ <symbol id="i-player-fullscreen-enter" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M10 3H3v7a1 1 0 0 0 2 0V6.41l4.29 4.29a1 1 0 0 0 1.41-1.41L6.41 5H10a1 1 0 0 0 0-2Zm10 10a1 1 0 0 0-1 1v3.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29H14a1 1 0 0 0 0 2h7v-7a1 1 0 0 0-1-1Z"/></symbol>
+ <symbol id="i-player-fullscreen-exit" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M4 13a1 1 0 0 0 0 2h3.59L3.3 19.29a1 1 0 1 0 1.41 1.42L9 16.41V20a1 1 0 0 0 2 0v-7H4Zm16-2a1 1 0 0 0 0-2h-3.59l4.3-4.29a1 1 0 0 0-1.42-1.42L15 7.59V4a1 1 0 0 0-2 0v7h7Z"/></symbol>
<symbol id="i-history" viewBox="0 0 24 24"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" /><path d="M12 7v5l4 2" /></symbol>
<symbol id="i-sparkles" viewBox="0 0 24 24"><path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" /><path d="M20 2v4" /><path d="M22 4h-4" /><circle cx="4" cy="20" r="2" /></symbol>
<symbol id="i-x" viewBox="0 0 24 24"><path d="M18 6 6 18" /><path d="m6 6 12 12" /></symbol>