Skip to content

armgit / peach

Public Imported from GitHub
0

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

feat(web): 头像抬起、清空溶解、徽标弹出与标题揭示落到目录、搜索、读数与详情

longmeidao078187c683cd
diff --git a/docs/reference-snapshots/transitions-dev-measured.md b/docs/reference-snapshots/transitions-dev-measured.md
index f2cbffd1d..32ac47686 100644
--- a/docs/reference-snapshots/transitions-dev-measured.md
+++ b/docs/reference-snapshots/transitions-dev-measured.md
@@ -43,3 +43,47 @@
在 Peach 这是首页每次筛选都要重画的读数,首屏会变成一片抖动。
- 骨架换内容时旧的那一层抬成绝对定位再淡出,容器高度全程由新内容决定;上游示例里
两块内容尺寸相同,不需要处理这一步。
+
+## 第二批(2026-09-17)
+
+- 取证方式同上,另加一条:`https://transitions.dev/transitions/<slug>` 会 301 到同一
+ 地址带斜杠的那一份,配方的 CSS 与 React 两份全文都在那一页的 HTML 里,不在 JS 包里。
+- 这一批新增一档 token `--motion-pop`(.4s cubic-bezier(.34,1.36,.64,1)),和原有五档
+ 住在 `board.css` 同一个 `:root`、由同一条 `prefers-reduced-motion` 规则归零。
+ 它单独成档是因为缓动:`animation` 里只能有一条缓动函数,token 已经带着一条,
+ 再写第二条整条声明就无效,动画会被整个丢掉。
+
+| 配方 | slug | 上游取值 | Peach 落成值 | 落点 |
+| --- | --- | --- | --- | --- |
+| 一排头像里抬起一枚 | `avatar-group-hover` | 320ms;进 `cubic-bezier(0.22,1,0.36,1)`、出 `cubic-bezier(0.34,3.85,0.64,1)`;抬 -4px;放大 1.05;衰减 .45 | `--board-motion`(.3s)走抬起、`--spring-press`(208ms 采样弹簧)走落回;抬 -4px;放大 1.05;衰减 .45,横向推开 7px/10px 为 Peach 自拟 | `.tier`/`.followauthors`/`.followworks` 的 `.av`、`.brandpill`;卡片上的 `.mavstack .mav` |
+| 清空时内容溶解 | `input-clear-with-dissolve` | 出场 400ms;`cubic-bezier(0.22,1,0.36,1)`;位移 12px;blur 2px;另有逐词 radial-gradient 扫光 | `--motion-reveal`(.4s);位移 12px;blur 2px;不做扫光 | `.cleardissolve`;`dissolveValue`;`#q` 的六个清空入口 |
+| 计数徽标弹出 | `notification-badge` | 弹入 500ms `cubic-bezier(0.34,1.36,0.64,1)`、淡入 400ms;blur 2px;scale 0→1;另有 260ms 的 (-8.2px, 12.4px) 滑入 | `--motion-pop`(.4s + 同一条超调缓动);blur 2px;scale 0→1;不做滑入 | `.countbadge`;`popBadges`;筛选条与抽屉的 `.n`、垃圾文件分类计数 |
+| 标题逐行揭示 | `texts-reveal` | 500ms;`cubic-bezier(0.22,1,0.36,1)`;位移 12px;blur 3px;行距 40ms | `--motion-reveal`(.4s);位移 12px;blur 3px;行距 `--motion-stagger` 70ms | `.revealline`;`revealTexts`;详情浮窗标题、管理区页面标题、设置面板页签标题 |
+
+### 与上游取值不同的几处判断
+
+- 抬头像的进出两条缓动由整排的 `:has(:hover)` 切换,不写 JS。上游那份要逐个元素写内联
+ `transitionTimingFunction` 和 `--shift`,因为它按索引距离算衰减;Peach 这几排最多
+ 三档就衰减到 .36px(看不出来),选择器直接写到两位即可,省掉一整套监听与重新绑定。
+ 落回那条不用上游的 `cubic-bezier(0.34,3.85,0.64,1)`,改用站内已有的 `--spring-press`,
+ 理由与第一批开关双弹同一条:已经有采样自真实弹簧的那一档,不再另起一条近似。
+- 横向推开是 Peach 自己加的,上游没有这一项。它只对叠放那一组(`.mavstack`,相邻两枚
+ 压着 14px)成立:只抬不推的话,被抬起的那一枚仍有半张脸压在邻座下面。横滚的那两排
+ 本来就有 14px 间距,不推。
+- 清空不做逐词扫光。上游自己在注释里写明那道光的起落曲线无法用静态关键帧表达、必须逐帧写
+ `background`;换来的是一道在深浅两个主题下都几乎看不出来的光,搜索框每清一次跑一段
+ 逐帧 JS 不值当。溶解层是照着输入框当下的位置和字体摆的一份复制品,输入框的 value 在
+ 动画开始前就已经清空,光标与输入法不等这 400ms。
+- 徽标不做滑入。上游那枚锚在铃铛图标的右上角,滑入是从图标中心飞到角上;Peach 这几枚
+ 是行内跟在标签后面的计数,没有「从哪飞来」的起点,硬加一段位移只会让整行字跟着晃。
+- 徽标只在值真的变了时弹,判据存在模块级的一张表里,不看节点是不是新建的:这几排每换
+ 一个筛选都整块重画,按节点判等于每次筛选整列计数一起弹。
+- 标题按行揭示,不按词。上游示例本身就是按行(`.t-stagger-line`),逐词是首页那一版的
+ 做法;Peach 这几处正是最常被复制走的几段字(作品名、页面名),拆成一串 `<span>`
+ 会让复制出来的文本散架。
+- 揭示走完把类名一并摘掉。终点帧留着 `filter:blur(0)` 的话,非 none 的 filter 会另起一个
+ backdrop root,标题块里任何 backdrop-filter 从此只采样得到它自己——和第一批骨架那条
+ 用 `backwards` 不用 `both` 是同一个理由。
+- **未取得**:上游各条配方的设计原始稿、参数取值理由与许可条款仍未取得。BoardUI 的
+ Input(<https://www.boardui.com/components/input>,2026-09-17)没有清空键,Geist 那几份
+ 快照里也没有,所以这一批不新增清空控件,只做已有清空路径上的内容溶解。
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index eb86601b7..3f694763b 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -1119,7 +1119,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains(
""" ${it.location==='online'?'':`<span class="srcstate detailtitlestate" aria-live="polite"></span>`}
${ratingHtml(it.rating)}
- <div class="smeta mono">""")
+ <div class="smeta mono" data-reveal-line>""")
self.assertPageContains(
"const value=picked===before?0:picked;")
self.assertPageContains(
@@ -5749,9 +5749,11 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains('data-junk-kind-link="${esc(key)}"${current?' + repr(' aria-current="page"'))
# 计数是徽标不是标题的一部分,为 0 时整枚去掉,两条一个口径。
self.assertPageContains(
- 'count?` <span class="n mono">${count.toLocaleString()}</span>`:' + repr(''))
+ 'count?` <span class="n mono" data-count-badge="junk:${esc(key)}">'
+ '${count.toLocaleString()}</span>`:' + repr(''))
self.assertPageContains(
- 'dismissedTotal?` <span class="n mono">${dismissedTotal.toLocaleString()}</span>`:' + repr(''))
+ 'dismissedTotal?` <span class="n mono" data-count-badge="junk:dismissed">'
+ '${dismissedTotal.toLocaleString()}</span>`:' + repr(''))
self.assertPageLacks(" <span>${countFor(key).toLocaleString()}</span>")
self.assertPageContains(".junkfilters .n{color:var(--muted);"
"font-size:var(--fs-xs);font-variant-numeric:tabular-nums}")
@@ -5910,7 +5912,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("function resetHomeState(){")
self.assertPageContains("q:'',jav:'',thumb:'0'};")
self.assertPageContains("function openHome(scroll=false){")
- self.assertPageContains("resetHomeState();route('/');$('#q').value='';disposeStage(false);showHomeSurfaces();")
+ self.assertPageContains("resetHomeState();route('/');clearSearchField();disposeStage(false);showHomeSurfaces();")
self.assertPageContains("buildEdge();buildBars();load(true);")
# 抽屉和窄栏已经共用 navTo,这一句只应该存在一处;
# 两份副本正是当初把追更入口漏在抽屉里的原因。
@@ -7482,7 +7484,8 @@ class WebUiSourceTests(unittest.TestCase):
"""
board = (Path(__file__).resolve().parents[1] / "web/board.css").read_text(encoding="utf-8")
self.assertPageContains('aria-pressed="${selected}">${esc(label)}${count==null?\'\':'
- '`<span class="${esc(countClass)}">${esc(count)}</span>`}')
+ '`<span class="${esc(countClass)}" data-count-badge="${esc(value)}">'
+ '${esc(count)}</span>`}')
self.assertPageContains(".pill .n{margin-left:7px;color:var(--muted);font-size:var(--fs-xs);"
"font-variant-numeric:tabular-nums}")
self.assertPageContains('.pill[aria-pressed="true"] .n,.pill:hover .n{color:var(--ink-2)}')
@@ -7796,7 +7799,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains(".javedition.uncensored{color:var(--meter)}")
self.assertPageContains(".javedition.cracked{color:var(--drop)}")
self.assertPageContains('<button class="t cardtitle" data-open>${shownTitle}</button>')
- self.assertPageContains('<div class="stitle">${javTitleHtml(it)}')
+ self.assertPageContains('<div class="stitle" data-reveal-line>${javTitleHtml(it)}')
self.assertPageContains("$('#tokTitle').textContent=javDisplayName(it)")
self.assertPageContains("<b data-middle-truncate>${esc(javDisplayName(x))}</b>")
@@ -8203,7 +8206,7 @@ class WebUiSourceTests(unittest.TestCase):
def test_recycle_bin_has_its_own_route_and_reports_undeletable_files(self):
self.assertRoute('/trash', "section:'trash'", "openTrash(push)")
self.assertPageContains("function openTrash(push){")
- self.assertPageContains("state:'trash',q:''};$('#q').value='';")
+ self.assertPageContains("state:'trash',q:''};clearSearchField();")
self.assertPageContains("/api/trash/empty")
self.assertPageContains("r.blocked&&r.blocked.length")
@@ -8750,7 +8753,7 @@ class WebUiSourceTests(unittest.TestCase):
"""
self.assertPageContains(
'<div class="detailtitle">${srcBadge(it.location,it.cost,\'srcbig\')}\n'
- ' <div class="stitle">${javTitleHtml(it)}${partLabelBadge(it,queueContext)}'
+ ' <div class="stitle" data-reveal-line>${javTitleHtml(it)}${partLabelBadge(it,queueContext)}'
'${it.location===\'online\'?\'\':`<span class="srctools detailtitletools">'
'${sourceToolButtons(it.id)}</span>`}</div></div>')
self.assertPageContains(".detailtitle{display:flow-root;margin-bottom:10px}")
@@ -9687,7 +9690,7 @@ class WebUiSourceTests(unittest.TestCase):
# 关掉动效时两档弹簧一起归零,剩下的是瞬时到位;原地换态那三档也在同一条里。
self.assertIn("--board-motion:0s;--board-dialog-motion:0s;--spring-pane-ms:0;"
"--spring-press-ms:0;--motion-swap:0s;--motion-reveal:0s;"
- "--motion-stagger:0ms}", board)
+ "--motion-stagger:0ms;--motion-pop:0s}", board)
def test_the_theme_sweep_masks_with_a_gradient_instead_of_a_filtered_svg(self):
"""明暗切换那圈扩散用一段 CSS 渐变当遮罩,柔边靠色标位置给。
@@ -12277,6 +12280,87 @@ class MotionRecipeTests(unittest.TestCase):
self.assertNotIn("color", shake, "抖动只走 transform,颜色归原有的错误样式")
self.assertNotIn("border", shake, "抖动只走 transform,边框归原有的错误样式")
+ def test_avatar_lift_moves_only_transform_and_never_layout(self):
+ """一排头像里抬起一枚:邻座跟着让,但这一排的几何一格也不动。
+
+ 这两排横着滚,改 margin 或 width 会把后面所有人推着走,正在看的那一枚当场滑
+ 出指针。进出两条缓动由整排的 `:has(:hover)` 切换,所以这里也钉住那一对。
+ """
+ motion = (Path(__file__).resolve().parents[1]
+ / "web/css/25-motion.css").read_text(encoding="utf-8")
+ # 注释本身就在说「不许碰 margin 和 width」,所以只取注释之后那几条声明。
+ lift = motion.split("── 一排头像里指到的那一枚抬起来 ──", 1)[1].split("*/", 1)[1].split("/*", 1)[0]
+ for banned in ("margin", "width:", "gap:", "padding"):
+ with self.subTest(prop=banned):
+ self.assertNotIn(banned, lift, f"抬起来那一下不许碰 {banned}")
+ self.assertPageContains(
+ "transform:translate(var(--lift-x,0),var(--lift-y,0)) scale(var(--lift-scale,1))")
+ self.assertPageContains(
+ ":is(#tiers .tier,.followauthors,.followworks,.mavstack):has(:hover)"
+ "{--lift-motion:var(--board-motion)}")
+ # 落回走按压弹簧:站内已经有采样自真实弹簧的那一档,不另起一条近似。
+ self.assertPageContains("--lift-motion:calc(var(--spring-press-ms) * 1ms) var(--spring-press)")
+ # 那条 transition 住在 board.css:它的 shorthand 已经排着 scale 与配色,
+ # transform 只能并进同一条列表,另写一条会被它整条盖掉。
+ board = (Path(__file__).resolve().parents[1]
+ / "web/board.css").read_text(encoding="utf-8")
+ self.assertIn("transition:transform var(--lift-motion,var(--board-motion)),scale ", board)
+
+ def test_clearing_the_search_box_dissolves_the_old_text(self):
+ """输入框的 value 是一瞬间没的,飘的是照着它摆的一份复制品。
+
+ 复制品先摆好、value 当场清空,光标与输入法一刻也不等这段动画;六个清空入口
+ 共用同一个函数,漏掉一个就是那条路径上硬切。
+ """
+ self.assertPageContains("export function dissolveValue(input,host=input&&input.parentElement)")
+ self.assertPageContains("const clearSearchField=()=>dissolveValue($('#q'));")
+ self.assertPageContains("animation:clear-dissolve var(--motion-reveal) forwards")
+ app = (Path(__file__).resolve().parents[1]
+ / "web/app.js").read_text(encoding="utf-8")
+ self.assertNotIn("$('#q').value='';", app, "清空搜索框只走 clearSearchField")
+ self.assertGreaterEqual(app.count("clearSearchField();"), 6)
+
+ def test_count_badges_pop_only_for_the_ones_that_really_changed(self):
+ """这几排每换一个筛选都整块重画,按节点判等于每次筛选整列计数一起弹。"""
+ self.assertPageContains("export function popBadges(root,scope='')")
+ self.assertPageContains("if(previous===undefined||previous===next)return;\n el.classList.add('popped');")
+ # 整枚一起弹,不按位拆:徽标读的是有没有变多,按位拆是读数那一条的事。
+ # 起点那一帧不带过渡:带的话挂上去只是开始朝零缩,同一次调用里摘掉时回程无处可走。
+ self.assertPageContains(
+ ".countbadge.popped{transform:scale(0);opacity:0;filter:blur(2px);transition:none}")
+ for call in ("popBadges($('#tagScroll'),'tagbar')",
+ "popBadges($('#drawerScroll'),'drawer')",
+ "popBadges($('#count'),'junk')"):
+ with self.subTest(call=call):
+ self.assertPageContains(call)
+
+ def test_titles_reveal_by_line_and_leave_no_filter_behind(self):
+ """按行不按词:这几处标题正是最常被复制走的几段字,拆成一串 span 会散架。
+
+ 走完把类名一并摘掉。留着终点帧上那个 `filter:blur(0)`,非 none 的 filter 会
+ 另起一个 backdrop root,标题块里任何 backdrop-filter 从此只采样得到它自己。
+ """
+ self.assertPageContains("export function revealTexts(root,selector='[data-reveal-line]')")
+ self.assertPageContains("transition-delay:calc(var(--motion-stagger) * var(--reveal-at,0))")
+ self.assertPageContains(
+ ".revealline{opacity:0;transform:translateY(12px);filter:blur(3px);transition:none}")
+ self.assertPageContains(".revealline.revealing{opacity:1;transform:none;filter:blur(0);")
+ self.assertPageContains("el.classList.remove('revealline','revealing')")
+ motion = (Path(__file__).resolve().parents[1]
+ / "web/css/25-motion.css").read_text(encoding="utf-8")
+ self.assertNotIn("word-break", motion.split(".revealline", 1)[1])
+ # 换了页才揭示一遍;同一页里的每一次重画走的也是这个函数。
+ self.assertPageContains("if(label===lastManagePageLabel)return;")
+ self.assertPageContains("if(moved)revealTexts(heading.parentElement,'h2');")
+
+ def test_the_new_pop_easing_is_a_token_and_reduced_motion_zeroes_it(self):
+ """`animation` 里只能有一条缓动函数:token 已经带着一条,再写第二条整条无效。"""
+ board = (Path(__file__).resolve().parents[1]
+ / "web/board.css").read_text(encoding="utf-8")
+ self.assertIn("--motion-pop:.4s cubic-bezier(.34,1.36,.64,1)", board)
+ start = board.index("--board-motion:0s")
+ self.assertIn("--motion-pop:0", board[start:board.index("}", start)])
+
if __name__ == "__main__":
unittest.main()
diff --git a/web/app.js b/web/app.js
index 67de217c9..aa3dc3639 100644
--- a/web/app.js
+++ b/web/app.js
@@ -19,7 +19,7 @@ import { javImageKind, normalizeJavImage, normalizeJavLayout, normalizeJavPrefer
import {
attachOverlayScrollbar, breadcrumbHtml, checkboxHtml, collectionSummaryHtml, closeAnchoredMenu, confirmModal, dialSliderHtml, dismissMenu, emptyStateHtml, fieldsetTitle, selectOptionIconHtml,
fillSkeletonTier, fitSkeleton, formModal, iconSwapHtml, iconSwitchHtml, indexSkeletonHtml, loadingDotsHtml,
- popCount, revealSkeleton, setIconSwap, swapText,
+ dissolveValue, popBadges, popCount, revealSkeleton, revealTexts, setIconSwap, swapText,
mediaViewButtonsHtml, boardTabsHtml, mountFilterFrame, filterChipHtml, moveGlidePane, glideEase, sortControlsHtml, collectionHeaderHtml, wireHorizontalScroller, noteHtml, presentMenu, gaugeHtml, scrollerHtml, searchInputHtml, selectFieldHtml,
setActionBusy, skeletonHtml, spinnerHtml, growCollapse, wireAnchoredMenu, wireBusyActions, wireCollapse, wireDialSlider, wireDragReorder,
wireIconSwitch, wireOverlayScrollbars, wireScrollers, wireSelectField, wireContextCard, configurationSkeletonHtml, wireLoadMore,
@@ -316,7 +316,15 @@ const managementPlaceholder=path=>
boardPageSkeleton(path,{followLayout:followListLayout()})||
(MANAGEMENT_PLACEHOLDERS[path]||(()=>pageSkeletonHtml('正在读取页面')))();
/* 详情浮窗的正文:骨架换成真内容时交叉淡入,内容换内容(在队列里跳下一条)直接换。 */
-const paintStage=html=>revealSkeleton($('#stage'),()=>{$('#stage').innerHTML=html});
+/* 浮窗里那两行标题跟着这一次重画揭示一遍。放在这里而不是各个详情函数里:换一条片子
+ 走的也是这一条,标题因此只在「换了内容」时放一次,浮窗开着不动就不重放。 */
+const paintStage=html=>{
+ revealSkeleton($('#stage'),()=>{$('#stage').innerHTML=html});
+ /* 绕开正在淡出的那一层:`revealSkeleton` 把上一屏整块抬成 `.skelfade` 插在最前面,
+ 而详情的骨架本身就照着最终结构画,里面也有一个 `.sidecontent`。按文档顺序找的话
+ 拿到的是那一份——它上面没有揭示标记,这一句就悄悄地什么也不做。 */
+ revealTexts($('#stage'),':scope>:not(.skelfade) [data-reveal-line]');
+};
function showDetailLoading(){
const stage=$('#stage');
if(!stage.querySelector('[data-skeleton="detail"]'))stage.innerHTML=detailSkeletonHtml();
@@ -1196,24 +1204,28 @@ function resetHomeState(){
barsContext={type:'home',filters:state};detailReturnBarsContext=null;
barsDataCache=null;barsDataPromise=null;
}
+/* 离开搜索结果时把搜索框一起清掉。框里的字不是瞬间没的:`dissolveValue` 先照着它此刻
+ 的位置摆一份同样的字飘上去糊掉,输入框当场就空了,回来的人看见的是一个空框加一段
+ 刚散掉的残影,而不是「刚才那句话去哪了」。 */
+const clearSearchField=()=>dissolveValue($('#q'));
/* 「未归属」是全库那一类,不是当前这一页里的子筛选:在某位女优的资料页上再筛「没有
署名人」永远是空的。所以它和打开资料页一样离开当前语境,回目录只留这一条筛选,
顶栏芯片指的就是同一份列表。 */
function openUnowned(){
resetHomeState();state.owner='none';
- $('#q').value='';disposeStage(false);showHomeSurfaces();
+ clearSearchField();disposeStage(false);showHomeSurfaces();
route(homePath());buildEdge();buildBars();load(true);
window.scrollTo({top:0,behavior:'smooth'});
}
/* 详情页那枚产地和未归属同一种东西:它标的不是一句说明,是馆藏里一个能筛的集合。 */
function openRegion(region){
resetHomeState();state.region=region||'none';
- $('#q').value='';disposeStage(false);showHomeSurfaces();
+ clearSearchField();disposeStage(false);showHomeSurfaces();
route(homePath());buildEdge();buildBars();load(true);
window.scrollTo({top:0,behavior:'smooth'});
}
function openHome(scroll=false){
- resetHomeState();route('/');$('#q').value='';disposeStage(false);showHomeSurfaces();
+ resetHomeState();route('/');clearSearchField();disposeStage(false);showHomeSurfaces();
buildEdge();buildBars();load(true);
if(scroll)window.scrollTo({top:0,behavior:'smooth'});
}
@@ -3276,13 +3288,15 @@ function renderJunkNavigation(data){
const current=key===junkKind,count=countFor(key);
/* 同一套 Geist Tabs 徽标口径:计数为 0 时整枚去掉。这一条仍用 <a>,因为分类要落到
URL 上——规范里 Tabs 的行为条款本身就要求当前项可深链、可刷新恢复。 */
- return `<a href="${junkPath(key,junkView)}" data-junk-kind-link="${esc(key)}"${current?' aria-current="page"':''}>${icon(glyph)}${esc(label)}${count?` <span class="n mono">${count.toLocaleString()}</span>`:''}</a>`;
+ return `<a href="${junkPath(key,junkView)}" data-junk-kind-link="${esc(key)}"${current?' aria-current="page"':''}>${icon(glyph)}${esc(label)}${count?` <span class="n mono" data-count-badge="junk:${esc(key)}">${count.toLocaleString()}</span>`:''}</a>`;
}).join('');
$('#count').removeAttribute('aria-busy');
$('#count').innerHTML=`<div class="junksummary" aria-live="polite">${collectionSummaryHtml(junkView==='dismissed'?'已排除':'待判断',`${Number(data.total||0).toLocaleString()} 个`)}</div>
<nav class="junkfilters" aria-label="垃圾文件分类">${categoryLinks}<i aria-hidden="true"></i>
- <a href="${junkPath('',junkView==='dismissed'?'pending':'dismissed')}" data-junk-view-link="${junkView==='dismissed'?'pending':'dismissed'}"${junkView==='dismissed'?' aria-current="page"':''}>${icon(junkView==='dismissed'?'rotate-ccw':'eye-off')}${junkView==='dismissed'?'返回待判断':'已排除'}${dismissedTotal?` <span class="n mono">${dismissedTotal.toLocaleString()}</span>`:''}</a>
+ <a href="${junkPath('',junkView==='dismissed'?'pending':'dismissed')}" data-junk-view-link="${junkView==='dismissed'?'pending':'dismissed'}"${junkView==='dismissed'?' aria-current="page"':''}>${icon(junkView==='dismissed'?'rotate-ccw':'eye-off')}${junkView==='dismissed'?'返回待判断':'已排除'}${dismissedTotal?` <span class="n mono" data-count-badge="junk:dismissed">${dismissedTotal.toLocaleString()}</span>`:''}</a>
</nav>`;
+ // 判过一批之后各类的待处理数就变了,弹的是变了的那几枚,没动的那几类原地不动。
+ popBadges($('#count'),'junk');
$('#count').querySelectorAll('[data-junk-kind-link],[data-junk-view-link]').forEach(link=>link.onclick=event=>{
if(event.button!==0||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return;
event.preventDefault();
@@ -4090,6 +4104,7 @@ async function buildBars(){
+appliedTags.concat(pickedTags).map(tagPillHtml).join('');
wireViewPills();
wireTagPills($('#tagScroll'));
+ popBadges($('#tagScroll'),'tagbar');
wireRowPaging($('#tagScroll'),tagPool.filter(row=>!pickedKeys.has(row.k)),tagPillHtml,wireTagPills);
renderCombo(); wireAllDrag();
@@ -4100,7 +4115,7 @@ async function buildBars(){
const off=key==='loc'&&sourceOffline(it.k);
return `<button class="chip${off?' offline':''}" aria-pressed="${sel}" data-key="${key}" data-multi="${multi?1:0}"
${off?`disabled title="${OFFLINE_HINT}"`:''}
- data-val="${esc(it.k)}">${dot}<span class="chip-label">${esc(it.label||tagLabel(it.k))}</span>${it.n!=null?`<span class="n">${it.n.toLocaleString()}</span>`:''}</button>`;
+ data-val="${esc(it.k)}">${dot}<span class="chip-label">${esc(it.label||tagLabel(it.k))}</span>${it.n!=null?`<span class="n" data-count-badge="${key}:${esc(it.k)}">${it.n.toLocaleString()}</span>`:''}</button>`;
}).join('')+`</div>`:'';
// 按语义类别区分来源、创作者、内容和技术规格。
const sec=(t,b,x,cat)=>sidebarSectionHtml(t,b,x,cat);
@@ -4134,8 +4149,11 @@ async function buildBars(){
+sec('内容标签',chips(facetData.tags,'tag',false,30),facetData.tags.length>30?sidebarMoreHtml('tag','内容标签'):'','general')
+sec('影片属性',chips(facetData.tech,'tag',false,16),'','meta')
+sec('关注标签',followTagRows.length?`<div class="chips">`+followTagRows.map(row=>
- `<button class="chip online" data-follow-drawer-tag="${esc(row.k)}"><span class="chip-label">${esc(tagLabel(row.k))}</span><span class="n">${row.n.toLocaleString()}</span></button>`
+ `<button class="chip online" data-follow-drawer-tag="${esc(row.k)}"><span class="chip-label">${esc(tagLabel(row.k))}</span><span class="n" data-count-badge="follow:${esc(row.k)}">${row.n.toLocaleString()}</span></button>`
).join('')+`</div>`:'','','online');
+ /* 抽屉每次筛选都整块重画,所以徽标弹不弹由 `popBadges` 按上一次的值判断,不由节点
+ 是不是新建的判断——照后者判,每换一个筛选整列计数都会一起弹。 */
+ popBadges($('#drawerScroll'),'drawer');
const dc=$('#drawerClose'); if(dc)dc.onclick=()=>openDrawer(false);
$('#drawer').querySelectorAll('[data-page]').forEach(b=>b.onclick=()=>{
openIndex(b.dataset.page); closeDrawerAfterNav()});
@@ -4558,14 +4576,14 @@ async function openResourceSync(push=true){
function openTasteSignal(kind,name){
if(kind==='tag'){
state={...state,tag:name,tag_match:'all',creator:'',studio:'',q:'',state:'',orient:''};
- $('#q').value='';route(homePath());showHomeSurfaces();buildBars();load(true);return
+ clearSearchField();route(homePath());showHomeSurfaces();buildBars();load(true);return
}
openEntity(kind,name);
}
async function openTaste(push=true){
releaseHoverPreviews();disposeStage(false);enterManagementSurface();
state={...state,creator:'',studio:'',tag:'',tag_match:'all',len:'',dur_min:'',dur_max:'',orient:'',region:'',state:'',q:'',jav:''};
- $('#q').value='';
+ clearSearchField();
if(push)route('/taste');
const surface=claimSurface('/taste');
showManagementBody({placeholder:managementPlaceholder('/taste')});
@@ -5434,10 +5452,10 @@ async function openFollowDetail(id,push=true,mediaIndex=null,preserveReturn=fals
<div class="vwrap followdetailmedia${selectedKind==='image'?' image':''}${frameRatio?' framed':''}"${frameRatio?` style="--follow-frame-ratio:${frameRatio.toFixed(4)}"`:''}>${selectedKind==='video'?'<canvas class="ambientcanvas" width="32" height="18"></canvas>':''}<button class="closestage" id="closeStage" title="关闭" aria-label="关闭">${icon('x')}</button>${selectedKind==='video'?playerStatsOverlayHtml():''}${media}${imageControls}</div>
${embeddedQueue?followEmbeddedQueueHtml(item,selectedMedia.index):(collection?followQueueHtml(collection,item.id):'')}
<div class="side followdetailside"><div class="sidecontent">
- <div class="followdetailtitle"><div class="stitle">${esc(item.title)}</div>${item.url?`<a class="followorigin externallink" href="${esc(item.url)}" target="_blank" rel="noreferrer noopener" title="打开来源页面" aria-label="打开来源页面">${icon('external-link','externalmark')}</a>`:''}</div>
+ <div class="followdetailtitle"><div class="stitle" data-reveal-line>${esc(item.title)}</div>${item.url?`<a class="followorigin externallink" href="${esc(item.url)}" target="_blank" rel="noreferrer noopener" title="打开来源页面" aria-label="打开来源页面">${icon('external-link','externalmark')}</a>`:''}</div>
<div class="followdetailidentity"><span class="mav fsourceavatar">${followAuthorAvatar(authorSources)}</span>
<div><b>${esc(author)}</b>${postedBy?`<span>发布者 ${esc(postedBy)}</span>`:''}</div></div>
- <div class="smeta mono"><span>${followWhen(item)}</span>${realDuration(item.duration)?`<span>${fmtDur(item.duration)}</span>`:''}${badges?`<span class="fbadges">${badges}</span>`:''}</div>
+ <div class="smeta mono" data-reveal-line><span>${followWhen(item)}</span>${realDuration(item.duration)?`<span>${fmtDur(item.duration)}</span>`:''}${badges?`<span class="fbadges">${badges}</span>`:''}</div>
${item.summary?`<p class="followdetailsummary">${esc(item.summary)}</p>`:''}
${mediaIssue?`<p class="fnote followmediaissue">${esc(mediaIssue)}</p>`:''}
<p class="fnote followmediaissue" data-media-load-issue hidden>媒体没有取回来:上游这一次没给出内容,多半是站点在限流——过一阵再打开。</p>
@@ -7876,6 +7894,8 @@ function buildManageBar(){
/* 数据管理五张卡对应的子页(vercel.com/geist/breadcrumbs:有上一级页面的
子页才画面包屑)。人工复核、回收站、高清版虽也保留侧栏直达入口,
层级上仍从数据管理进;空文件夹是 hub 上的就地操作,没有独立页面。 */
+//: 上一次页面标题说的是哪一页。空串表示此刻没有管理区标题(首页、目录这些)。
+let lastManagePageLabel='';
const MANAGE_CRUMB_PAGES={
'/junk-files':'垃圾文件',
'/duplicates':'重复文件',
@@ -7905,6 +7925,14 @@ function paintManageTitle(){
if(entry)el.textContent=pageLabel||entry[1];
paintManageCrumb();
paintManageLede();
+ /* 换了页才揭示一遍。同一页里的每一次重画(筛选、判完一批、翻页)走的也是这个函数,
+ 不比一下标题的话,页面标题会跟着每一次取数再飘一次。
+ 统计页正文里那几块节标题归 React 那一档(ADR-0031),这一批不动 React 子树;
+ 这里放的是统计、复核、数据管理共用的那一块页面标题。 */
+ const label=el.hidden?'':el.textContent;
+ if(label===lastManagePageLabel)return;
+ lastManagePageLabel=label;
+ if(label)revealTexts(document,'#manageTitle:not([hidden]),#manageLede:not([hidden])');
}
function paintManageCrumb(){
const el=$('#manageCrumb');if(!el)return;
@@ -8715,10 +8743,10 @@ async function openItem(id,push=true,queueContext=null,anchor=null){
</div>${queueContext?queueHtml(queueContext,it.id):''}
<div class="side"><div class="sidecontent">
<div class="detailtitle">${srcBadge(it.location,it.cost,'srcbig')}
- <div class="stitle">${javTitleHtml(it)}${partLabelBadge(it,queueContext)}${it.location==='online'?'':`<span class="srctools detailtitletools">${sourceToolButtons(it.id)}</span>`}</div></div>
+ <div class="stitle" data-reveal-line>${javTitleHtml(it)}${partLabelBadge(it,queueContext)}${it.location==='online'?'':`<span class="srctools detailtitletools">${sourceToolButtons(it.id)}</span>`}</div></div>
${it.location==='online'?'':`<span class="srcstate detailtitlestate" aria-live="polite"></span>`}
${ratingHtml(it.rating)}
- <div class="smeta mono">
+ <div class="smeta mono" data-reveal-line>
<span class="detailmetaitem">${icon('monitor')}<span>${it.width||'?'}×${it.height||'?'}</span></span>
<span class="detailmetaitem">${icon('hard-drive')}<span>${fmtSize(it.size||0)}</span></span>
${it.release_date?`<span class="detailmetaitem">${icon('calendar')}<span>${esc(it.release_date)}</span></span>`:''}
@@ -9604,7 +9632,7 @@ function openCatalog(path){
/* 回收站。它和目录页共用同一张网格,只是筛选被钉死成 `trash`。 */
function openTrash(push){
if(push)route('/trash');
- state={...state,creator:'',studio:'',tag:'',orient:'',state:'trash',q:''};$('#q').value='';
+ state={...state,creator:'',studio:'',tag:'',orient:'',state:'trash',q:''};clearSearchField();
showHomeSurfaces();buildEdge();buildBars();load(true);
}
/* 索引页(女优/创作者/标签)三条路由共用。
@@ -9725,7 +9753,12 @@ function localTabs(root,sections,host=root){
const choose=index=>{
const moved=active!==index;
active=index;
- if(host!==root){const heading=host.querySelector('.settingshead h2');if(heading)heading.textContent=items[index].title;root.scrollTop=0}
+ if(host!==root){const heading=host.querySelector('.settingshead h2');
+ if(heading){heading.textContent=items[index].title;
+ /* 只在换了分区时揭示。`choose(0)` 还会在面板收着的时候跑一遍对齐玻璃,
+ 那一次标题没换,跟着放就成了开面板时莫名其妙飘一下。 */
+ if(moved)revealTexts(heading.parentElement,'h2');}
+ root.scrollTop=0}
/* 先全清再点亮当前这一条。同一个节点可能挂在好几条下面(「这台电脑」那一格的外壳
就是),一条一条 toggle 的话后面那条会把前面点亮的又抹掉。 */
items.forEach(item=>item.nodes.forEach(node=>node.classList.remove('board-group-active')));
diff --git a/web/board.css b/web/board.css
index eec3c2c00..6f857995b 100644
--- a/web/board.css
+++ b/web/board.css
@@ -822,7 +822,11 @@ body>.board-filter-frame{margin-inline:16px}
字形和文字原地不动只换外观走 250ms,骨架换内容要跨整块区域走 400ms。
`--motion-stagger` 是多位数字按位错峰的步长,它跟时长一样要在 reduced motion 下归零——
动画时长归零而延迟还在的话,`both` 会把前几位按住不显示,读数看上去缺了几位。 */
-:root{--motion-swap:.25s cubic-bezier(.4,0,.2,1);--motion-reveal:.4s cubic-bezier(.4,0,.2,1);--motion-stagger:70ms}
+/* `--motion-pop` 是「这一枚刚冒出来」那一下:跨度和骨架换内容同为 400ms,缓动却必须
+ 带超调——徽标从零长到原大小,匀速收尾读成「被撑开的」,过一点再收住才读成「弹出来的」。
+ 缓动不同就不能借 `--motion-reveal`:那两档的缓动写在 token 里,动画里再写第二条
+ 缓动是无效声明,整条 `animation` 会被丢掉。 */
+:root{--motion-swap:.25s cubic-bezier(.4,0,.2,1);--motion-reveal:.4s cubic-bezier(.4,0,.2,1);--motion-stagger:70ms;--motion-pop:.4s cubic-bezier(.34,1.36,.64,1)}
body{font-size:14px;line-height:20px}
button,input,select,textarea{font-family:inherit}
.index .ihead{padding:4px;gap:12px;min-width:0;flex-wrap:wrap}
@@ -903,7 +907,7 @@ html.board-high-contrast .settingscard.settingscard>.board-local-nav{background:
.settingscard .settingsscroll .gselect,.settingscard .settingsscroll .gselectfield{height:40px;font-size:14px}
.settingscard .settingsscroll .board-number-control>span{font-size:14px}
}
-@media(prefers-reduced-motion:reduce){:root{--board-motion:0s;--board-dialog-motion:0s;--spring-pane-ms:0;--spring-press-ms:0;--motion-swap:0s;--motion-reveal:0s;--motion-stagger:0ms}.settingscard .settingshead::after{transition:none}}
+@media(prefers-reduced-motion:reduce){:root{--board-motion:0s;--board-dialog-motion:0s;--spring-pane-ms:0;--spring-press-ms:0;--motion-swap:0s;--motion-reveal:0s;--motion-stagger:0ms;--motion-pop:0s}.settingscard .settingshead::after{transition:none}}
/* Stat Cards 的内层读数与底栏;统计卡仍是可键盘切换的视图入口。 */
/* 侧栏分组使用标题行与带计数的叶项。 */
.drawer.drawer{display:flex;flex-direction:column;overflow:hidden}
@@ -1483,7 +1487,7 @@ body .followmanage .board-pagination>.geist-button{height:32px;min-height:32px;p
住在 `#stats` 里而不是 `#tiers` 里,只按 id 写的话关注页拿不到这一整套,落回 flat
层那份 64px 头像加一圈描边,同一个人在两页大小和选中样子都不一样。 */
#tiers .av,#tiers .brandpill,
-:is(.followauthors,.followworks) .av,:is(.followauthors,.followworks) .brandpill{flex:none;border:0;background:transparent;color:var(--color-text-secondary);font:var(--board-body-medium);white-space:nowrap;transition:scale calc(var(--spring-press-ms) * 1ms) var(--spring-press),background-color .2s ease-out,color .2s ease-out}
+:is(.followauthors,.followworks) .av,:is(.followauthors,.followworks) .brandpill{flex:none;border:0;background:transparent;color:var(--color-text-secondary);font:var(--board-body-medium);white-space:nowrap;transition:transform var(--lift-motion,var(--board-motion)),scale calc(var(--spring-press-ms) * 1ms) var(--spring-press),background-color .2s ease-out,color .2s ease-out}
#tiers .av:active,#tiers .brandpill:active,
:is(.followauthors,.followworks) .av:active,:is(.followauthors,.followworks) .brandpill:active{scale:.96;transition:scale .06s ease-out}
#tiers .av,:is(.followauthors,.followworks) .av{display:flex;flex-direction:column;align-items:center;gap:6px;width:76px;max-width:none;height:auto;padding:6px 4px;border-radius:12px;text-align:center}
diff --git a/web/css/25-motion.css b/web/css/25-motion.css
index 0c71c549a..32eeae6dc 100644
--- a/web/css/25-motion.css
+++ b/web/css/25-motion.css
@@ -86,3 +86,73 @@
100%{transform:translateX(0)}}
:is(input,textarea,select)[aria-invalid="true"],
.board-number-control:has([aria-invalid="true"]){animation:field-shake var(--board-motion)}
+
+/* ── 一排头像里指到的那一枚抬起来 ──
+ 指到的抬 4px 并放大一档,左右邻座按 .45 的衰减跟着抬一点:只抬一枚读成「这一枚出了
+ 毛病」,整排按距离递减地让一下才读成「这一排让开给它」。衰减到第三位只剩 .36px,
+ 肉眼分不出,所以选择器只写到两位,不为看不见的那一档再铺一层。
+
+ 全程只动 transform:这一排横着滚,改 margin 或 width 会把后面所有人推着走,正在
+ 看的那一枚当场滑出指针。叠放的那一组另外左右推开——它们本来压着彼此 14px,只抬不推
+ 等于抬起一枚仍被邻座压着半张脸。
+
+ 进出各用一条缓动,由整排的 `:has(:hover)` 切换,不写 JS:指上去走站内通用那条,
+ 松开走按压弹簧,冲过原位再收回来。`--lift-motion` 读在 board.css 那条 transition
+ 里(`#tiers .av` 那一族),因为那条 shorthand 已经排着 scale 与配色,transform
+ 只能并进同一条列表。 */
+:is(#tiers .tier,.followauthors,.followworks,.mavstack){
+ --lift-motion:calc(var(--spring-press-ms) * 1ms) var(--spring-press)}
+:is(#tiers .tier,.followauthors,.followworks,.mavstack):has(:hover){--lift-motion:var(--board-motion)}
+:is(#tiers,.followauthors,.followworks) :is(.av,.brandpill),.mavstack .mav{
+ transform:translate(var(--lift-x,0),var(--lift-y,0)) scale(var(--lift-scale,1))}
+.mavstack .mav{transition:transform var(--lift-motion,var(--board-motion))}
+:is(#tiers .tier,.followauthors,.followworks) :is(.av,.brandpill):hover,
+.mavstack .mav:hover{--lift-y:-4px;--lift-scale:1.05}
+:is(#tiers .tier,.followauthors,.followworks) :is(.av,.brandpill):hover+:is(.av,.brandpill),
+:is(#tiers .tier,.followauthors,.followworks) :is(.av,.brandpill):has(+:is(.av,.brandpill):hover){--lift-y:-1.8px}
+:is(#tiers .tier,.followauthors,.followworks) :is(.av,.brandpill):hover+:is(.av,.brandpill)+:is(.av,.brandpill),
+:is(#tiers .tier,.followauthors,.followworks) :is(.av,.brandpill):has(+:is(.av,.brandpill)+:is(.av,.brandpill):hover){--lift-y:-.81px}
+.mavstack .mav:hover+.mav{--lift-y:-1.8px;--lift-x:7px}
+.mavstack .mav:hover+.mav+.mav{--lift-y:-.81px;--lift-x:10px}
+.mavstack .mav:has(+.mav:hover){--lift-y:-1.8px;--lift-x:-7px}
+.mavstack .mav:has(+.mav+.mav:hover){--lift-y:-.81px;--lift-x:-10px}
+
+/* ── 清空时输入的内容溶解掉 ──
+ 输入框自己的 value 是一瞬间没的,没有动画可挂。所以清空前先照着输入框的位置和字体
+ 摆一份同样的字,让它往上飘 12px、糊掉、淡出,真正的输入框当场就空了——光标和输入法
+ 一刻也不等这段动画。这一层不可点、不读屏,走完自己摘掉。
+
+ 上游还在同一条配方里给每个词铺一层 radial-gradient 做扫光,那部分要逐帧写背景才
+ 画得出来,这里不做:搜索框每清一次就跑一段逐帧 JS,换来的是一道一眼看不出来的光。 */
+@keyframes clear-dissolve{to{opacity:0;filter:blur(2px);transform:translateY(-12px)}}
+.cleardissolve{position:absolute;z-index:1;display:flex;align-items:center;overflow:hidden;
+ white-space:nowrap;pointer-events:none;color:inherit;
+ animation:clear-dissolve var(--motion-reveal) forwards}
+
+/* ── 计数徽标弹出来 ──
+ 从零长到原大小,同时从模糊里清晰起来。整枚一起弹,不按位拆:这一枚说的是「这里有
+ 几条」,读的是有没有变多,不是变成了哪几个数字——按位拆是读数那一条的事。
+ `--motion-pop` 的缓动过一点再收住,落位才读成「弹出来的」。
+
+ `.popped` 是起点帧,摘掉就往原位走。它自己那一帧不带过渡:带的话,挂上去这一枚就
+ 开始朝零缩,同一次调用里紧接着摘掉时它才走了零点几个像素,回程于是无处可走——屏幕上
+ 什么也没发生。首屏那一批不挂这个类:整排计数一起弹是一屏烟花,而它要说的是
+ 「这一枚刚变了」。 */
+.countbadge{display:inline-block;transition:transform var(--motion-pop),
+ opacity var(--motion-pop),filter var(--motion-pop)}
+.countbadge.popped{transform:scale(0);opacity:0;filter:blur(2px);transition:none}
+
+/* ── 标题从模糊里揭示出来 ──
+ 每一行从下方 12px 处带模糊长上来,相邻两行差一个 `--motion-stagger`。按行不按词:
+ 逐词要把整句拆成一串 `<span>`,复制出来的文字会跟着散架,而这几处标题(作品名、
+ 页面名)正是最常被复制走的那几段字。
+
+ 走完把类名一起摘掉。留着的话终点帧上还挂着一个 `filter:blur(0)`,非 none 的 filter
+ 会另起一个 backdrop root,标题块里任何 backdrop-filter 从此只采样得到它自己。
+
+ 起点那一帧不带过渡:这几处标题里有一半是一直在页面上的节点(页面标题、设置面板的
+ 分区名),带过渡的话挂上去只是开始朝下淡,下一帧点亮时回程只剩零点几个像素。 */
+.revealline{opacity:0;transform:translateY(12px);filter:blur(3px);transition:none}
+.revealline.revealing{opacity:1;transform:none;filter:blur(0);
+ transition:opacity var(--motion-reveal),transform var(--motion-reveal),filter var(--motion-reveal);
+ transition-delay:calc(var(--motion-stagger) * var(--reveal-at,0))}
diff --git a/web/js/ui-components.js b/web/js/ui-components.js
index 2944d0a23..89b71c695 100644
--- a/web/js/ui-components.js
+++ b/web/js/ui-components.js
@@ -9,7 +9,7 @@ export function filterChipHtml(label,{attr,value,selected=false,count,className=
/* 计数前不写空格。`.pill` 是 flex 容器,纯空白的文本节点不参与布局,写了也量不出
一个像素——间隔归 `.pill .n` 的 margin,写在两处就是两份真相,而其中一份从来
没生效过。 */
- return `<button type="button" class="pill${className?' '+esc(className):''}" ${attr}="${esc(value)}" aria-pressed="${selected}">${esc(label)}${count==null?'':`<span class="${esc(countClass)}">${esc(count)}</span>`}</button>`;
+ return `<button type="button" class="pill${className?' '+esc(className):''}" ${attr}="${esc(value)}" aria-pressed="${selected}">${esc(label)}${count==null?'':`<span class="${esc(countClass)}" data-count-badge="${esc(value)}">${esc(count)}</span>`}</button>`;
}
/* `extra` 排在换一批与排序键之间。那个位置放的是版式、大小这类「这批东西怎么摆」的
开关,以及跟换一批同类的动作键;排序键一律排在最末,挨着它说明的那批内容。 */
@@ -121,6 +121,82 @@ export function revealSkeleton(container,write){
setTimeout(()=>{if(fade.isConnected){fade.removeEventListener('transitionend',done);drop()}},1000);
}
+/**
+ * 清空输入框,框里那段字往上飘着糊掉。
+ *
+ * 输入框的 value 是一瞬间没的,动画只能挂在别处:这里照着它此刻的位置和字体摆一份同样
+ * 的字,让那一份去飘,真正的输入框当场就空了,光标和输入法一刻也不等。`host` 缺省取
+ * 输入框的父元素,它必须是定位祖先,否则这一层会飘到页面左上角去。
+ */
+export function dissolveValue(input,host=input&&input.parentElement){
+ if(!input||!host)return;
+ const text=input.value;
+ input.value='';
+ if(!text||!input.isConnected)return;
+ const box=input.getBoundingClientRect(),frame=host.getBoundingClientRect();
+ if(!box.width)return;
+ const ghost=document.createElement('span');
+ ghost.className='cleardissolve';
+ ghost.setAttribute('aria-hidden','true');
+ ghost.textContent=text;
+ const style=getComputedStyle(input);
+ Object.assign(ghost.style,{left:`${box.left-frame.left}px`,top:`${box.top-frame.top}px`,
+ width:`${box.width}px`,height:`${box.height}px`,font:style.font,letterSpacing:style.letterSpacing});
+ host.append(ghost);
+ const drop=()=>ghost.remove();
+ ghost.addEventListener('animationend',drop,{once:true});
+ /* 兜底:`--motion-reveal` 归零或这一刻元素不可见时 `animationend` 不会来,
+ 不兜的话这份复制品就永远盖在输入框上。 */
+ setTimeout(drop,1000);
+}
+
+/* 计数徽标上一次是多少。徽标所在的那一排每次筛选都整块重画,节点本身留不住上一个值,
+ 所以记在这里,键由调用方给的范围加徽标自己的键拼成。 */
+const badgeCounts=new Map();
+/**
+ * 一排计数徽标里值真变了的那几枚弹一下,其余的不动。
+ *
+ * 首次见到某一枚不弹:那是它第一次出现在这个范围里,整排一起弹是一屏烟花,而它要说的
+ * 是「这一枚刚变了」。`scope` 区分同一个键在不同排里的计数(顶部筛选条和抽屉各有一份)。
+ */
+export function popBadges(root,scope=''){
+ if(!root)return;
+ root.querySelectorAll('[data-count-badge]').forEach(el=>{
+ const key=`${scope}${el.dataset.countBadge}`,next=el.textContent||'';
+ const previous=badgeCounts.get(key);
+ badgeCounts.set(key,next);
+ el.classList.add('countbadge');
+ if(previous===undefined||previous===next)return;
+ el.classList.add('popped');
+ el.getBoundingClientRect();
+ el.classList.remove('popped');
+ });
+}
+
+/**
+ * 一段标题从模糊里逐行揭示出来。
+ *
+ * 按行不按词:逐词要把整句拆成一串 `<span>`,复制出来的文字会跟着散架,而这几处标题
+ * 正是最常被复制走的那几段字。走完把类名和行序一起摘掉,终点帧不留下 `filter`。
+ */
+export function revealTexts(root,selector='[data-reveal-line]'){
+ if(!root)return;
+ const lines=[...root.querySelectorAll(selector)];
+ if(!lines.length)return;
+ /* 起止两个状态都挂在行自己身上,不挂在外面那一层:这几处标题里有一对是 `<body>` 的
+ 直接子元素(页面标题和它的说明行),要共同的祖先就只剩 body 本身。 */
+ lines.forEach((el,i)=>{el.classList.remove('revealing');el.classList.add('revealline');
+ el.style.setProperty('--reveal-at',String(i))});
+ lines[0].getBoundingClientRect();
+ lines.forEach(el=>el.classList.add('revealing'));
+ const drop=()=>lines.forEach(el=>{el.classList.remove('revealline','revealing');
+ el.style.removeProperty('--reveal-at')});
+ const last=lines[lines.length-1];
+ const done=event=>{if(event.target!==last)return;last.removeEventListener('transitionend',done);drop()};
+ last.addEventListener('transitionend',done);
+ setTimeout(()=>{if(last.classList.contains('revealline')){last.removeEventListener('transitionend',done);drop()}},1200);
+}
+
const horizontalControls=new Map();
let horizontalCleanup;
/** 同一容器只绑定一次,滚到边缘后将滚轮交还页面。 */