Skip to content

Commit

Permalink
feat: hide danmaku input when fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Dec 31, 2023
1 parent ccf40f2 commit f67ed57
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.2.1

- 新增:全屏下隐藏弹幕栏

## 2.2.0

- 新增:隐藏 顶栏数字小红点
Expand Down
6 changes: 3 additions & 3 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { log } from './utils/logger'

/**
* 初始化项目
* 等待firefox的document.head出现+渲染, 用于插入节点
* 使用pnpm run dev调试时,可能出现由于vite-plugin-monkey抢先监听document.head
* 导致init无法完成, 脚本载入失败或载入缓慢的情况, 可build再调试
* 等待document.head出现+渲染, 用于插入节点
* pnpm run dev调试时,可能出现由于vite-plugin-monkey抢先监听document.head
* 导致init无法完成, 脚本载入失败或载入缓慢的情况, 刷新无效可先build再调试
*/
export const init = async () => {
// firefox可捕捉到空head, 让firefox等待head渲染出第一波childNode
Expand Down
22 changes: 20 additions & 2 deletions src/pages/bangumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,11 @@ if (location.href.startsWith('https://www.bilibili.com/bangumi/play/')) {
`.bpx-player-dm-btn-send {display: none !important;}`,
),
)
// 隐藏 关闭整个弹幕栏
// 非全屏下 关闭弹幕栏
danmakuItems.push(
new NormalItem(
'video-page-hide-bpx-player-sending-area',
'隐藏 关闭整个弹幕栏',
'非全屏下 关闭弹幕栏',
false,
undefined,
false,
Expand All @@ -436,6 +436,24 @@ if (location.href.startsWith('https://www.bilibili.com/bangumi/play/')) {
`,
),
)
// 全屏下 关闭弹幕输入框
danmakuItems.push(
new NormalItem(
'video-page-hide-bpx-player-video-inputbar',
'全屏下 关闭弹幕输入框',
false,
undefined,
false,
`.bpx-player-container[data-screen=full] .bpx-player-control-bottom-center .bpx-player-video-inputbar,
.bpx-player-container[data-screen=web] .bpx-player-control-bottom-center .bpx-player-video-inputbar {
display: none !important;
}
.bpx-player-container[data-screen=full] .bpx-player-control-bottom-center,
.bpx-player-container[data-screen=web] .bpx-player-control-bottom-center {
padding: 0 0 !important;
}`,
),
)
}
bangumiGroupList.push(new Group('bangumi-danmaku', '弹幕栏', danmakuItems))

Expand Down
22 changes: 20 additions & 2 deletions src/pages/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,11 @@ if (location.href.startsWith('https://www.bilibili.com/video/')) {
}`,
),
)
// 隐藏 关闭整个弹幕栏
// 非全屏下 关闭弹幕栏
danmakuItems.push(
new NormalItem(
'video-page-hide-bpx-player-sending-area',
'隐藏 关闭整个弹幕栏',
'非全屏下 关闭弹幕栏',
false,
undefined,
false,
Expand All @@ -669,6 +669,24 @@ if (location.href.startsWith('https://www.bilibili.com/video/')) {
#bilibili-player-wrap {height: calc(var(--video-width)*.5625)}`,
),
)
// 全屏下 关闭弹幕输入框
danmakuItems.push(
new NormalItem(
'video-page-hide-bpx-player-video-inputbar',
'全屏下 关闭弹幕输入框',
false,
undefined,
false,
`.bpx-player-container[data-screen=full] .bpx-player-control-bottom-center .bpx-player-video-inputbar,
.bpx-player-container[data-screen=web] .bpx-player-control-bottom-center .bpx-player-video-inputbar {
display: none !important;
}
.bpx-player-container[data-screen=full] .bpx-player-control-bottom-center,
.bpx-player-container[data-screen=web] .bpx-player-control-bottom-center {
padding: 0 0 !important;
}`,
),
)
}
videoGroupList.push(new Group('video-danmaku', '弹幕栏', danmakuItems))

Expand Down
1 change: 1 addition & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
debugMode: false,
themeColor: `rgba(251, 114, 153, 1)`,
// themeColor: `#00aeec`,
}
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '2.2.0',
version: '2.2.1',
description:
'净化 B站/哔哩哔哩 页面内各种元素,去广告,BV号转AV号,净化播放器,提供300+项功能,定制自己的B站页面',
author: 'festoney8',
Expand Down

0 comments on commit f67ed57

Please sign in to comment.