Skip to content

armgit / peach

Public Imported from GitHub
0

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

feat(web): 资料页与关注页按 Board 重排

longmeidao265d136ab1ce
diff --git a/docs/BOARD_UI.md b/docs/BOARD_UI.md
index 366e173de..f56fe5dc2 100644
--- a/docs/BOARD_UI.md
+++ b/docs/BOARD_UI.md
@@ -271,6 +271,22 @@ Radio card 沿用 2026-09-08 取得的 `r/checkbox-card.json`(`checkbox-card.t
| 复核骨架 | Skeleton 只是占位形状 | 骨架直接用最终容器的类名(`.review-workspace`、`.reviewcontrols`、`.reviewbulktoolbar`、`.reviewlist`),分栏、列宽、卡高全由复核页自己那套规则给;`renderInitialSurfaceLoading()` 先写 `data-surface` 才画,否则深链冷启动会先按默认版式铺一遍再跳。分类名是静态文案直接显示,只有计数和三件工具条控件是占位 |
| 骨架里的悬浮框 | 无对应 | 骨架没有分组条可接,工具条自己封口:四角都圆、四边都描,也不吸顶——`updateReviewSticky` 要等数据到货才有东西可量 |
+### 艺人/厂牌资料页与关注页(2026-09-12)
+
+证据在 `attic/evidence/20260912-boardui-profile-tabs/`:`tabs.json`(SHA-256
+`feab9789b17008436597b51e52b90de5cff6180924f2a7c8bef14a2136d3a240`,13612 B)、`avatar.json`
+(`614f2a38…b28aec`)、`chip.json`(`d2b0dd38…e282de`)、`badge.json`(`264755bb…9aec6`)。
+`card`、`page-header`、`profile-card` 三个注册表条目 404,未取得:资料卡的形沿用 2026-09-08
+取得的关注管理页那只 `.fsec`,不另补猜测。
+
+| 位置 | 上游 | Peach |
+| --- | --- | --- |
+| 资料卡 | 未取得(card/profile-card 404);卡形沿用 `.fsec`:secondary 底、18px 圆角、不描边、卡脚 `--board-card-foot` | `<section class="entityhero">`:`.entityprofile` 里 120px 头像加身份三行——名字 Title 3(24/32、500)、别名·视频数·事务所、外链排成 36px/10px 圆角的 secondary Button;同台艺人收进卡脚 `.entityfoot` 那条带,它是这个人的附注,不是正文;事务所的名册是正文,走 Tabs 里那一档。窄屏卡不变,只有卡里正文那一格改成单列居中、头像 96px |
+| 视频/照片/艺人切换 | `tabs.tsx`:tab `px 10 / py 8`、gap 4、Body 1 14/20,容器 `border-b border-separator-border`;指示条 `h-0.5 bg-accent-600 transition-[transform,width] duration-200`;计数徽标 `rounded-sm px-1 py-px text-caption-1-medium`,选中 `bg-tab-count-selected-background text-accent-600`,未选 `bg-black/10 text-text-primary opacity-50` | `boardTabsHtml()` 出 `.board-local-nav.entitytabs`(`role=tablist`+`aria-selected`),排在资料卡下、筛选浮层上;蓝线由 `wireBoardTabs` 观察 `aria-selected` 去挪,点下去当场改属性、不等图墙回来;只有多于一档时才出。筛选条左端不放媒体圆键,也没有那块圆玻璃(`viewglide-round`)——这排换的是整页内容,是导航,不是筛选 |
+| 资料页筛选条 | 无对应 | 只剩四枚观看状态和标签,`aria-label` 改「观看状态与标签」;照片、名册视图下整条收起,浮层只剩下面那排抬头 |
+| 关注页 | 无对应(上游没有更新流页) | 对齐首页而不是另起一套:作者行是 `.tier`,筛选条 `.tagbar` 与读数 `.count` 收进同一块 `mountFilterFrame` 浮层。五枚状态是首页四枚视图的同一个控件,共用那块滑动玻璃(`GLIDE_ROWS.views` 多认 `.followviews`);来源图标与标签在右半截横滚,来源类型的着色只在选中时上色。下排读数照首页写「N 项更新 · 显示 M」,右端是视频/图片两枚圆键,选中那枚铺选中态玻璃。「管理关注」降为次级按钮,蓝色留给空态里的「添加关注」;底部「加载更多」旁不再重复读数 |
+| 两页骨架 | Skeleton 只是占位形状 | 都把 `.board-filter-frame` 外框和上下两排的 `data-filter-row` 写全,否则等的那几秒钟是两块各带圆角的浮层;资料页骨架用 `.entityprofile`/`.entityidentity` 的真实类名,筛选条那排用 `data-skeleton-tier="pill"` 铺药丸 |
+
## 首次设置 Auth Card
Button 取证(2026-09-10):对照官网 `/components/button` 与保存的
diff --git a/frontend/src/entity-skeleton.ts b/frontend/src/entity-skeleton.ts
index ed90abd91..2f38f09cc 100644
--- a/frontend/src/entity-skeleton.ts
+++ b/frontend/src/entity-skeleton.ts
@@ -9,12 +9,12 @@ export function entitySkeletonHtml(kind: string, head: string, body: string) {
const square = kind === 'studio' || kind === 'agency';
return `<section data-skeleton="entity/${kind}" role="status" aria-label="正在读取资料">
<span class="sr-only">正在读取资料</span><div aria-hidden="true">
- <div class="entityhero"><div class="entityportrait ${square ? 'square ' : ''}skeleton"></div>
- <div class="entityskeletontext"><div class="entitytitle"><h2 class="skeleton">&nbsp;</h2></div>
+ <section class="entityhero"><div class="entityprofile"><div class="entityportrait ${square ? 'square ' : ''}skeleton"></div>
+ <div class="entityidentity entityskeletontext"><div class="entitytitle"><h2 class="skeleton">&nbsp;</h2></div>
<div class="alias"><span class="skeleton"></span></div>
- <div class="entitylinks"><span class="skeleton"></span></div></div></div>
+ <div class="entitylinks"><span class="skeleton"></span></div></div></div></section>
<div class="board-filter-frame" data-filter-frame>
- <section class="entitytagbar" data-filter-row="top"><div class="entitytags"><span class="skeleton entitymediaskeleton"></span><span class="skeleton entitymediaskeleton"></span></div></section>
+ <section class="entitytagbar" data-filter-row="top"><div class="filterscroll" data-skeleton-tier="pill"></div></section>
${head}</div>
<div class="entitysection">${body}</div></div></section>`;
}
diff --git a/tests/test_follow_web.py b/tests/test_follow_web.py
index f9279d24c..f9d922c8a 100644
--- a/tests/test_follow_web.py
+++ b/tests/test_follow_web.py
@@ -2571,9 +2571,12 @@ class FollowWebSourceTests(unittest.TestCase):
def test_follow_horizontal_rails_are_wired_after_each_render(self):
self.assertPageContains("wireDrag($('#stats').querySelector('.followauthors'))")
- self.assertPageContains("wireDrag($('#stats').querySelector('.followfilters'))")
+ # 筛选条挂进首页那块浮层之后,横滚的是里面的 `.filterscroll`/`.tagscroll`,不是整条。
+ self.assertPageContains("wireDrag(filterRow.querySelector('.filterscroll'));wireDrag(filterRow.querySelector('.tagscroll'))")
+ self.assertPageContains("wireHorizontalScroller(filterRow.querySelector('.tagscroll'))")
self.assertPageContains(".followauthors{padding:3px 0 10px")
- self.assertPageContains(".followfilters::-webkit-scrollbar{display:none}")
+ self.assertPageContains(".tagscroll::-webkit-scrollbar{display:none}")
+ self.assertPageLacks(".followfilters{position:relative")
def test_credentials_are_typed_into_the_page_not_into_a_file_by_hand(self):
self.assertPageContains('data-cred-form=')
@@ -3053,14 +3056,15 @@ class FollowWebSourceTests(unittest.TestCase):
self.assertPageContains("const preferredKind=followMediaView==='images'?'image':'video'")
watch = self.page.split("function renderFollow(){", 1)[1].split(
"function followBackfillState", 1)[0]
+ # 上排左端是五枚状态,媒体类型不在这一排:它住在浮层下排右端。
self.assertIn(
- 'class="tagbar followfilters" aria-label="关注筛选">${followMediaControl(mediaCounts)}${FOLLOW_FILTERS.map',
- watch,
- )
- self.assertNotIn(
- '<span class="sep" aria-hidden="true"></span>${followMediaControl(mediaCounts)}',
+ 'class="tagbar followfilters" aria-label="关注筛选"><div class="filterscroll">'
+ '<div class="viewpills followviews" role="group" aria-label="状态">${FOLLOW_FILTERS.map',
watch,
)
+ self.assertIn("const mediaControl=followMediaControl(mediaCounts);", watch)
+ self.assertIn("mountFilterFrame(filterRow,countRow,{views:filterRow.querySelector('.followviews'),", watch)
+ self.assertNotIn("${followMediaControl(mediaCounts)}${FOLLOW_FILTERS", watch)
self.assertPageContains("followMediaView==='images'?' followphotowall':''")
self.assertPageContains(".followlist.followphotowall{grid-template-columns:repeat(5,minmax(0,1fr))")
self.assertPageLacks(".followlist.followphotowall>.stage{column-span:all}")
@@ -3157,7 +3161,9 @@ class FollowWebSourceTests(unittest.TestCase):
self.assertPageContains('@media (max-width:640px){.followhead{align-items:center}')
def test_manage_follow_is_a_geist_action_not_a_filter_pill(self):
- self.assertPageContains('class="fbtn primary fcheck" data-follow-manage')
+ # 它是去另一页的入口,不是这一页的主动作:蓝色留给空态里那枚「添加关注」。
+ self.assertPageContains('class="fbtn fcheck" data-follow-manage')
+ self.assertPageLacks('class="fbtn primary fcheck"')
rule = self.page[self.page.index(".follow .fcheck{"):
self.page.index("}", self.page.index(".follow .fcheck{"))]
self.assertNotIn("--pill-radius", rule)
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index fbf6a39d0..2f1d39880 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -747,7 +747,8 @@ class WebUiSourceTests(unittest.TestCase):
self.assertIn(":root{--tag-radius:8px}", board)
self.assertNotIn(".detailtag{", board, "基底那颗的脸归 --tag-fill 与 --tag-radius 管")
# 筛选条与资料页那两排也从同一个 token 取形状,只有描边换成玻璃上的那一档。
- self.assertIn(".board-filter-frame.board-filter-frame #tagbar .pill[data-tag]"
+ self.assertIn(".board-filter-frame.board-filter-frame .tagbar .pill"
+ ":is([data-tag],[data-follow-tag],[data-follow-provider])"
"{border-radius:var(--tag-radius);border-color:var(--glass-low)}", board)
self.assertIn("border-radius:var(--tag-radius);border:1px solid var(--glass-low)", board)
@@ -2038,7 +2039,7 @@ class WebUiSourceTests(unittest.TestCase):
# 的链接。纯图标没有可读文字,所以标签必须留给辅助技术,不能整个丢掉。
self.assertPageContains('<a class="iconlink" href="${esc(x.url)}"')
self.assertPageContains('<span class="sr-only">${esc(x.label)}</span></a>')
- self.assertPageContains('.entitylinks a.iconlink{padding:4px;gap:0;border-radius:50%}')
+ self.assertPageContains('.entitylinks a.iconlink{width:36px;padding:0;gap:0;justify-content:center}')
def test_an_official_link_shows_its_domain_next_to_the_sites_own_mark(self):
# 文字是域名——这条链接里唯一确定的东西;图标是站点自己那枚,说的是「这是哪家」。
@@ -2048,7 +2049,7 @@ class WebUiSourceTests(unittest.TestCase):
# 别人的脸。取不到图时 `data-drop="self"` 撤掉 img,露出底下那枚地球。
self.assertPageContains('<a class="urllink" href="${esc(x.url)}"')
self.assertPageContains("${esc(linkHost(x.url)||x.label)}")
- self.assertPageContains(".entitylinks a.urllink{padding:4px 12px 4px 4px")
+ self.assertPageContains(".entitylinks a.urllink{letter-spacing:.02em}")
links = self.app_js[self.app_js.index("const links=(d.links||[]).map"):]
links = links[:links.index(".join('');")]
official = links.split('class="iconlink"')[-1]
@@ -2217,15 +2218,18 @@ class WebUiSourceTests(unittest.TestCase):
"""内联品牌标记直接画在药丸上。垫一层 `--sunk` 会让它比周围暗一档,看着像
这条链接被禁用了——而图标要说的是「去哪」,不是「能不能点」。"""
self.assertPageContains(
- ".entitylinkicon{width:32px;height:32px;border-radius:50%;"
+ ".entitylinkicon{width:20px;height:20px;border-radius:50%;"
"background:transparent;")
def test_the_entity_hero_is_a_centred_single_column_on_phones(self):
- # 左像右文那套是给宽屏的:手机上 92px 头像旁边只剩两百多像素,别名和链接被挤成
- # 两三行,头像下面又空着一大片。按 beeg 的资料页改成单列居中。
+ # 左像右文那套是给宽屏的:手机上 96px 头像旁边只剩两百多像素,别名和链接被挤成
+ # 两三行,头像下面又空着一大片。按 beeg 的资料页改成单列居中;卡还是那张卡,
+ # 变的只是卡里正文那一格的排法。
self.assertPageContains(
- ".entityhero{grid-template-columns:minmax(0,1fr);gap:12px;padding:8px 0 18px;"
+ ".entityprofile{grid-template-columns:minmax(0,1fr);gap:12px;padding:16px;"
"justify-items:center;text-align:center}")
+ self.assertPageContains(".entityportrait{width:96px}")
+ self.assertPageContains(".entityidentity{width:100%}")
self.assertPageContains(".entityhero .entitylinks{justify-content:safe center")
def test_the_profile_link_row_scrolls_sideways_on_phones(self):
@@ -3076,16 +3080,20 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains(".skeletonpanel[data-fill]>div")
def test_the_follow_skeleton_reuses_the_poster_card_shape_and_adds_its_own_rows(self):
- """关注页跟首页是同一种海报卡,几何共用一块;它自己多两条横排。
+ """关注页跟首页是同一种海报卡,几何共用一块;它自己多一条作者行和一块两排的浮层。
- 作者行和筛选行的形状取 `.tier`/`.tagbar` 本身,跟首页顶栏是同一枚,不另画
- 一套。真正的差别只有归属行:`.followitem .meta .s` 有 min-height,比首页那条
- 高 3.6px,一页十来行叠起来就是一屏的错位。
+ 作者行和浮层的形状取 `.tier`/`.tagbar`/`.count` 本身,跟首页顶栏是同一枚,不另画
+ 一套;外框 `mountFilterFrame` 是运行时才建的,骨架得自己写全,否则等的那几秒钟
+ 上下两排是两块各带圆角的浮层。真正的差别只有归属行:`.followitem .meta .s` 有
+ min-height,比首页那条高 3.6px,一页十来行叠起来就是一屏的错位。
"""
self.assertPageContains(
''' <div class="tier followauthors" data-skeleton-tier="av"></div>''')
self.assertPageContains(
- ''' <div class="tagbar followfilters" data-skeleton-tier="pill"></div>''')
+ ''' <div class="board-filter-frame" data-filter-frame>\n'''
+ ''' <div class="tagbar followfilters" data-filter-row="top" data-skeleton-tier="pill"></div>\n'''
+ ''' <div class="count followcount" data-filter-row="bottom">'''
+ '''<span class="mono"><span class="countskeleton"></span></span></div></div>''')
self.assertPageContains(
"{cards:true,className:'follow-content-skeleton postercard-skeleton'})}</div>`;")
self.assertPageContains(".follow-content-skeleton .skeletoncard em{height:21px}")
@@ -5215,8 +5223,11 @@ class WebUiSourceTests(unittest.TestCase):
" .filterscroll{overflow-x:auto;overflow-y:hidden;scrollbar-width:none;"
"overscroll-behavior-inline:contain}")
self.assertPageContains(" .filterscroll>.tagscroll{flex:0 0 auto;min-width:auto;overflow:visible}")
- self.assertPageContains(" padding:9px 0 8px;border-bottom-color:transparent;"
- "overflow-x:auto;overflow-y:hidden;")
+ # 关注页那条也是同一个分工:五枚状态钉在左边,来源图标与标签在右半截横滚。
+ self.assertPageContains('<div class="tagbar followfilters" aria-label="关注筛选">'
+ '<div class="filterscroll"><div class="viewpills followviews"')
+ self.assertPageContains('<div class="tagscroll followtags">${extraFilters}</div></div></div>')
+ self.assertPageLacks(".followfilters{position:relative")
# 玻璃层只收间距,不改谁滚谁不滚:整条一起滚的话左端那一档也跟着走,而它正是
# 这条上唯一离开就读不懂的东西。
board = (Path(__file__).resolve().parents[1] / "web/board.css").read_text(encoding="utf-8")
@@ -5384,7 +5395,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains('.emptystate{grid-column:1/-1;display:grid;justify-items:center;align-content:center;gap:8px')
self.assertPageContains('.emptystate .es-copy{display:grid;justify-items:center;gap:8px}')
self.assertPageContains('.playlistpage>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px}')
- self.assertPageContains('.followfilters{position:relative;top:auto;z-index:1;height:auto;min-height:58px;margin:0 0 16px')
+ self.assertPageContains('.followfilters .sourcepill{width:34px;padding:0}')
self.assertPageContains("emptyState('trash','回收站是空的','删掉的内容会先到这里;确认不再需要后再清空。')")
self.assertPageContains("$('#grid').innerHTML=catalogEmptyHtml(")
self.assertPageContains("if(reset&&d.items.length)setGridCards(html)")
@@ -5725,11 +5736,15 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains('class="relatedpeople"')
self.assertPageContains("data-related-performer")
profile = self.page[self.page.index("async function openEntity("):]
- self.assertLess(profile.index("<div class=\"entityhero\">"),
+ self.assertLess(profile.index('<section class="entityhero" aria-label="资料">'),
profile.index('class="relatedpeople"'))
self.assertLess(profile.index('class="relatedpeople"'),
profile.index('class="tagscroll entitytags"'))
- self.assertPageContains('class="entitytagbar" aria-label="媒体与标签"')
+ # 同台艺人是这个人的附注,收在资料卡底那条带里,不是这一页的正文。
+ self.assertPageContains('<div class="entityfoot" aria-label="同台艺人">'
+ '<span class="entityfootlabel">同台艺人</span>'
+ '<div class="relatedpeople">${related}</div></div>')
+ self.assertPageContains('class="entitytagbar" aria-label="观看状态与标签"')
self.assertPageContains("body.entity-open .index{overflow-x:visible}")
self.assertNotIn("关联艺人", profile)
self.assertNotIn("相关标签", profile)
@@ -5738,9 +5753,9 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageLacks("entitysummary")
def test_entity_people_and_tags_match_home_vertical_rhythm(self):
- # 首页末层按钮到标签为 18.5px;人物行保留 4px 滚动留白后只需 6px 外边距。
- self.assertPageContains(".entitymeta{display:grid;gap:22px;margin:0 0 6px;min-width:0}")
- self.assertPageContains(".relatedpeople{display:flex;gap:14px;overflow-x:auto;padding-bottom:4px")
+ # 同台艺人那条带是资料卡的卡脚:左边一枚小标签,右边横滚的轨道吃掉剩余宽度。
+ self.assertPageContains(".entityfoot{display:flex;align-items:center;gap:16px;min-width:0;padding:12px 20px;")
+ self.assertPageContains(".relatedpeople{display:flex;flex:1;min-width:0;gap:12px;overflow-x:auto;scrollbar-width:none")
self.assertPageContains("height:var(--filterH);margin:0 -16px;padding:9px 16px")
def test_horizontal_avatar_rails_leave_room_for_the_hover_ring(self):
@@ -5889,16 +5904,16 @@ class WebUiSourceTests(unittest.TestCase):
'repeat(auto-fill,minmax(180px,1fr))}')
def test_the_roster_and_the_media_keys_are_one_button_group(self):
- """三个键问的是同一件事——这一页现在显示什么,所以在同一组里、同一个尺寸。"""
- self.assertCode(
- "${peopleValue?control(peopleValue,peopleLabel,peopleCount,'user-round','people'):''}")
- self.assertPageContains("peopleValue:roster.length?'people':'',peopleCount:roster.length,")
- # 当前视图只有一个来源,按下哪个键、下面画什么都读它。
+ """三个键问的是同一件事——这一页现在显示什么,所以在同一排 Tabs 里、同一个尺寸。"""
+ self.assertPageContains(
+ " ...(roster.length?[{value:'people',label:'艺人',count:roster.length}]:[]),\n"
+ " {value:'videos',label:'视频',count:d.asset_count},\n")
+ # 当前视图只有一个来源,选中哪一档、下面画什么都读它。
self.assertPageContains("function entityViewNow(kind){return kind==='agency'"
"&&agencyRosterView==='people'&&agencyRoster.length")
- self.assertCode("button.setAttribute('aria-pressed',String(now===media));")
- # 没有照片的实体不出照片键,不是出一个按下去什么都不显示的键。
- self.assertPageContains("imageValue:photoCount?'photos':'',imageLabel:'照片',")
+ self.assertCode("button.setAttribute('aria-selected',String(now===media));")
+ # 没有照片的实体不出照片档,不是出一个按下去什么都不显示的档。
+ self.assertPageContains(" ...(photoCount?[{value:'photos',label:'照片',count:photoCount}]:[]),")
# 标签筛的是作品,点了就回到视频视图,否则开关和内容各说各的。
self.assertCode("agencyRosterView='videos';")
@@ -7139,7 +7154,9 @@ class WebUiSourceTests(unittest.TestCase):
def test_follow_separator_uses_the_same_border_token_as_tags(self):
self.assertPageContains(".pill{flex:none;height:var(--filterItemH);padding:0 20px;border:1px solid var(--field-ring)")
- self.assertPageContains(".followfilters .sep{flex:none;width:1px;height:24px;background:var(--field-ring-hover)")
+ # 关注页的分隔线就是首页筛选条上那一道,不再自己画一份。
+ self.assertPageContains(".sep{flex:none;width:1px;height:19px;background:var(--field-ring-hover)")
+ self.assertPageLacks(".followfilters .sep{")
def test_entity_profile_uses_logo_links_without_a_redundant_back_row(self):
self.assertPageContains('class="entitylinkicon"')
@@ -8078,20 +8095,34 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageLacks('id="iClose"', "顶栏入口本身就是返回路径")
self.assertPageLacks("$('#iClose').onclick")
- def test_entity_and_follow_pages_share_round_video_image_buttons(self):
+ def test_the_profile_switches_media_with_board_tabs_and_follow_keeps_the_round_buttons(self):
+ """资料页切视频、照片、名册走 Board 的下划线 Tabs;关注页切视频、图片仍是那两枚圆键。
+
+ 资料页那一排换掉的是整页内容,是导航,所以是 Tabs,排在资料卡下面、筛选浮层上面,
+ 只有多于一档时才出——一枚孤零零的 Tab 没有可切的对象。关注页那两枚是浮层下排右端
+ 的控件,答的是「现在摆的是哪一类」,跟首页下排右端的排序键同一个位置。
+ """
self.assertPageContains('id="i-pics" viewBox="-1.6 -1.6 19.2 19.2" fill="currentColor" stroke="none"')
self.assertPageContains('export function mediaViewButtonsHtml({')
self.assertPageContains('class="mediaviewbutton" type="button" data-media-view="${esc(value)}"')
- self.assertCode("const mediaToggle=(photoCount||roster.length)?mediaViewButtonsHtml({\n"
- " active:entityViewNow(kind),")
- self.assertPageContains("videoCount:d.asset_count,imageCount:photoCount,")
- # 这一组排在整条最左,隔一道竖杠再是四枚观看状态:它换掉的是整页内容,
- # 夹在视图和标签中间会被读成标签那排的第一枚。它也是整条上唯一住在滚动层外面
- # 的东西——余下两格用的就是首页那两个类名,同一份摆法两页共一处。
- self.assertPageContains('<section class="entitytagbar" aria-label="媒体与标签">${mediaToggle}'
- """${mediaToggle?'<span class="sep" aria-hidden="true"></span>':''}"""
+ self.assertPageContains("export function boardTabsHtml(items,{active='',attr='data-tab',label='页面视图',className='',panel=''}={}){")
+ self.assertPageContains('<span class="board-tab-count">${esc(Number(count).toLocaleString())}</span>')
+ self.assertPageContains('<div class="board-local-nav board-tabs${className?` ${esc(className)}`:\'\'}" role="tablist" aria-label="${esc(label)}">')
+ self.assertCode("const mediaTabs=views.length>1?boardTabsHtml(views,{active:entityViewNow(kind),\n"
+ " attr:'data-media-view',label:'页面视图',className:'entitytabs',panel:'entitySection'}):'';")
+ self.assertPageContains("{value:'videos',label:'视频',count:d.asset_count},")
+ self.assertPageContains("...(photoCount?[{value:'photos',label:'照片',count:photoCount}]:[]),")
+ self.assertPageContains("...(roster.length?[{value:'people',label:'艺人',count:roster.length}]:[]),")
+ self.assertPageContains('<div class="entitysection" id="entitySection"></div>')
+ # 筛选条上只剩观看状态和标签,两格用的就是首页那两个类名,同一份摆法两页共一处。
+ self.assertPageContains('<section class="entitytagbar" aria-label="观看状态与标签">'
'<div class="filterscroll"><div class="viewpills entityviews"')
self.assertPageContains('<div class="tagscroll entitytags">${tags}</div></div></section>')
+ self.assertPageLacks("mediaViewButtonsHtml({\n active:entityViewNow(kind)")
+ # 关注页的读数照首页那条写,右端是媒体类型。
+ self.assertPageContains('<div class="count followcount"><span class="mono">${total.toLocaleString()} 项更新 · 显示 ${visible.length.toLocaleString()}</span>'
+ "${mediaControl?`<div class=\"sorts\">${mediaControl}</div>`:''}</div>")
+ self.assertPageContains("$('#stats').querySelectorAll('.followcount [data-media-view]')")
self.assertPageContains("button.dataset.mediaView")
self.assertPageContains(".mediaviewbuttons .mediaviewbutton{display:grid;place-items:center;flex:0 0 var(--filterItemH);width:var(--filterItemH);height:var(--filterItemH);padding:0;")
self.assertPageContains(".mediaviewbuttons .mediaviewbutton svg{width:20px;height:20px")
@@ -8420,52 +8451,54 @@ class WebUiSourceTests(unittest.TestCase):
尾被盖在下面。首页那四枚是同一个写法。
"""
board = (Path(__file__).resolve().parents[1] / "web/board.css").read_text(encoding="utf-8")
- self.assertPageContains("views:{selector:'#viewPills,.entityviews',")
+ self.assertPageContains("views:{selector:'#viewPills,.entityviews,.followviews',")
self.assertPageContains("if(row.offsetWidth&&row.closest('.board-filter-frame'))return row;")
self.assertPageContains(
- "'[data-state][aria-pressed=\"true\"],[data-entity-state][aria-pressed=\"true\"]'")
+ "'[data-state][aria-pressed=\"true\"],[data-entity-state][aria-pressed=\"true\"],")
# 两页共用同一段接线;玻璃要等外框搭好才量得到位置。
self.assertPageContains("function wireViewGlideRow(row,pills,kind='views'){")
self.assertPageContains("wireViewGlideRow(controls,buttons);")
- self.assertPageContains(" syncViewGlide(false);\n syncViewGlide(false,null,'media');")
+ self.assertPageContains(" syncViewGlide(false);\n scheduleStickySurfaces();")
self.assertPageLacks("const tagbar=$('#tagbar'),views=$('#viewPills');if(!tagbar||!views)return;",
"写死首页那两个 id 就是资料页没有玻璃的原因")
- # 资料页那四枚和左端那一档媒体都不自己铺底,选中和悬停都只提字色。
+ # 资料页那四枚不自己铺底,选中和悬停都只提字色。
self.assertIn('.entitytagbar.entitytagbar .pill[data-entity-state],\n'
'.entitytagbar.entitytagbar .pill[data-entity-state]:hover,\n'
- '.entitytagbar.entitytagbar .pill[data-entity-state][aria-pressed="true"],\n'
- '.entitytagbar.entitytagbar .mediaviewbutton,\n'
- '.entitytagbar.entitytagbar .mediaviewbutton:hover,\n'
- '.entitytagbar.entitytagbar .mediaviewbutton[aria-pressed="true"]{\n'
+ '.entitytagbar.entitytagbar .pill[data-entity-state][aria-pressed="true"]{\n'
' border:0;background:none;backdrop-filter:none;'
'-webkit-backdrop-filter:none;box-shadow:none}', board)
- def test_the_media_row_gets_its_own_pane_instead_of_sharing_the_view_one(self):
- """左端那一档媒体类型自己一块玻璃,不跟四枚观看状态共用。
+ def test_the_view_pane_is_the_only_pane_and_the_follow_row_rides_it_too(self):
+ """滑动的玻璃只有一块,管的是观看状态那一排;关注页那五枚是同一个控件的第三处。
- 两排问的不是同一件事:一排定这一页摆的是哪一类东西,一排定这一类里看哪一档。
- 共用一块的话,点一下照片,玻璃从「没看过」那儿飞过来,读出来是这两排在抢同一个
- 当前项——而那一刻两排都各自有一个生效值。
+ 资料页切视频、照片、名册那一排不再是筛选条左端的圆键,而是资料卡下面的下划线
+ Tabs:它换的是整页内容,蓝线由 `wireBoardTabs` 观察 `aria-selected` 去挪。
+ 媒体那块圆玻璃随之没有了使用者,连同它的圆角规则一起撤掉。
玻璃按用途存,不按元素存:资料页每换一次筛选就把整条重画一遍,拿节点当键等于
每重画一次就新建一块,动画从头起跑,看到的只是瞬移。
-
- 圆角跟着按钮走。那两枚是正圆,一块 8px 圆角的方玻璃扣上去,四个角先露出来。
"""
board = (Path(__file__).resolve().parents[1] / "web/board.css").read_text(encoding="utf-8")
- self.assertPageContains("media:{selector:'.entitymediaview',"
- "pressed:'[data-media-view][aria-pressed=\"true\"]',")
- self.assertPageContains("className:'viewglide-round'")
+ self.assertPageContains("views:{selector:'#viewPills,.entityviews,.followviews',")
+ self.assertPageContains("pressed:'[data-state][aria-pressed=\"true\"],[data-entity-state][aria-pressed=\"true\"],"
+ "[data-follow-filter][aria-pressed=\"true\"]'},")
+ self.assertPageLacks("media:{selector:'.entitymediaview',")
+ self.assertPageLacks("viewglide-round")
+ self.assertNotIn('.viewglide-round', board)
self.assertPageContains("const viewGlides=new Map();")
self.assertPageContains("function syncViewGlide(animate,target,kind='views'){")
self.assertPageContains("let glide=viewGlides.get(kind);")
- # 按下去那一下玻璃就滑过去,不等换视图的活干完。
- self.assertPageContains("syncViewGlide(true,button,'media');\n"
+ # 按下去那一下蓝线就滑过去,不等换视图的活干完。
+ self.assertPageContains("buttons.forEach(other=>other.setAttribute('aria-selected',String(other===button)));\n"
" switchEntityMedia(kind,name,filters,media);")
- self.assertPageContains("wireViewGlideRow(controls,buttons,'media');")
- self.assertIn('.viewglide.viewglide-round{border-radius:50%}', board)
- # 照片视图下这条只剩左端那一组,分隔线没有东西可隔。
- self.assertIn('.entitytagbar[data-media-only] .sep{display:none}', board)
+ self.assertPageContains("const controls=$('#index').querySelector('.entitytabs');if(!controls)return;")
+ # 关注页:先搭外框再量玻璃,点下去玻璃先走、数据后到。
+ self.assertPageContains("wireViewGlideRow(filterRow.querySelector('.followviews'),statusPills);")
+ self.assertPageContains("statusPills.forEach(p=>p.setAttribute('aria-pressed',String(p===button)));syncViewGlide(true,button);")
+ # 计数徽标照 tabs.tsx:未选中黑 10% 底半透明,选中换成强调色。
+ self.assertIn('.board-tab-count{display:inline-block;margin-left:6px;padding:1px 4px;border-radius:4px;', board)
+ self.assertIn('.board-local-nav button[aria-selected="true"] .board-tab-count{background:color-mix(in srgb,var(--tungsten) 12%,transparent);color:var(--tungsten);opacity:1}', board)
+ self.assertIn('.entitytabs{margin:0 0 22px}', board)
def test_every_current_item_slab_slides_with_the_same_spring(self):
"""标出「当前是哪一个」的那几块底板,动法只有一份。
@@ -8536,7 +8569,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertIn("for(let n=pill;n&&n!==host;n=n.offsetParent){x+=n.offsetLeft;y+=n.offsetTop}", app)
self.assertIn("if(glide.pane.parentElement!==box.host)box.host.prepend(glide.pane);", app)
# 视口变化时按按钮的新位置重新落位。
- self.assertIn("syncViewGlide(false);syncViewGlide(false,null,'media')},{passive:true});", app)
+ self.assertIn("syncViewGlide(false)},{passive:true});", app)
# 冲过落点再弹回:那条曲线是一次弹簧模拟的采样,峰值 1.103、313ms 收住。
self.assertIn("--spring-pane:linear(0,0.1515,", board)
self.assertIn(",1.0477,1.096,1.1029,1.0901,1.0641,", board)
@@ -9504,7 +9537,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertIn(".entitytags .pill{height:30px;padding:0 10px;font-size:13px;line-height:20px;"
"border-radius:var(--tag-radius);border:1px solid var(--glass-low);"
"color:var(--glass-text)}", board)
- self.assertIn(".board-filter-frame #tagbar .pill{height:30px;padding:0 10px;font-size:13px;", board)
+ self.assertIn(".board-filter-frame .tagbar .pill{height:30px;padding:0 10px;font-size:13px;", board)
def test_the_profile_floating_panel_is_one_pane_measured_off_the_home_one(self):
"""资料页顶上那块浮层是一块玻璃,尺寸照首页那块量。
@@ -10551,7 +10584,7 @@ class WebUiSourceTests(unittest.TestCase):
' .photowall[data-size="big"]{grid-template-columns:repeat(1,minmax(0,1fr))}')
# 标签只在视频视图里露面。
self.assertPageContains("toggleAttribute('data-media-only',now!=='videos')")
- self.assertPageContains(".entitytagbar[data-media-only] .entitytags .pill{display:none}")
+ self.assertPageContains(".entitytagbar[data-media-only]{display:none}")
self.assertPageContains(
"const head=collectionHeaderHtml({readout:'&nbsp;',loading:true,filterRow:'bottom'});")
diff --git a/web/app.js b/web/app.js
index c25aeb0f8..38be6e8db 100644
--- a/web/app.js
+++ b/web/app.js
@@ -18,7 +18,7 @@ import { javImageKind, normalizeJavImage, normalizeJavLayout, normalizeJavPrefer
import {
attachOverlayScrollbar, breadcrumbHtml, checkboxHtml, collectionSummaryHtml, closeAnchoredMenu, confirmModal, dismissMenu, emptyStateHtml, fieldsetTitle,
fillSkeletonTier, fitSkeleton, formModal, iconSwitchHtml, indexSkeletonHtml, loadingDotsHtml,
- mediaViewButtonsHtml, mountFilterFrame, filterChipHtml, moveGlidePane, glideEase, sortControlsHtml, collectionHeaderHtml, wireHorizontalScroller, noteHtml, presentMenu, progressHtml, gaugeHtml, scrollerHtml, searchInputHtml, selectFieldHtml,
+ mediaViewButtonsHtml, boardTabsHtml, mountFilterFrame, filterChipHtml, moveGlidePane, glideEase, sortControlsHtml, collectionHeaderHtml, wireHorizontalScroller, noteHtml, presentMenu, progressHtml, gaugeHtml, scrollerHtml, searchInputHtml, selectFieldHtml,
setActionBusy, skeletonHtml, spinnerHtml, wireAnchoredMenu, wireBusyActions, wireCollapse, wireDragReorder,
wireIconSwitch, wireOverlayScrollbars, wireScrollers, wireSelectField, wireContextCard, configurationSkeletonHtml, wireLoadMore,
} from './js/ui-components.js';
@@ -192,12 +192,16 @@ const pageSkeletonHtml=(label,{cards=false,className='',variant='',count,fill}={
skeletonHtml(label,{variant:variant||(cards?'cards':'panel'),className,
...(count?{count}:{}),...(fill===undefined?{}:{fill})});
/* 关注页的骨架跟首页共用海报卡那套几何:网格算式、卡内每一格都一样,只有归属行
- 高一点(`.followitem .meta .s` 有 min-height)。上面两条是它自己的作者行和筛选
- 行,形状取 `.tier`/`.tagbar` 本身,所以和首页顶栏是同一枚,不必另画一套。 */
+ 高一点(`.followitem .meta .s` 有 min-height)。上面是它自己的作者行和那块两排的
+ 玻璃浮层,形状取 `.tier`、`.tagbar`、`.count` 本身,所以和首页顶栏是同一枚。外框
+ 要自己写全:`mountFilterFrame` 是运行时才建的,骨架进不了那条路径,少了它上下两排
+ 会被画成两块各带圆角的浮层,等内容回来又并成一块。 */
const followSkeletonHtml=(label='正在读取关注内容')=>`<div class="follow">
<div class="followhead"><h2 class="pagetitle">关注</h2></div>
<div class="tier followauthors" data-skeleton-tier="av"></div>
- <div class="tagbar followfilters" data-skeleton-tier="pill"></div>
+ <div class="board-filter-frame" data-filter-frame>
+ <div class="tagbar followfilters" data-filter-row="top" data-skeleton-tier="pill"></div>
+ <div class="count followcount" data-filter-row="bottom"><span class="mono"><span class="countskeleton"></span></span></div></div>
${pageSkeletonHtml(label,{cards:true,className:'follow-content-skeleton postercard-skeleton'})}</div>`;
/* 分类名是静态文案,骨架和复核页各要一份,所以它排在骨架前面而不是跟着复核页那段代码。 */
const REVIEW_LABELS={metadata_fields:'元数据字段',creator_tags:'创作者标签',studio_logos:'厂牌 Logo',performer_avatars:'女优头像',western_identity:'西方身份回配',code_creators:'番号目录存疑',fc2_markings:'FC2 评论标记',fc2_similarity:'FC2 跨号相似',video_endcards:'片尾/出处证据',media_failure:'媒体失败'};
@@ -3276,16 +3280,11 @@ function viewGlideGeometry(pill){
把这一种连同 `display:none` 和资料页照片视图下那一排自己的 `hidden` 一起挡住——玻璃
留在一排收起来的按钮上,就是在一块空玻璃上亮着。
- 资料页那条上有两排都在回答「你在哪儿」:左端那一档媒体类型,和四枚观看状态。它们
- 问的不是同一件事,所以各有一块玻璃——共用一块的话,点一下照片,玻璃从「没看过」那儿
- 飞过来,读出来是这两排在抢同一个当前项。 */
+ 关注页那排状态是同一个控件的第三处:五枚里恒有一枚生效,选中记在 `data-follow-filter`
+ 上。资料页切视频、照片、名册的那一排不在这里——它换的是整页内容,走的是下划线 Tabs。 */
const GLIDE_ROWS={
- views:{selector:'#viewPills,.entityviews',
- pressed:'[data-state][aria-pressed="true"],[data-entity-state][aria-pressed="true"]'},
- /* 媒体那两枚是圆的,玻璃跟着它们的圆角走:一块 8px 圆角的方玻璃扣在一枚圆按钮上,
- 四个角先露出来,读起来是玻璃底下还垫着别的东西。 */
- media:{selector:'.entitymediaview',pressed:'[data-media-view][aria-pressed="true"]',
- className:'viewglide-round'},
+ views:{selector:'#viewPills,.entityviews,.followviews',
+ pressed:'[data-state][aria-pressed="true"],[data-entity-state][aria-pressed="true"],[data-follow-filter][aria-pressed="true"]'},
};
function viewPillsRow(kind){
for(const row of document.querySelectorAll(GLIDE_ROWS[kind].selector)){
@@ -5799,19 +5798,26 @@ function renderFollow(){
const providerPills=[...providers].map(([key,label])=>
`<button class="pill sourcepill" data-follow-provider="${esc(key)}" aria-pressed="${followProviders.has(key)}"
title="${esc(label)}" aria-label="来源:${esc(label)}">${sourceIcon(key)}</button>`).join('');
+ const total=followFilter?counts[followFilter]||0:allCount;
+ const mediaControl=followMediaControl(mediaCounts);
+ const extraFilters=providerPills+(providerPills&&topTags.length?'<span class="sep" aria-hidden="true"></span>':'')
+ +topTags.map(([key,label,n])=>
+ filterChipHtml(label,{attr:'data-follow-tag',value:key,selected:followTags.has(key),count:n||undefined,className:'r34-'+groupTagType(groups,key)})).join('');
+ /* 筛选条跟首页是同一块玻璃浮层,分工也照那边:上排左端五枚状态五选一、恒有一枚
+ 生效,答的是「现在看的哪一档」,滑动的那块玻璃跟着它走;隔一道竖线之后的来源和
+ 标签才是可加可不加的筛选。下排读数照首页那条写,右端是这一页自己的那一档——视频
+ 还是图片。观看状态在首页、资料页和这里三处是同一个控件,画成三种样子就得学三遍。
+ 「管理关注」是去另一页的入口,不是这一页的主动作,蓝色留给空态里那枚「添加关注」。 */
$('#stats').innerHTML=`<div class="follow">
<div class="followhead"><h2 class="disp pagetitle">关注</h2>
- <button class="fbtn primary fcheck" data-follow-manage>${icon('settings')}管理关注</button></div>
+ <button class="fbtn fcheck" data-follow-manage>${icon('settings')}管理关注</button></div>
${authors.size?`<div class="tier followauthors" aria-label="按作者筛选">${randomizedAuthors.map(([key,author])=>
`<button class="av" data-follow-author="${esc(key)}" aria-pressed="${followAuthors.has(key)}">
<span class="ring">${followAuthorAvatar(author.sources)}</span><span class="nm">${esc(author.name)}</span></button>`
).join('')}</div>`:''}
- <div class="tagbar followfilters" aria-label="关注筛选">${followMediaControl(mediaCounts)}${FOLLOW_FILTERS.map(([key,label])=>
- filterChipHtml(label,{attr:'data-follow-filter',value:key,selected:key===followFilter,count:key?counts[key]||0:allCount})).join('')}
- ${providerPills?`<span class="sep" aria-hidden="true"></span>${providerPills}`:''}
- ${topTags.length?`<span class="sep" aria-hidden="true"></span>`+
- topTags.map(([key,label,n])=>
- filterChipHtml(label,{attr:'data-follow-tag',value:key,selected:followTags.has(key),count:n||undefined,className:'r34-'+groupTagType(groups,key)})).join(''):''}</div>
+ <div class="tagbar followfilters" aria-label="关注筛选"><div class="filterscroll"><div class="viewpills followviews" role="group" aria-label="状态">${FOLLOW_FILTERS.map(([key,label])=>
+ filterChipHtml(label,{attr:'data-follow-filter',value:key,selected:key===followFilter,count:key?counts[key]||0:allCount})).join('')}${extraFilters?'<span class="sep" aria-hidden="true"></span>':''}</div><div class="tagscroll followtags">${extraFilters}</div></div></div>
+ <div class="count followcount"><span class="mono">${total.toLocaleString()} 项更新 · 显示 ${visible.length.toLocaleString()}</span>${mediaControl?`<div class="sorts">${mediaControl}</div>`:''}</div>
${broken.length
?`<div class="geist-note geist-note-error fwarn" role="alert">${icon('alert')}<span>${broken.length} 个来源上次检查失败,去<button class="flink" data-follow-manage>管理关注</button>看原因。</span></div>`:''}
<div class="followlist${followMediaView==='images'?' followphotowall':''}">${visible.length?visible.map(group=>{
@@ -5821,9 +5827,7 @@ function renderFollow(){
:sources.length?emptyState('rss','没有符合条件的更新','切换状态或来源筛选后再试。')
:emptyState('rss','还没有关注任何来源','添加作者或订阅来源后,更新会集中显示在这里。',{actions:'<button class="fbtn primary" data-follow-manage>添加关注</button>'})}</div>
${followData.has_more||sources.some(source=>source.can_backfill)?`<div class="followpagination">
- ${followData.has_more?`<span class="followpageaction"><button class="fbtn" data-follow-more>${icon('chevron-down')}加载更多</button>
- <span class="fmeta">已显示 ${visible.length.toLocaleString()} / ${
- (followFilter?counts[followFilter]||0:allCount).toLocaleString()} 项</span></span>`:''}
+ ${followData.has_more?`<span class="followpageaction"><button class="fbtn" data-follow-more>${icon('chevron-down')}加载更多</button></span>`:''}
${sources.some(source=>source.can_backfill)?`<span class="followpageaction"><button class="fbtn" data-follow-older>${icon('history')}抓更早的一页</button>
<span class="fmeta">${esc(followBackfillState(sources))}</span></span>`:''}</div>`:''}</div>`;
const more=$('#stats').querySelector('[data-follow-more]');
@@ -5837,15 +5841,26 @@ function renderFollow(){
wireFollowItems();
wireFollowOlder();
void wireFollowProgress();
+ /* 上下两排收进同一块外框,材质与吸顶归外框;玻璃的坐标基准也是它,所以先搭框再量。 */
+ const filterRow=$('#stats').querySelector('.followfilters'),countRow=$('#stats').querySelector('.followcount');
+ mountFilterFrame(filterRow,countRow,{views:filterRow.querySelector('.followviews'),
+ tags:filterRow.querySelector('.followtags'),readout:countRow.querySelector('.mono'),
+ controls:countRow.querySelector('.sorts')});
wireDrag($('#stats').querySelector('.followauthors'));
- wireDrag($('#stats').querySelector('.followfilters'));
+ wireDrag(filterRow.querySelector('.filterscroll'));wireDrag(filterRow.querySelector('.tagscroll'));
+ wireHorizontalScroller(filterRow.querySelector('.tagscroll'));
+ const statusPills=[...filterRow.querySelectorAll('[data-follow-filter]')];
+ wireViewGlideRow(filterRow.querySelector('.followviews'),statusPills);
+ scheduleStickySurfaces();
paintSelection();
/* 一律先把新状态写进 URL 再重取:openFollow 现在照 URL 推导,不先写就会被
推回旧值。前进后退也因此天然可用。 */
const applyFollowView=()=>{route(followViewPath());openFollow(false)};
- $('#stats').querySelectorAll('[data-follow-filter]').forEach(button=>button.onclick=()=>{
+ statusPills.forEach(button=>button.onclick=()=>{
+ /* 玻璃先走,数据后到:等服务端回来再动,点完先僵一下再跳。 */
+ statusPills.forEach(p=>p.setAttribute('aria-pressed',String(p===button)));syncViewGlide(true,button);
followFilter=button.dataset.followFilter;applyFollowView()});
- $('#stats').querySelectorAll('.followfilters [data-media-view]').forEach(button=>button.onclick=()=>{
+ $('#stats').querySelectorAll('.followcount [data-media-view]').forEach(button=>button.onclick=()=>{
// 媒体类型是纯前端的分组,不影响服务端取哪些条目,所以只重画不重取。
followMediaView=button.dataset.mediaView;
route(followViewPath());renderFollow()});
@@ -7241,7 +7256,6 @@ function syncEntityFilterFrame(){
/* 玻璃的坐标基准是这块外框,所以要等框搭好才量得到位置。两排本身在框搭好之前就
接过了,那一次量到的是 null。 */
syncViewGlide(false);
- syncViewGlide(false,null,'media');
scheduleStickySurfaces();
}
function syncEntityStateControls(kind,name,filters){
@@ -7383,22 +7397,20 @@ function entityViewNow(kind){return kind==='agency'&&agencyRosterView==='people'
function renderEntityMediaToggle(kind,name,filters){
syncEntityStateControls(kind,name,filters);
- const controls=$('#index').querySelector('.entitymediaview');if(!controls)return;
+ const controls=$('#index').querySelector('.entitytabs');if(!controls)return;
const now=entityViewNow(kind);
const buttons=[...controls.querySelectorAll('[data-media-view]')];
buttons.forEach(button=>{
const media=button.dataset.mediaView;
- button.setAttribute('aria-pressed',String(now===media));
- /* 按下去那一下玻璃就滑过去,不等换视图的活干完:切到照片要取一次图墙,反馈跟着
- 等就是点完先僵一下再亮。`aria-pressed` 由这里当场改齐——`switchEntityMedia`
- 末尾会重画这一排再对一次,中间那段空档没人写它,玻璃会被下一次同步拽回原处。 */
+ button.setAttribute('aria-selected',String(now===media));
+ /* 按下去那一下蓝线就滑过去,不等换视图的活干完:切到照片要取一次图墙,反馈跟着
+ 等就是点完先僵一下再亮。`aria-selected` 由这里当场改齐,`wireBoardTabs` 观察着
+ 这个属性,改了就量位置、挪指示条。 */
button.onclick=()=>{
- buttons.forEach(other=>other.setAttribute('aria-pressed',String(other===button)));
- syncViewGlide(true,button,'media');
+ buttons.forEach(other=>other.setAttribute('aria-selected',String(other===button)));
switchEntityMedia(kind,name,filters,media);
};
});
- wireViewGlideRow(controls,buttons,'media');
/* 那排标签数的是视频,照片和名册上一个都对不上——「痴女 23」在这一屏指的是二十三个
视频,而屏幕上摆着的是照片。点下去也不留在这儿:标签是作品筛选,`toggleTag` 会把
视图拨回视频。一排点了就走人、数字又对不上当前内容的东西,摆在这儿只会让人以为
@@ -7948,20 +7960,21 @@ async function openEntity(kind,name,push=true){
style:facePos(x.avatar_focus),focus:x.avatar_focus})}</span>
<span class="nm">${esc(x.k)}</span></button>`).join('');
const photoCount=photos&&!photos.error?(photos.total||0):0;
- /* 艺人名册和视频、照片是这一页的三个互斥视图,共用一组按钮:它们回答的是同一个
- 问题,摆成两个控件只会各说各的。切换只重画下面那块,不重开这一页——名册已经随
- 资料下来了,视频那一半本来也要请求。
-
- 这一组排在整条筛选条的最左端,隔一道竖杠再是四枚观看状态、再一道才是标签。三段
- 由粗到细:先定这一页现在摆的是哪一类东西,再定这一类里看哪一档,最后才是可加可
- 不加的筛选。夹在视图和标签中间时它读起来像标签那排的第一枚,而它换掉的是整页
- 内容,不是给当前这批加一条筛选。 */
- const mediaToggle=(photoCount||roster.length)?mediaViewButtonsHtml({
- active:entityViewNow(kind),
- peopleValue:roster.length?'people':'',peopleCount:roster.length,
- imageValue:photoCount?'photos':'',imageLabel:'照片',
- videoCount:d.asset_count,imageCount:photoCount,
- label:roster.length?'页面视图':'媒体类型',className:'entitymediaview'}):'';
+ /* 艺人名册、视频、照片是这一页的三个互斥视图,共用一排 Board 下划线 Tabs:它们回答的
+ 是同一个问题,摆成两个控件只会各说各的。切换只重画下面那块,不重开这一页——名册
+ 已经随资料下来了,视频那一半本来也要请求。
+
+ 这一排排在资料卡下面、玻璃筛选条上面,三层由粗到细:Tabs 先定这一页现在摆的是哪一类
+ 东西,四枚观看状态定这一类里看哪一档,标签才是可加可不加的筛选。它换掉的是整页内容,
+ 不是给当前这批加一条筛选,所以不住在筛选条里。只有一类东西时不出这一排:一枚孤零零
+ 的 Tab 没有可切的对象。 */
+ const views=[
+ ...(roster.length?[{value:'people',label:'艺人',count:roster.length}]:[]),
+ {value:'videos',label:'视频',count:d.asset_count},
+ ...(photoCount?[{value:'photos',label:'照片',count:photoCount}]:[]),
+ ];
+ const mediaTabs=views.length>1?boardTabsHtml(views,{active:entityViewNow(kind),
+ attr:'data-media-view',label:'页面视图',className:'entitytabs',panel:'entitySection'}):'';
/* 统称由用户自己定。同一个人在库里常有中文、日文、罗马字几种写法,哪一个该顶在
标题上是他的偏好,账本里没有能推出答案的字段。菜单只列这条实体名下已有的写法:
换统称是换显示的那一个,不是改名——改名要有来源和证据,不该由一次点击完成。
@@ -8004,15 +8017,21 @@ async function openEntity(kind,name,push=true){
>${icon('plus')}<span>添加别名…</span></button></div></div>`;
$('#index').dataset.entityKind=kind;$('#index').dataset.entityName=name;
const people=kind==='performer'||kind==='creator';
- $('#index').innerHTML=`<div class="entityhero"><div class="entityportraitwrap"><div class="entityportrait ${people?'':'square'}" data-fit-native="${company?'mark':'portrait'}">${image}<span>${esc(name.slice(0,1))}</span></div>${
- people?'<span data-avatar-picker></span>':''}</div>
- <div><div class="entitytitle"><h2>${esc(d.canonical_name)}</h2>${namePick}</div>
+ /* 资料卡按 Board 的 profile 卡排:一块 secondary 底、18px 圆角的卡,正文是头像加身份三行
+ (名字、别名与归属、外链),同台艺人收进卡底那条色阶带——那是这个人的附注,不是这一页
+ 的正文;事务所的名册是正文,走下面 Tabs 里那一档。卡外面依次是 Tabs、交集条、玻璃筛选条
+ 和内容区,顶到底一条线。 */
+ $('#index').innerHTML=`<section class="entityhero" aria-label="资料">
+ <div class="entityprofile"><div class="entityportraitwrap"><div class="entityportrait ${people?'':'square'}" data-fit-native="${company?'mark':'portrait'}">${image}<span>${esc(name.slice(0,1))}</span></div>${
+ people?'<span data-avatar-picker></span>':''}</div>
+ <div class="entityidentity"><div class="entitytitle"><h2>${esc(d.canonical_name)}</h2>${namePick}</div>
<div class="alias">${(d.display_aliases||[]).length?`${d.display_aliases.map(esc).join(' / ')} · `:''}<b>${d.asset_count.toLocaleString()}</b> 个视频${memberHtml}${agencyHtml}</div>
${links?`<div class="entitylinks">${links}</div>`:''}</div></div>
- ${related?`<div class="entitymeta"><section aria-label="同台艺人"><div class="relatedpeople">${related}</div></section></div>`:''}
+ ${related?`<div class="entityfoot" aria-label="同台艺人"><span class="entityfootlabel">同台艺人</span><div class="relatedpeople">${related}</div></div>`:''}</section>
+ ${mediaTabs}
<div class="combo entitycombo"></div>
- <section class="entitytagbar" aria-label="媒体与标签">${mediaToggle}${mediaToggle?'<span class="sep" aria-hidden="true"></span>':''}<div class="filterscroll"><div class="viewpills entityviews" role="group" aria-label="观看状态">${VIEW_PILLS.map(v=>`<button type="button" class="pill" data-entity-state="${v.k}" aria-pressed="${(filters.state||'')===v.k}">${v.label}</button>`).join('')}<span class="sep" aria-hidden="true"></span></div><div class="tagscroll entitytags">${tags}</div></div></section>
- <div class="entitysection"></div>`;
+ <section class="entitytagbar" aria-label="观看状态与标签"><div class="filterscroll"><div class="viewpills entityviews" role="group" aria-label="观看状态">${VIEW_PILLS.map(v=>`<button type="button" class="pill" data-entity-state="${v.k}" aria-pressed="${(filters.state||'')===v.k}">${v.label}</button>`).join('')}<span class="sep" aria-hidden="true"></span></div><div class="tagscroll entitytags">${tags}</div></div></section>
+ <div class="entitysection" id="entitySection"></div>`;
/* 圆框角上那个加号。自动挑的那张按来源优先级来,而那个顺序回答的是「先试哪一张」,
不是「哪一张适合当头像」:图库排第一的常是写真封面,同一个人往下翻几张就有片商的
正脸原图。换完重进这一页——头像索引在服务端已经失效过一次,重画才读得到新图。 */
@@ -8596,11 +8615,11 @@ window.addEventListener('scroll',()=>{
releaseHoverPreviews();
clearTimeout(scrollT); scrollT=setTimeout(()=>{window.__scrolling=false},180);
},{passive:true});
-/* 换了宽度就把两块玻璃各自重新落一次位:过了那道断点,这一排是不是住在横滚容器里
+/* 换了宽度就把那块玻璃重新落一次位:过了那道断点,这一排是不是住在横滚容器里
会变,玻璃该落在哪一层跟着变,量出来的位置也跟着变。不重落的话它留在旧的那一层上,
坐标还是按旧的算的,停在离按钮几百像素远的地方。 */
window.addEventListener('resize',()=>{scheduleStickySurfaces();alignFollowImageControls();
- syncViewGlide(false);syncViewGlide(false,null,'media')},{passive:true});
+ syncViewGlide(false)},{passive:true});
$('#scrim').onclick=()=>openDrawer(false);
diff --git a/web/board.css b/web/board.css
index 208860626..df29d3e26 100644
--- a/web/board.css
+++ b/web/board.css
@@ -204,21 +204,11 @@ body .review .reviewbulktoolbar{clip-path:inset(-48px -48px 0 -48px)}
选中和悬停都只提字色。 */
.entitytagbar.entitytagbar .pill[data-entity-state],
.entitytagbar.entitytagbar .pill[data-entity-state]:hover,
-.entitytagbar.entitytagbar .pill[data-entity-state][aria-pressed="true"],
-.entitytagbar.entitytagbar .mediaviewbutton,
-.entitytagbar.entitytagbar .mediaviewbutton:hover,
-.entitytagbar.entitytagbar .mediaviewbutton[aria-pressed="true"]{
+.entitytagbar.entitytagbar .pill[data-entity-state][aria-pressed="true"]{
border:0;background:none;backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:none}
-.entitytagbar.entitytagbar .pill[data-entity-state],
-.entitytagbar.entitytagbar .mediaviewbutton{color:color-mix(in srgb,var(--glass-text) 60%,transparent)}
+.entitytagbar.entitytagbar .pill[data-entity-state]{color:color-mix(in srgb,var(--glass-text) 60%,transparent)}
.entitytagbar.entitytagbar .pill[data-entity-state]:hover,
-.entitytagbar.entitytagbar .pill[data-entity-state][aria-pressed="true"],
-.entitytagbar.entitytagbar .mediaviewbutton:hover,
-.entitytagbar.entitytagbar .mediaviewbutton[aria-pressed="true"]{color:var(--glass-text)}
-/* 那两枚字形要压在玻璃上面,不然滑过去的时候被盖住一路暗过去——跟首页四枚视图同一条。 */
-.entitytagbar.entitytagbar .mediaviewbutton{position:relative;z-index:1}
-/* 照片视图下这条只剩左端那一组,后面没有东西可隔;分隔线留着就是一条指向空白的竖线。 */
-.entitytagbar[data-media-only] .sep{display:none}
+.entitytagbar.entitytagbar .pill[data-entity-state][aria-pressed="true"]{color:var(--glass-text)}
/* 版式、大小这类分段开关问的也是「你在哪儿」。滑块的位置和几何归分段器自己管,这里
只换材质与配色:那一套是给 flat 面配的,一块灰底衬一枚不透明的白滑块,摆到浮层上
就是整条里唯一一块实心的面,读起来像贴上去的另一个控件;字色取的也是 flat 面的
@@ -254,7 +244,7 @@ body .review .reviewbulktoolbar{clip-path:inset(-48px -48px 0 -48px)}
.board-filter-frame.board-filter-frame .tagbar{border-radius:22px 22px 0 0}
.board-filter-frame.board-filter-frame .count{border-radius:0 0 22px 22px}
.board-filter-frame.board-filter-frame .pill{color:var(--glass-text)}
-.board-filter-frame.board-filter-frame #tagbar .pill[data-tag]:not([aria-pressed="true"]){border-color:var(--glass-low)}
+.board-filter-frame.board-filter-frame .tagbar .pill:is([data-tag],[data-follow-tag],[data-follow-provider]):not([aria-pressed="true"]){border-color:var(--glass-low)}
/* 四枚视图之间只有一块玻璃在移动,不是四块各自亮灭:Apple 把同一层里的玻璃先合成
再形变(`GlassEffectContainer` 的 "fluidly morphing Liquid Glass shapes into each
other"),落到这一排就是先拉长盖住起点和终点、再收拢到新的那一枚。
@@ -294,7 +284,7 @@ body .review .reviewbulktoolbar{clip-path:inset(-48px -48px 0 -48px)}
的字之下。写 0 的话它是这层里唯一的定位元素,整块盖住下面所有的字。 */
.drawer.drawer>.navglide{border-radius:10px;z-index:-1}
/* 文字要压在那块玻璃上面,否则滑过去的时候字被盖住一路暗过去。 */
-.board-filter-frame.board-filter-frame #tagbar .pill[data-state]{position:relative;z-index:1}
+.board-filter-frame.board-filter-frame .tagbar .pill:is([data-state],[data-follow-filter]){position:relative;z-index:1}
/* 按下去那一下归手,弹回来那一下归弹簧。按住立刻缩到 96%——这一步要跟手,隔两百
毫秒才动读成的是「点了没反应」;松开才交给弹簧,冲过原尺寸一点点再收住,手指离开
以后那块东西还自己动了一下,捏着的是软的不是一张贴纸。
@@ -544,7 +534,6 @@ body>.board-filter-frame{margin-inline:16px}
:root{--board-filterH:48px}
.entitytagbar{position:sticky;top:calc(var(--topH) + 8px);margin:0;height:var(--board-filterH);gap:6px;padding:8px 12px}
.entitytagbar .entitytags{gap:6px}
-.entitytagbar .mediaviewbuttons .mediaviewbutton{flex:0 0 30px;width:30px;height:30px}
.entitycollectionhead{position:sticky;top:calc(var(--topH) + 8px);margin:0 0 22px;padding:8px 12px;min-height:var(--board-filterH);gap:12px}
.entitycollectionhead.is-stuck::after{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;
box-shadow:0 0 24px 4px #00000038,0 8px 20px #00000026;pointer-events:none}
@@ -587,20 +576,27 @@ body>.board-filter-frame{margin-inline:16px}
.top:has(.search.search-morphing){overflow:visible}
.top:has(.search.search-morphing) #searchBtn{opacity:0}
}
-.board-filter-frame #tagbar{height:48px;gap:6px;padding:8px 12px}
-.board-filter-frame #tagbar .pill{height:30px;padding:0 10px;font-size:13px;line-height:20px;border-radius:8px;border:1px solid transparent}
-/* 四枚视图自己不铺底,选中那一枚的填充由 `.viewglide` 那块滑过去的玻璃提供:
+/* 首页的 `#tagbar` 和关注页的 `.followfilters` 是同一条筛选条,规则按类名写、两页共用:
+ 左端几枚视图记在 `data-state`/`data-follow-filter` 上,右半截的标签记在
+ `data-tag`/`data-follow-tag`,来源图标键是 `data-follow-provider`。 */
+.board-filter-frame .tagbar{height:48px;gap:6px;padding:8px 12px}
+.board-filter-frame .tagbar .pill{height:30px;padding:0 10px;font-size:13px;line-height:20px;border-radius:8px;border:1px solid transparent}
+/* 几枚视图自己不铺底,选中那一枚的填充由 `.viewglide` 那块滑过去的玻璃提供:
两边都铺,静止态就是一块不透明的 `--picked` 压在玻璃上面,切换时也只能看见它
瞬间换位置,滑动的那块从头到尾被盖住。 */
-.board-filter-frame #tagbar .pill[data-state]{border:0;background:none;color:color-mix(in srgb,var(--glass-text) 60%,transparent)}
-.board-filter-frame #tagbar .pill[data-state]:hover,
-.board-filter-frame #tagbar .pill[data-state][aria-pressed="true"]{background:none;color:var(--glass-text)}
-.board-filter-frame #tagbar .pill[data-tag]:not([aria-pressed="true"]){border:1px solid var(--line);background:transparent}
-/* 右半截这些是标签,圆角从标签那个 token 取,跟卡片、详情面板、交集条一起走;左边四枚
+.board-filter-frame .tagbar .pill:is([data-state],[data-follow-filter]){border:0;background:none;color:color-mix(in srgb,var(--glass-text) 60%,transparent)}
+.board-filter-frame .tagbar .pill:is([data-state],[data-follow-filter]):hover,
+.board-filter-frame .tagbar .pill:is([data-state],[data-follow-filter])[aria-pressed="true"]{background:none;color:var(--glass-text)}
+.board-filter-frame .tagbar .pill:is([data-tag],[data-follow-tag],[data-follow-provider]):not([aria-pressed="true"]){border:1px solid var(--line);background:transparent}
+/* 右半截这些是标签,圆角从标签那个 token 取,跟卡片、详情面板、交集条一起走;左边几枚
是分段器,形状归它自己那一排。线画满两态:填充说的是这条加没加上去,那一圈线说的是
「这是一颗标签」,两句话不能合成一句讲。玻璃上取 --glass-low、flat 面上取 --line,
同一个角色各按自己的底选值。 */
-.board-filter-frame.board-filter-frame #tagbar .pill[data-tag]{border-radius:var(--tag-radius);border-color:var(--glass-low)}
+.board-filter-frame.board-filter-frame .tagbar .pill:is([data-tag],[data-follow-tag],[data-follow-provider]){border-radius:var(--tag-radius);border-color:var(--glass-low)}
+/* 关注页的标签按来源类型着色,选中那一档的线和填充都取那个色:这是它们在卡片上的样子,
+ 筛选条上不换一套。 */
+.board-filter-frame.board-filter-frame .followfilters .pill[class*="r34-"][aria-pressed="true"]{
+ border-color:color-mix(in srgb,var(--r34-tag) 72%,transparent);background:color-mix(in srgb,var(--r34-tag) 22%,transparent)}
/* 资料页的标签跟首页筛选条上的标签是同一个控件,只是换了个位置:那边 30px 高、13px
字,这边还留着 40px 高的大药丸,同一个人的标签在两页上大一圈小一圈。
计数跟着缩到 Caption。 */
@@ -608,6 +604,30 @@ body>.board-filter-frame{margin-inline:16px}
.entitytags .pill small{margin-left:5px;font:var(--board-caption)}
.board-filter-frame .count{padding:8px 12px;min-height:46px;gap:12px}
.board-filter-frame .sorts{gap:4px}.board-filter-frame .sorts button{height:30px;min-height:30px;font-size:12px;padding:0 8px;border:0;border-radius:7px;background:transparent}
+/* 关注页下排右端那两枚是视频/图片:它答的是「现在摆的是哪一类」,是一个位置,所以选中
+ 那一枚铺选中态那块玻璃,跟排序键只靠字重说话不同。 */
+.board-filter-frame .sorts .mediaviewbuttons{gap:2px}
+.board-filter-frame .sorts .mediaviewbutton{flex:0 0 30px;width:30px;height:30px;border-radius:7px;color:color-mix(in srgb,var(--glass-text) 60%,transparent)}
+.board-filter-frame .sorts .mediaviewbutton:hover{color:var(--glass-text)}
+.board-filter-frame .sorts .mediaviewbutton[aria-pressed="true"]{color:var(--glass-text);
+ background:linear-gradient(180deg,var(--glass-sheen),transparent 62%),var(--glass-pick-fill);
+ backdrop-filter:var(--glass-pick);-webkit-backdrop-filter:var(--glass-pick);
+ box-shadow:inset 0 0 0 1px var(--glass-rim),var(--glass-pick-shadow)}
+/* 资料卡照 Board 的卡排:secondary 底、18px 圆角、不描边,卡底那条带取卡脚那一档色阶。
+ 标题是 Title 3(24/32、500),别名行 Body 1,外链是 36px 的 secondary Button。 */
+.entityhero{border-radius:18px;background:var(--ground);box-shadow:none}
+.entityfoot{background:var(--board-card-foot);border-top-color:var(--line-soft)}
+.entityhero h2{font-size:24px;font-weight:500;line-height:32px}
+.entityhero .alias{font-size:14px;line-height:20px}
+.entitylinks a,.entitylinks .private{height:36px;border-radius:10px;border-color:var(--line);font-size:13px}
+.entitylinks a.iconlink{border-radius:10px}
+/* 资料页切视频、照片、名册的那一排是 Board 的下划线 Tabs;跟浮层留同样的 22px。
+ 计数徽标照 tabs.tsx:`rounded-sm px-1 py-px text-caption-1-medium`,未选中黑 10% 底半透明,
+ 选中换成强调色 12% 底、强调色字。 */
+.entitytabs{margin:0 0 22px}
+.board-tab-count{display:inline-block;margin-left:6px;padding:1px 4px;border-radius:4px;font:var(--board-caption);font-weight:500;line-height:16px;
+ background:color-mix(in srgb,var(--ink) 10%,transparent);color:var(--ink);opacity:.5;vertical-align:1px}
+.board-local-nav button[aria-selected="true"] .board-tab-count{background:color-mix(in srgb,var(--tungsten) 12%,transparent);color:var(--tungsten);opacity:1}
#grid.gridstack{border:0;background:transparent;padding:0;box-shadow:none;border-radius:0}
#grid.gridstack>.grid{border:0;background:transparent;padding:0;box-shadow:none;border-radius:0}
/* 竖屏带靠底色和网格区分,不再描一圈线:它嵌在两段无边框的网格中间,一条线反而
diff --git a/web/css/07-entity.css b/web/css/07-entity.css
index a321872b8..8b9791edc 100644
--- a/web/css/07-entity.css
+++ b/web/css/07-entity.css
@@ -1,11 +1,16 @@
-.entityhero{display:grid;grid-template-columns:160px minmax(0,1fr);gap:24px;padding:10px 0 24px;
- border:0;background:transparent;margin-bottom:0;align-items:center;min-width:0;max-width:100%}
+/* 资料卡:一块 --ground 底、浮层圆角、不描边的卡。正文是头像加身份三行,卡底那条色阶带
+ 放同台艺人——那是这个人的附注,不是这一页的正文。`overflow:hidden` 让底带的直角被卡的
+ 圆角裁掉。 */
+.entityhero{display:flex;flex-direction:column;margin:0 0 22px;border-radius:var(--floating-radius);
+ background:var(--ground);overflow:hidden;min-width:0;max-width:100%}
+.entityprofile{display:grid;grid-template-columns:120px minmax(0,1fr);gap:20px;padding:20px;
+ align-items:center;min-width:0}
/* 圆框外面这一层只为换头像那枚加号存在:圆框自己是 `overflow:hidden`(图要被裁成
圆的),贴在它边上的按钮放进去就没了。 */
.entityportraitwrap{position:relative;width:max-content;max-width:100%}
/* `position:relative` 是给人脸放大留的包含块:放大后的 img 转成绝对定位,偏移必须
相对这个圆框算,否则会挂到最近的定位祖先上去。见 app.js 的 avatarFrame。 */
-.entityportrait{width:160px;aspect-ratio:1;border-radius:50%;overflow:hidden;background:var(--overlay-5);
+.entityportrait{width:120px;aspect-ratio:1;border-radius:50%;overflow:hidden;background:var(--overlay-5);
display:grid;place-items:center;font-size:var(--fs-4xl);color:var(--muted);max-width:100%;
position:relative}
.entityportrait.square{border-radius:var(--floating-radius)}.entityportrait img,.entityportrait>span{grid-area:1/1}
@@ -14,8 +19,8 @@
一段 JS 去同步。厂牌标识本身是不透明方图,下面那条 cover 把它铺满整框。 */
.entityportrait:has(img)>span{display:none}
.entityportrait img{position:absolute;inset:0;grid-area:auto;width:100%;height:100%;object-fit:cover;display:block;z-index:1}
-.entityhero>div:last-child{min-width:0;max-width:100%}.entityhero h2{font-size:var(--fs-3xl);font-weight:400;
- line-height:1.2;letter-spacing:0;margin:0 0 9px;overflow-wrap:anywhere}.entityhero .alias b{color:var(--ink);font-weight:inherit}
+.entityidentity{min-width:0;max-width:100%}.entityhero h2{font-size:var(--fs-2xl);font-weight:500;
+ line-height:1.25;letter-spacing:0;margin:0 0 9px;overflow-wrap:anywhere}.entityhero .alias b{color:var(--ink);font-weight:inherit}
/* 统称选择器贴着标题:它改的就是标题上那个名字,隔开就看不出改的是哪一个。
下边距归到这一行上,标题自己不再留。 */
.entitytitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0 0 9px}
@@ -41,16 +46,18 @@
.npmenu hr{margin:4px 1px;border:0;border-top:1px solid var(--border-10)}
.npmenu button[role="menuitem"] svg{visibility:visible}
.entityhero .alias{color:var(--muted);
- font-size:var(--fs-md);line-height:1.45;margin-bottom:14px;overflow-wrap:anywhere}
-.entitylinks{display:flex;flex-wrap:wrap;gap:8px;margin-top:17px;max-width:100%}
-.entitylinks a,.entitylinks .private{min-width:0;max-width:100%;min-height:40px;border:1px solid var(--border-10);
- border-radius:var(--pill-radius);padding:4px 12px 4px 4px;font-size:var(--fs-sm);text-decoration:none;color:var(--ink);
- background:var(--overlay-5);display:inline-flex;align-items:center;gap:8px;overflow:hidden}
-.entitylinks a:hover{border-color:var(--border-15);background:var(--hover)}
+ font-size:var(--fs-md);line-height:1.45;margin-bottom:0;overflow-wrap:anywhere}
+/* 外链排成一行次级按钮:36px 高、控件圆角、一圈线,跟 Board 的 secondary Button 同一个形。
+ 它们是「去哪」的入口,不是标签,所以不画成药丸。 */
+.entitylinks{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;max-width:100%}
+.entitylinks a,.entitylinks .private{box-sizing:border-box;min-width:0;max-width:100%;height:36px;border:1px solid var(--line);
+ border-radius:var(--control-radius);padding:0 12px 0 8px;font-size:var(--fs-sm);text-decoration:none;color:var(--ink);
+ background:transparent;display:inline-flex;align-items:center;gap:8px;overflow:hidden}
+.entitylinks a:hover{background:color-mix(in srgb,var(--ink) 8%,var(--ground))}
.entitylinks .private{color:var(--muted);border-style:dashed}
-/* 圆盘本身不垫底色。X 这类内联品牌标记直接画在药丸上,垫一层 `--sunk` 只会让它比
+/* 圆盘本身不垫底色。X 这类内联品牌标记直接画在按钮上,垫一层 `--sunk` 只会让它比
周围暗一档,看着像这条链接被禁用了——而图标要说的是「去哪」,不是「能不能点」。 */
-.entitylinkicon{width:32px;height:32px;border-radius:50%;background:transparent;display:grid;place-items:center;
+.entitylinkicon{width:20px;height:20px;border-radius:50%;background:transparent;display:grid;place-items:center;
overflow:hidden;position:relative;flex:none}.entitylinkicon svg{width:16px;height:16px;stroke:currentColor;fill:none;
stroke-width:2}
/* favicon 是别人服务器上的位图,取不到时 `onerror` 会把 img 摘掉、露出下面的地球。
@@ -60,20 +67,22 @@
/* 品牌标记是填充字形,不吃上面那套描边;它自己画满整个圆盘,所以外面那圈
`overflow:hidden` 落不到它身上——圆内切在方框里,一个角都碰不到。 */
.entitylinkicon.brand svg{width:100%;height:100%;stroke:none;filter:none}
-/* 纯图标的社媒链接:收成圆形,没有文字就不给文字留位置。 */
-.entitylinks a.iconlink{padding:4px;gap:0;border-radius:50%}
+/* 纯图标的社媒链接:收成正方形,没有文字就不给文字留位置。 */
+.entitylinks a.iconlink{width:36px;padding:0;gap:0;justify-content:center}
/* 官网域名前显示站点自己那枚图标,取不到才露出地球;与带名称的链接共用间距。 */
-.entitylinks a.urllink{padding:4px 12px 4px 4px;letter-spacing:.02em}
+.entitylinks a.urllink{letter-spacing:.02em}
.entityskeletontext{width:100%}
.entityskeletontext .entitytitle .skeleton{width:60%;height:auto}
.entityskeletontext .alias .skeleton{display:block;width:40%;height:20px}
-.entityskeletontext .entitylinks .skeleton{width:180px;height:40px}
+.entityskeletontext .entitylinks .skeleton{width:180px;height:36px}
[data-skeleton^="entity/"] .entityportrait{height:auto}
-[data-skeleton^="entity/"] .entitytags .entitymediaskeleton{width:var(--filterItemH);height:var(--filterItemH);border-radius:50%;flex:none}
[data-skeleton^="entity/"] .entitycollectionhead .skeleton{width:90px;height:20px}
@media(max-width:600px){.entityskeletontext .alias .skeleton{margin-inline:auto}}
.entitylinklabel{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
-.entitymeta{display:grid;gap:22px;margin:0 0 6px;min-width:0}.entitymeta section{min-width:0}.entitysection h3{font-size:var(--fs-sm);letter-spacing:.08em;color:var(--muted);margin:0 0 12px}
+/* 卡底那条带:左边一枚小标签说这一排是谁,右边是横滚的同台艺人轨道。 */
+.entityfoot{display:flex;align-items:center;gap:16px;min-width:0;padding:12px 20px;
+ border-top:1px solid var(--line-soft);background:var(--overlay-5)}
+.entityfootlabel{flex:none;font-size:var(--fs-xs);color:var(--muted)}
.entitytagbar{position:sticky;top:var(--topH);z-index:61;display:flex;align-items:center;
height:var(--filterH);margin:0 -16px;padding:9px 16px;background:transparent;
border-bottom:1px solid transparent}
@@ -85,9 +94,10 @@
/* 这条是横向滚动行,里面每一项都得拒绝被压扁——挤瘪的开关点不准,也读不出图标。 */
.entitytags .iconswitch{flex:none}
.entitytags small{color:var(--muted);margin-left:4px}
-/* 那排标签数的是视频。看照片或名册时它们一个都对不上屏幕上摆着的东西,点下去还会把
- 视图拨回视频,所以那两档只留媒体开关。切回视频它们照旧在。 */
-.entitytagbar[data-media-only] .entitytags .pill{display:none}
+/* 那排标签和四枚观看状态数的都是视频。看照片或名册时它们一个都对不上屏幕上摆着的
+ 东西,点下去还会把视图拨回视频,所以那两档整条收起,浮层只剩下面那排抬头。切回
+ 视频它照旧在。 */
+.entitytagbar[data-media-only]{display:none}
/* 交集条列的也是作品筛选,照片视图下同样不成立。 */
.entitycombo:has(+.board-filter-frame .entitytagbar[data-media-only]){display:none}
.mediaviewbuttons{display:inline-flex;align-items:center;gap:2px;flex:none}
@@ -97,10 +107,10 @@
.mediaviewbuttons .mediaviewbutton[data-media-icon="image"] svg{fill:currentColor;stroke:none}
.mediaviewbuttons .mediaviewbutton:hover{color:var(--ink)}
.mediaviewbuttons .mediaviewbutton[aria-pressed="true"]{background:var(--picked);color:var(--ink)}
-.relatedpeople{display:flex;gap:14px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
-.relatedpeople::-webkit-scrollbar{display:none}.relatedperson{flex:0 0 78px;border:0;background:transparent;color:inherit;
- padding:0;cursor:pointer;text-align:center}.relatedperson .ring{display:grid;place-items:center;width:64px;height:64px;
- margin:0 auto 6px;border-radius:50%;overflow:hidden;background:var(--overlay-5);color:var(--muted);position:relative}
+.relatedpeople{display:flex;flex:1;min-width:0;gap:12px;overflow-x:auto;scrollbar-width:none;overscroll-behavior-inline:contain}
+.relatedpeople::-webkit-scrollbar{display:none}.relatedperson{flex:0 0 64px;border:0;background:transparent;color:inherit;
+ padding:0;cursor:pointer;text-align:center}.relatedperson .ring{display:grid;place-items:center;width:48px;height:48px;
+ margin:0 auto 5px;border-radius:50%;overflow:hidden;background:var(--overlay-5);color:var(--muted);position:relative}
.relatedperson img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.relatedperson .nm{display:block;
overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-xs)}
.relatedperson:hover .ring{box-shadow:0 0 0 1px var(--border-15)}
diff --git a/web/css/19-immersive.css b/web/css/19-immersive.css
index 013f20cec..7c97b70a8 100644
--- a/web/css/19-immersive.css
+++ b/web/css/19-immersive.css
@@ -182,9 +182,10 @@ body:has(#batchbar:not([hidden])) #stage{padding-bottom:180px}
/* 窄屏改成单列居中,头像在名字上方——参考 beeg 的资料页。
左像右文那套是给宽屏的:手机上 92 px 头像旁边只剩两百多像素,别名和链接被挤成
两三行,头像下面又空着一大片。居中之后名字和链接都拿到整行宽度。 */
- .entityhero{grid-template-columns:minmax(0,1fr);gap:12px;padding:8px 0 18px;justify-items:center;text-align:center}
- .entityportrait{width:112px}.entityhero h2{font-size:var(--fs-xl)}
- .entityhero>div:last-child{width:100%}
+ .entityprofile{grid-template-columns:minmax(0,1fr);gap:12px;padding:16px;justify-items:center;text-align:center}
+ .entityportrait{width:96px}.entityhero h2{font-size:var(--fs-xl)}
+ .entityidentity{width:100%}
+ .entityfoot{padding:10px 16px}
/* 标题行是 flex,`text-align:center` 管不到它,得自己居中。 */
.entitytitle{justify-content:center}
/* 这枚开关紧挨着名字,画成 44px 的方块就比名字本身还重一档,一屏里最先看见的
diff --git a/web/css/21-online.css b/web/css/21-online.css
index a9c5a0318..957299e29 100644
--- a/web/css/21-online.css
+++ b/web/css/21-online.css
@@ -2,22 +2,18 @@
.follow{padding:4px 0 42px}
.followhead{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}
.followhead .pagetitle{margin:0}
-.follow .fcheck{font-weight:600}
+.follow .fcheck{font-weight:500}
.follow .fcheck svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2}
.followauthors{padding:3px 0 10px;margin:0 0 2px;overscroll-behavior-inline:contain}
.followauthors .av{width:76px}
.followauthors .av[aria-pressed="true"] .ring{box-shadow:0 0 0 2px var(--ink)}
.followauthors .favatar{width:64px;height:64px;border-radius:50%;outline:0}
.followauthors .favatar.none{font-size:var(--fs-lg);background:var(--overlay-5)}
-/* 关注这一条整条横滚:它没有首页那种「左边读数、右边筛选」的分工,一整排都是可加
- 可不加的筛选,钉住开头几枚只会占掉本来就不宽的一行。 */
-.followfilters{position:relative;top:auto;z-index:1;height:auto;min-height:58px;margin:0 0 16px;
- padding:9px 0 8px;border-bottom-color:transparent;overflow-x:auto;overflow-y:hidden;
- scrollbar-width:none;overscroll-behavior-inline:contain;touch-action:pan-x}
-.followfilters::-webkit-scrollbar{display:none}
-.followfilters .sep{flex:none;width:1px;height:24px;background:var(--field-ring-hover);margin:0 3px}
-.followfilters .sourcepill{width:40px;padding:0}
-.followfilters .sourcepill .ficon{width:21px;height:21px;margin:0}
+/* 关注的筛选条就是首页那条 `.tagbar`,跟读数那排 `.count` 一起收进同一块浮层:
+ 左端五枚状态钉住、右半截来源和标签横滚,分工、尺寸和材质都取自那边,这里只补
+ 来源图标键自己的身量——它是一枚只有图标的药丸。 */
+.followfilters .sourcepill{width:34px;padding:0}
+.followfilters .sourcepill .ficon{width:18px;height:18px;margin:0}
.ficon{width:14px;height:14px;border-radius:var(--badge-radius);object-fit:contain;
vertical-align:-2px;margin-right:5px}
.fauthorhead .ficon{margin-right:2px}
@@ -44,7 +40,7 @@
.followitem .cardtitle{display:block;width:100%;border:0;background:transparent;color:inherit;padding:0;text-align:left;font-family:inherit;cursor:pointer;text-decoration:none}
.followitem .tg,.followdetailtags .tg{--r34-tag:#55A7FF;border-color:color-mix(in srgb,var(--r34-tag) 42%,transparent);background:color-mix(in srgb,var(--r34-tag) 10%,transparent)}
.followfilters .pill[class*="r34-"]{--r34-tag:#55A7FF}
-.followfilters .pill[class*="r34-"][aria-pressed="true"]{border-color:color-mix(in srgb,var(--r34-tag) 72%,transparent);background:color-mix(in srgb,var(--r34-tag) 22%,transparent);color:var(--ink)}
+.followfilters .pill[class*="r34-"][aria-pressed="true"]{border-color:color-mix(in srgb,var(--r34-tag) 72%,transparent);background:color-mix(in srgb,var(--r34-tag) 22%,transparent);color:var(--glass-text,var(--ink))}
.followitem .r34-artist,.followdetailtags .r34-artist,.followfilters .r34-artist{--r34-tag:#E36C6C}
.followitem .r34-character,.followdetailtags .r34-character,.followfilters .r34-character{--r34-tag:#68C76F}
.followitem .r34-copyright,.followdetailtags .r34-copyright,.followfilters .r34-copyright{--r34-tag:#D675D6}
@@ -94,7 +90,7 @@
标签云才够得着「已看/忽略」。 */
.followdetailside .followdetailtags{margin:16px 0 0}.followdetailactions button:disabled{opacity:.45;cursor:not-allowed}.followorigin{width:max-content;margin-top:auto;color:var(--muted);text-decoration:none}.followorigin:hover{color:var(--ink);text-decoration:none}
@media (max-width:640px){.followhead{align-items:center}
- .followauthors{margin-right:-12px;padding-top:3px}.followfilters{margin-right:-12px;padding-right:12px}
+ .followauthors{margin-right:-12px;padding-top:3px}
.followlist.followphotowall{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 8px}
.followdetailmedia{--follow-image-arrow-inset:10px}.followimagearrow{width:44px;height:44px}.followimagedots{bottom:12px}
}
diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.js
index d9f1adcb1..eb839615e 100644
--- a/web/dist/peach-ui.js
+++ b/web/dist/peach-ui.js
@@ -4787,12 +4787,12 @@ function Ui(e) {
function Wi(e, t, n) {
return `<section data-skeleton="entity/${e}" role="status" aria-label="正在读取资料">
<span class="sr-only">正在读取资料</span><div aria-hidden="true">
- <div class="entityhero"><div class="entityportrait ${e === "studio" || e === "agency" ? "square " : ""}skeleton"></div>
- <div class="entityskeletontext"><div class="entitytitle"><h2 class="skeleton">&nbsp;</h2></div>
+ <section class="entityhero"><div class="entityprofile"><div class="entityportrait ${e === "studio" || e === "agency" ? "square " : ""}skeleton"></div>
+ <div class="entityidentity entityskeletontext"><div class="entitytitle"><h2 class="skeleton">&nbsp;</h2></div>
<div class="alias"><span class="skeleton"></span></div>
- <div class="entitylinks"><span class="skeleton"></span></div></div></div>
+ <div class="entitylinks"><span class="skeleton"></span></div></div></div></section>
<div class="board-filter-frame" data-filter-frame>
- <section class="entitytagbar" data-filter-row="top"><div class="entitytags"><span class="skeleton entitymediaskeleton"></span><span class="skeleton entitymediaskeleton"></span></div></section>
+ <section class="entitytagbar" data-filter-row="top"><div class="filterscroll" data-skeleton-tier="pill"></div></section>
${t}</div>
<div class="entitysection">${n}</div></div></section>`;
}
diff --git a/web/js/ui-components.js b/web/js/ui-components.js
index bb0a9176e..b99e8e38c 100644
--- a/web/js/ui-components.js
+++ b/web/js/ui-components.js
@@ -428,6 +428,25 @@ export function mediaViewButtonsHtml({
${imageValue?control(imageValue,imageLabel,imageCount,'pics','image'):''}</div>`;
}
+/**
+ * Board 下划线 Tabs(boardui tabs.tsx):一排互斥的「这一页现在摆的是哪一组东西」。
+ *
+ * 资料页用它切视频/照片/名册,关注页用它切全部/未看/已看/已保存/已忽略。它回答的
+ * 是页面层级的「在哪一组」,不是给当前这批加一条筛选——筛选归玻璃条上的药丸。
+ * 每一枚都是 `role=tab`,当前项写 `aria-selected`;滑动的 2px 蓝线由 `board-local-nav`
+ * 那条共用规则和 `wireBoardTabs` 提供,这里只出 DOM。计数是可选的尾随徽标,口径由调用方
+ * 给:Tabs 自己不算数。
+ */
+export function boardTabsHtml(items,{active='',attr='data-tab',label='页面视图',className='',panel=''}={}){
+ const tabs=items.map(({value,label:text,count})=>{
+ const selected=String(value)===String(active);
+ const badge=count==null?'':`<span class="board-tab-count">${esc(Number(count).toLocaleString())}</span>`;
+ return `<button type="button" role="tab" ${attr}="${esc(value)}" aria-selected="${selected}"${
+ panel?` aria-controls="${esc(panel)}"`:''}>${esc(text)}${badge}</button>`;
+ }).join('');
+ return `<div class="board-local-nav board-tabs${className?` ${esc(className)}`:''}" role="tablist" aria-label="${esc(label)}">${tabs}</div>`;
+}
+
/** Geist Empty State: icon tile, title and explanatory copy stay one semantic unit. */
export function emptyStateHtml(iconName,title,description,{className='',actions=''}={}){
return `<div class="emptystate${className?` ${esc(className)}`:''}" data-geist-empty-state role="status">