Peach: Local-first video metadata scraper and media manager.
fix(web): 完善 JAV 封面大小名称与图标
longmeidaoafad3e978f32
diff --git a/README.en.md b/README.en.mdindex fea19865d..6519eafa9 100644--- a/README.en.md+++ b/README.en.md@@ -47,7 +47,7 @@ Settings control whether local and followed videos play automatically when theirPortraits and brand marks allow moderate enlargement in large and compact views. Very small images use their native size with a blurred background. Display areas below 64 px retain the regular icon treatment.-Settings offers a default JAV cover choice: official covers or preview images across the home feed, continue watching, Mix, video cards and playback queues. Missing images fall back to the other type. The default JAV size can be large or small; both use the selected cover type. Preferences are saved in the current browser.+Settings offers a default JAV cover choice: official covers or preview images across the home feed, continue watching, Mix, video cards and playback queues. Missing images fall back to the other type. The default JAV cover size can be large or small; both use the selected cover type. Preferences are saved in the current browser.Peach is **pre-1.0**. The application interface is currently Chinese only.diff --git a/README.md b/README.mdindex 74461ea53..ab99fa053 100644--- a/README.md+++ b/README.md@@ -45,7 +45,7 @@ CloudDrive · 115 与 CloudDrive · PikPak 按本机文件夹接入;先在 Clo人物头像和厂牌标识在大图、紧凑模式中允许适度放大;明显过小的图片居中,周围用同图模糊补底。小于 64 px 的展示区域保持普通图标样式。-设置中的「JAV 默认封面」可选官方封面或预览图,适用于首页、接着看、Mix、作品卡片和播放队列;缺图时使用另一种封面。「JAV 默认大小」可选大图或小图,两种大小都使用所选封面。偏好保存在当前浏览器。+设置中的「JAV 默认封面」可选官方封面或预览图,适用于首页、接着看、Mix、作品卡片和播放队列;缺图时使用另一种封面。「JAV 封面默认大小」可选大图或小图,两种大小都使用所选封面。偏好保存在当前浏览器。## 快速开始diff --git a/tests/test_web_ui.py b/tests/test_web_ui.pyindex 5aaae6410..2c54d5c21 100644--- a/tests/test_web_ui.py+++ b/tests/test_web_ui.py@@ -6637,9 +6637,9 @@ class WebUiSourceTests(unittest.TestCase):def test_jav_cover_source_and_size_are_independent_settings(self):self.assertPageContains('JAV 默认封面')- self.assertPageContains('JAV 默认大小')+ self.assertPageContains('JAV 封面默认大小')self.assertPageContains("[['cover','官方封面',''],['thumbnail','预览图','']]")- self.assertPageContains("[['big','大图',''],['small','小图','']]")+ self.assertPageContains("JAV_LAYOUTS,javLayout(),{attr:'data-jav-layout',className:'javimageswitch',text:true}")self.assertPageContains('id="javSizeSetting"')self.assertPageContains("wireJavLayoutButtons(size)")size_body = self.app_js.split('function setJavLayout(value){', 1)[1].split('\n}', 1)[0]diff --git a/web/app.js b/web/app.jsindex 5c63e9c33..3abfc1422 100644--- a/web/app.js+++ b/web/app.js@@ -395,6 +395,7 @@ const defaultSortDir=key=>SORT_DIR_WORDS[key]?'desc':'';已经按 `prefers-color-scheme` 和 `[data-theme]` 两条路径写好,这里只负责选哪一条。跟随系统是默认档,选它等于不写属性。 */const THEME_CHOICES=['system','light','dark'];+const JAV_LAYOUTS=[['big','大图','maximize'],['small','小图','layout-grid']];/* 跟随系统那一档跟 vercel.com 后台一样用显示器:这一档说的是「照这台设备的设定走」,讲的是设备而不是明暗,日月合体的那枚反而在说明暗。`monitor` 因此归给它,详情页的画面尺寸改用 `ratio`——那里量的是画幅本身,不是放画幅的那台机器。 */@@ -459,8 +460,8 @@ function renderJavImageSetting(){document.querySelectorAll('img[data-jav-image].cover').forEach(coverAnchor);});const size=$('#javSizeSetting');- size.innerHTML=iconSwitchHtml('jav-size','JAV 默认大小',- [['big','大图',''],['small','小图','']],javLayout(),{attr:'data-jav-layout',className:'javimageswitch',text:true});+ size.innerHTML=iconSwitchHtml('jav-size','JAV 封面默认大小',+ JAV_LAYOUTS,javLayout(),{attr:'data-jav-layout',className:'javimageswitch',text:true});wireJavLayoutButtons(size);}function renderThemeSetting(){@@ -6775,7 +6776,6 @@ function openManage(section='stats'){/* JAV 模式。只有带番号的作品才有官方封套,所以版式切换只在这个语境里出现——首页混着创作者作品和素人流出,给它们切「封面」没有意义。资料页(女优/厂牌)进入时继承这个开关,因为那里同样是按番号浏览。 */-const JAV_LAYOUTS=[['big','大图','maximize'],['small','小图','layout-grid']];function javActive(){const path=decodeURIComponent(location.pathname);if(path==='/')return state.jav==='1';diff --git a/web/css/16-settings.css b/web/css/16-settings.cssindex 21e7620d4..803f1ecf6 100644--- a/web/css/16-settings.css+++ b/web/css/16-settings.css@@ -1,6 +1,7 @@/* 内边距吃掉刘海和底部横条:iOS 上 `inset:0` 会一直铺到状态栏和 Home 指示条底下。 */body.settings-open{overflow:hidden}.iconswitch.javimageswitch label{width:auto;min-width:52px;padding-inline:10px}+.javimageswitch label>span[aria-hidden]{display:inline-flex;align-items:center;gap:6px}.settingspanel{position:fixed;z-index:var(--layer-dialog);inset:0;isolation:isolate;display:grid;place-items:center;background:rgba(242,242,242,.8);padding:18px;padding-top:max(18px,env(safe-area-inset-top));padding-bottom:max(18px,env(safe-area-inset-bottom));overscroll-behavior:contain}.settingspanel[hidden]{display:none}/* 高度用 dvh 不用 vh。iOS 上 `vh` 算的是「大视口」——不减地址栏,所以按 90vh 撑出来的面板会顶到地址栏和状态栏底下,上半截被遮住。`dvh` 跟着当前可见高度走。diff --git a/web/index.html b/web/index.htmlindex 82ad4ce3f..6988a48de 100644--- a/web/index.html+++ b/web/index.html@@ -217,7 +217,7 @@</section><section class="settinggroup"><h3>界面</h3><div class="settingrow"><span><b>JAV 默认封面</b><small>首页、接着看和 Mix 等位置共用;缺图时使用另一种封面。</small></span><div id="javImageSetting"></div></div>- <div class="settingrow"><span><b>JAV 默认大小</b><small>JAV 作品列表的默认版式;小图使用所选封面。</small></span><div id="javSizeSetting"></div></div>+ <div class="settingrow"><span><b>JAV 封面默认大小</b><small>JAV 作品列表的默认版式;小图使用所选封面。</small></span><div id="javSizeSetting"></div></div><div class="settingrow"><span><b>主题</b><small>跟随系统,或固定用浅色、深色。</small></span><div id="themeSetting"></div></div><section class="sidebarsetting" aria-labelledby="sidebarOrderTitle"><span><b id="sidebarOrderTitle">左侧导航</b><small>直接拖动排序;可隐藏入口,也可从具体页面列表重新添加。窄栏和筛选抽屉会保持一致。</small></span><div class="sidebarorder" id="sidebarOrderSetting"></div></section></section>diff --git a/web/js/ui-components.js b/web/js/ui-components.jsindex 310bed7ea..79f6f3a37 100644--- a/web/js/ui-components.js+++ b/web/js/ui-components.js@@ -401,7 +401,7 @@ export function wireOverlayScrollbars(root=document){export function iconSwitchHtml(name,legend,options,current,{attr='',className='',text=false}={}){const items=options.map(([value,label,symbol])=>`<label title="${esc(label)}"><input type="radio" name="${esc(name)}" value="${esc(value)}" ${attr}- ${value===current?'checked':''}><span aria-hidden="true">${text?esc(label):icon(symbol)}</span><span class="sr-only">${esc(label)}</span></label>`).join('');+ ${value===current?'checked':''}><span aria-hidden="true">${text?(symbol?icon(symbol):'')+esc(label):icon(symbol)}</span><span class="sr-only">${esc(label)}</span></label>`).join('');return `<fieldset class="iconswitch${className?` ${esc(className)}`:''}"><legend class="sr-only">${esc(legend)}</legend>${items}</fieldset>`;}