Skip to content

Commit

Permalink
feat: homepage rcmd video auto complete #91
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Jun 24, 2024
1 parent 1044bc7 commit 8efe239
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 修复:动态页 隐藏动态右侧饰品
- 新增:播放页/番剧页 全屏时页面可滚动
- 新增:首页 自动补全视频空位

## 3.7.3

Expand Down
21 changes: 20 additions & 1 deletion src/rules/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ if (isPageHomepage()) {
// 增大 视频载入 视频数量
new CheckboxItem({
itemID: 'homepage-increase-rcmd-load-size',
description: '增大 视频载入 视频数量 (实验性)',
description: '增大 视频载入 视频数量 (实验功能)',
itemCSS: `
/* 扩增载入后会产生奇怪的骨架空位 */
.floor-single-card:has(.skeleton, .skeleton-item) {
Expand All @@ -507,6 +507,25 @@ if (isPageHomepage()) {
}
},
}),
// 自动补全 视频列表空位
new CheckboxItem({
itemID: 'homepage-rcmd-video-auto-complete',
description: '自动补全 视频列表空位 (实验功能)',
itemCSS: `
/* 隐藏anchor前的骨架, 保持anchor在未载入骨架首位 */
.bili-video-card:has(.bili-video-card__skeleton:not(.hide)):has(~ .load-more-anchor) {
display: none;
}
`,
enableFunc: async () => {
const simulateScroll = () => window.dispatchEvent(new Event('scroll'))
simulateScroll()
window.addEventListener('wheel', (e: WheelEvent) => {
e.deltaY > 0 && simulateScroll()
})
},
enableFuncRunAt: 'document-end',
}),
]
homepageGroupList.push(new Group('homepage-rcmd-list', '视频列表', rcmdListItems))

Expand Down

0 comments on commit 8efe239

Please sign in to comment.