Skip to content

Commit

Permalink
merge dev-v4 to main, v4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 authored Oct 10, 2024
2 parents adae2e4 + 7b68377 commit 2da47e6
Show file tree
Hide file tree
Showing 20 changed files with 143 additions and 76 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 4.0.1

- 新增:首页 移动负反馈按钮至底部 并恢复标题宽度
- 新增:播放页 控制栏收起时显示高能进度条
- 优化:插件管理器菜单
- 修复:插件面板输入操作触发页面快捷键bug
- 修复:首页插件冲突问题

## 4.0.0

### V4 版本更新说明
Expand Down
1 change: 1 addition & 0 deletions src/components/items/EditorComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
></DescriptionComp>
<textarea
v-model="editorData"
@keydown.stop
class="flex-1 resize-none overscroll-none rounded-md border-2 border-gray-300 p-2 text-[15px] outline-none focus:border-gray-400"
style="scrollbar-width: thin; scrollbar-color: #999 #00000000"
spellcheck="false"
Expand Down
1 change: 1 addition & 0 deletions src/components/items/NumberComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
type="number"
:step="step"
v-model="currValue"
@keydown.stop
class="ml-auto block w-1/5 rounded-lg border border-gray-300 bg-white px-2.5 py-1.5 text-sm outline-none invalid:border-red-500 focus:border-gray-500 focus:invalid:border-red-500"
/>
<div v-if="addonText" class="ml-2">{{ addonText }}</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/items/StringComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<input
type="text"
v-model="currValue"
@keydown.stop
class="ml-4 block flex-1 rounded-md border border-gray-300 bg-white p-1.5 text-sm outline-none invalid:border-red-500 focus:border-gray-500 focus:invalid:border-red-500"
/>
</div>
Expand Down
55 changes: 46 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ import {
import css from './style.css?inline'
import { waitForBody } from './utils/init'
import { error, log } from './utils/logger'
import {
isPageBangumi,
isPageChannel,
isPageDynamic,
isPageHomepage,
isPagePlaylist,
isPagePopular,
isPageSearch,
isPageSpace,
isPageVideo,
} from './utils/pageType'

const main = () => {
// 创建插件面板用shadowDOM节点
Expand Down Expand Up @@ -65,15 +76,41 @@ const menu = () => {
GM_registerMenuCommand('✅ 页面净化优化', () => {
ruleStore.isShow ? ruleStore.hide() : ruleStore.show()
})
GM_registerMenuCommand('✅ 视频过滤设置', () => {
videoStore.isShow ? videoStore.hide() : videoStore.show()
})
GM_registerMenuCommand('✅ 评论过滤设置', () => {
commentStore.isShow ? commentStore.hide() : commentStore.show()
})
GM_registerMenuCommand('✅ 动态过滤设置', () => {
dynamicStore.isShow ? dynamicStore.hide() : dynamicStore.show()
})
if (
isPageHomepage() ||
isPageVideo() ||
isPagePlaylist() ||
isPagePopular() ||
isPageChannel() ||
isPageSearch() ||
isPageSpace()
) {
GM_registerMenuCommand('✅ 视频过滤设置', () => {
videoStore.isShow ? videoStore.hide() : videoStore.show()
})
} else {
GM_registerMenuCommand('🚫 视频过滤设置', () => {
alert('[bilibili-cleaner] 本页面不支持视频过滤')
})
}
if (isPageVideo() || isPageBangumi() || isPageDynamic() || isPageSpace() || isPagePlaylist()) {
GM_registerMenuCommand('✅ 评论过滤设置', () => {
commentStore.isShow ? commentStore.hide() : commentStore.show()
})
} else {
GM_registerMenuCommand('🚫 评论过滤设置', () => {
alert('[bilibili-cleaner] 本页面不支持评论过滤')
})
}
if (isPageDynamic()) {
GM_registerMenuCommand('✅ 动态过滤设置', () => {
dynamicStore.isShow ? dynamicStore.hide() : dynamicStore.show()
})
} else {
GM_registerMenuCommand('🚫 动态过滤设置', () => {
alert('[bilibili-cleaner] 本页面不支持动态过滤')
})
}
GM_registerMenuCommand('⚡ 快捷按钮开关', () => {
sideBtnStore.isShow ? sideBtnStore.hide() : sideBtnStore.show()
})
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/variety/video/pages/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ export const videoFilterChannelGroups: Group[] = [
type: 'switch',
id: GM_KEYS.white.uploader.statusKey,
name: '启用 UP主白名单',
defaultEnable: false,
defaultEnable: true,
noStyle: true,
enableFn: () => {
mainFilter.videoUploaderWhiteFilter.enable()
Expand Down
4 changes: 2 additions & 2 deletions src/modules/filters/variety/video/pages/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export const videoFilterHomepageGroups: Group[] = [
type: 'switch',
id: GM_KEYS.white.isFollow.statusKey,
name: '标有 [已关注] 的视频免过滤',
defaultEnable: false,
defaultEnable: true,
noStyle: true,
enableFn: () => {
mainFilter.videoIsFollowWhiteFilter.enable()
Expand All @@ -467,7 +467,7 @@ export const videoFilterHomepageGroups: Group[] = [
type: 'switch',
id: GM_KEYS.white.uploader.statusKey,
name: '启用 UP主白名单',
defaultEnable: false,
defaultEnable: true,
noStyle: true,
enableFn: () => {
mainFilter.videoUploaderWhiteFilter.enable()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/variety/video/pages/popular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export const videoFilterPopularGroups: Group[] = [
type: 'switch',
id: GM_KEYS.white.uploader.statusKey,
name: '启用 UP主白名单',
defaultEnable: false,
defaultEnable: true,
noStyle: true,
enableFn: () => {
mainFilter.videoUploaderWhiteFilter.enable()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/variety/video/pages/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export const videoFilterSearchGroups: Group[] = [
type: 'switch',
id: GM_KEYS.white.uploader.statusKey,
name: '启用 UP主白名单',
defaultEnable: false,
defaultEnable: true,
noStyle: true,
enableFn: () => {
mainFilter.videoUploaderWhiteFilter.enable()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/filters/variety/video/pages/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export const videoFilterVideoGroups: Group[] = [
type: 'switch',
id: GM_KEYS.white.uploader.statusKey,
name: '启用 UP主白名单',
defaultEnable: false,
defaultEnable: true,
noStyle: true,
enableFn: () => {
mainFilter.videoUploaderWhiteFilter.enable()
Expand Down
10 changes: 10 additions & 0 deletions src/modules/rules/bangumi/groups/playerControl.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,14 @@ html[video-page-hide-bpx-player-shadow-progress-area] {
.bpx-player-shadow-progress-area {
display: none !important;
}
.bpx-player-pbp:not(.show) {
bottom: 0 !important;
}
}

// 控制栏收起时 显示高能进度条
html[video-page-show-bpx-player-pbp] {
.bpx-player-pbp:not(.show) {
opacity: 1 !important;
}
}
5 changes: 5 additions & 0 deletions src/modules/rules/bangumi/groups/playerControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,9 @@ export const bangumiPlayerControlItems: Item[] = [
name: '隐藏 底边mini视频进度',
defaultEnable: true,
},
{
type: 'switch',
id: 'video-page-show-bpx-player-pbp',
name: '控制栏收起时 显示高能进度条',
},
]
5 changes: 0 additions & 5 deletions src/modules/rules/homepage/groups/basic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,6 @@ html[homepage-hide-sticky-header] {
#i_cecream .header-channel {
top: 0 !important;
}

// adapt bilibili-app-recommend
.bilibili-app-recommend-root .area-header {
top: 0 !important;
}
}

// 隐藏 滚动页面时 顶部吸附分区栏
Expand Down
38 changes: 6 additions & 32 deletions src/modules/rules/homepage/groups/plugin.scss
Original file line number Diff line number Diff line change
@@ -1,48 +1,22 @@
// 隐藏 视频tag
html[homepage-hide-up-info-icon-bilibili-app-recommend] {
.bilibili-app-recommend-root
.bili-video-card:not(:has(.ant-avatar))
.bili-video-card__info--owner
> span[class^='_recommend-reason'] {
width: 17px;
height: 17px;
color: transparent !important;
background-color: unset !important;
border-radius: unset !important;
margin: 0 2px 0 0 !important;
font-size: unset !important;
line-height: unset !important;
padding: unset !important;
user-select: none !important;
}
.bilibili-app-recommend-root
.bili-video-card:not(:has(.ant-avatar))
.bili-video-card__info--owner
> span[class^='_recommend-reason']::before {
content: '';
display: inline-block;
width: 100%;
height: 100%;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="24" height="24" fill="currentColor" class="bili-video-card__info--owner__up"><!--[--><path d="M6.15 8.24805C6.5642 8.24805 6.9 8.58383 6.9 8.99805L6.9 12.7741C6.9 13.5881 7.55988 14.248 8.3739 14.248C9.18791 14.248 9.8478 13.5881 9.8478 12.7741L9.8478 8.99805C9.8478 8.58383 10.1836 8.24805 10.5978 8.24805C11.012 8.24805 11.3478 8.58383 11.3478 8.99805L11.3478 12.7741C11.3478 14.41655 10.01635 15.748 8.3739 15.748C6.73146 15.748 5.4 14.41655 5.4 12.7741L5.4 8.99805C5.4 8.58383 5.73578 8.24805 6.15 8.24805z" fill="rgb(148, 153, 160)"></path><path d="M12.6522 8.99805C12.6522 8.58383 12.98795 8.24805 13.4022 8.24805L15.725 8.24805C17.31285 8.24805 18.6 9.53522 18.6 11.123C18.6 12.71085 17.31285 13.998 15.725 13.998L14.1522 13.998L14.1522 14.998C14.1522 15.4122 13.8164 15.748 13.4022 15.748C12.98795 15.748 12.6522 15.4122 12.6522 14.998L12.6522 8.99805zM14.1522 12.498L15.725 12.498C16.4844 12.498 17.1 11.8824 17.1 11.123C17.1 10.36365 16.4844 9.74804 15.725 9.74804L14.1522 9.74804L14.1522 12.498z" fill="rgb(148, 153, 160)"></path><path d="M12 4.99805C9.48178 4.99805 7.283 5.12616 5.73089 5.25202C4.65221 5.33949 3.81611 6.16352 3.72 7.23254C3.60607 8.4998 3.5 10.171 3.5 11.998C3.5 13.8251 3.60607 15.4963 3.72 16.76355C3.81611 17.83255 4.65221 18.6566 5.73089 18.7441C7.283 18.8699 9.48178 18.998 12 18.998C14.5185 18.998 16.7174 18.8699 18.2696 18.74405C19.3481 18.65655 20.184 17.8328 20.2801 16.76405C20.394 15.4973 20.5 13.82645 20.5 11.998C20.5 10.16965 20.394 8.49877 20.2801 7.23205C20.184 6.1633 19.3481 5.33952 18.2696 5.25205C16.7174 5.12618 14.5185 4.99805 12 4.99805zM5.60965 3.75693C7.19232 3.62859 9.43258 3.49805 12 3.49805C14.5677 3.49805 16.8081 3.62861 18.3908 3.75696C20.1881 3.90272 21.6118 5.29278 21.7741 7.09773C21.8909 8.3969 22 10.11405 22 11.998C22 13.88205 21.8909 15.5992 21.7741 16.8984C21.6118 18.7033 20.1881 20.09335 18.3908 20.23915C16.8081 20.3675 14.5677 20.498 12 20.498C9.43258 20.498 7.19232 20.3675 5.60965 20.2392C3.81206 20.0934 2.38831 18.70295 2.22603 16.8979C2.10918 15.5982 2 13.8808 2 11.998C2 10.1153 2.10918 8.39787 2.22603 7.09823C2.38831 5.29312 3.81206 3.90269 5.60965 3.75693z" fill="rgb(148, 153, 160)"></path><!--]--></svg>');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.bilibili-app-recommend-root .bili-video-card:has(.ant-avatar) [class^='_recommend-reason'] {
display: none !important;
.bilibili-app-recommend-root .bili-video-card__info--owner + span {
display: none;
}
}

// 隐藏 弹幕数
html[homepage-hide-danmaku-count-bilibili-app-recommend] {
.bili-video-card:has(use) .bili-video-card__stats--item:has([href='#widget-video-danmaku']) {
.bilibili-app-recommend-root
.bili-video-card:has(use)
.bili-video-card__stats--item:has([href='#widget-video-danmaku']) {
display: none !important;
}
}

// 隐藏 点赞数
html[homepage-hide-agree-count-bilibili-app-recommend] {
.bili-video-card:has(use) .bili-video-card__stats--item:has([href='#widget-agree']) {
.bilibili-app-recommend-root .bili-video-card:has(use) .bili-video-card__stats--item:has([href='#widget-agree']) {
display: none !important;
}
}
Loading

0 comments on commit 2da47e6

Please sign in to comment.