Skip to content

Commit

Permalink
feat: new space page hide sidebar btn
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Dec 26, 2024
1 parent ec329bc commit 7c9198c
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 4.0.13

- 新增:新版空间页 隐藏 侧栏按钮

## 4.0.12

- 更新:评论区过滤 增强召唤AI机器人屏蔽
Expand Down
1 change: 1 addition & 0 deletions src/modules/rules/space/groups/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const spaceBasicItems: Item[] = [
if (/\/\d+\/?($|\?)/.test(location.pathname)) {
const userid = location.pathname.match(/\d+/)?.[0]
if (userid) {
// 新版space会自动重定向到 /upload/video
location.href = `https://space.bilibili.com/${userid}/video`
}
}
Expand Down
19 changes: 19 additions & 0 deletions src/modules/rules/space/groups/sidebar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 隐藏 新版反馈
html[hide-space-page-sidebar-feedback] {
#app .space-float {
height: fit-content !important;
.float-button:nth-child(1) {
display: none !important;
}
}
}

// 隐藏 返回旧版
html[hide-space-page-sidebar-revert] {
#app .space-float {
height: fit-content !important;
.float-button:nth-child(2) {
display: none !important;
}
}
}
14 changes: 14 additions & 0 deletions src/modules/rules/space/groups/sidebar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Item } from '@/types/item'

export const spaceSidebarItems: Item[] = [
{
type: 'switch',
id: 'hide-space-page-sidebar-feedback',
name: '隐藏 新版反馈',
},
{
type: 'switch',
id: 'hide-space-page-sidebar-revert',
name: '隐藏 返回旧版',
},
]
1 change: 1 addition & 0 deletions src/modules/rules/space/index.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@use './groups/dynamic';
@use './groups/sidebar';
8 changes: 7 additions & 1 deletion src/modules/rules/space/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { Group } from '@/types/collection'
import { spaceBasicItems } from './groups/basic'
import { spaceDynamicItems } from './groups/dynamic'
import { spaceSidebarItems } from './groups/sidebar'

export const spaceGroups: Group[] = [
{
name: '基本功能',
items: spaceBasicItems,
},
{
name: '动态列表',
name: '页面侧栏',
items: spaceSidebarItems,
},
{
name: '动态列表 (与动态页同步)',
items: spaceDynamicItems,
fold: true,
},
]
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '4.0.12',
version: '4.0.13',
description:
'净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站',
author: 'festoney8',
Expand Down

0 comments on commit 7c9198c

Please sign in to comment.