diff --git a/CHANGELOG.md b/CHANGELOG.md index ebd5dc245..0af8b8a27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,55 @@ # 更新日志 +## v2.4.0 + +✨新增 +
+正式版获得 v2.3.1 ~ v2.3.3 预览版的功能 + +- `清爽首页` 的热门视频支持显示弹幕数量. +- `极简首页` 初版已完成. +- 脚本的更新源配置默认值更换为 `GitHub`, 并添加了 `AltCdn`, 表示开发者自定义的其他 CDN 源. `jsDelivr` 将会删除. +- 在 `GitHub` 更新源下, MDI 图标库更换使用 GitHub Pages. +- 新增组件 `UP 主黑名单` by [snowraincloud](https://github.com/snowraincloud). (PR #3537) +- 在无限滚动的场景下, 点击那个 `加载中` 的标识 (ScrollTrigger) 可以手动触发加载下一页. 在遇到没有自动加载下一页的情况时会比较有用. +- `下载视频` 支持 `flac` 音源. (#3497) +- `自定义顶栏` 支持设置顶栏的高度, 设置为 64px 即为原版顶栏的高度. (#3136) + +
+ +- `删除视频弹窗` 支持 3.x 播放器的 `关联视频` 和 `评分` 弹窗. (#3545) +- `展开弹幕列表` 支持设置 `最大弹幕数量`, 超过此数量不进行展开, 避免展开时卡死页面. (#2972) +- `图片批量导出` 在导出动态的图片时, 可以指定 `originalUser` 作为被转发用户名. (#1208) +- 新增插件 `自定义顶栏 - 频道`, 为自定义顶栏添加一个频道入口. (#3258) +- `自定义顶栏` 的历史弹窗中支持暂停/继续记录历史. (#3303) + +🐛修复 +- 修复 `默认播放器模式` 和 `播放器位置动作` 导致 `夜间模式跟随系统` 未生效. (#3157, PR #3636 by [ChsBuffer](https://github.com/chsbuffer)) +- 修复个人空间中的动态无法使用动态相关功能. (#3191) +- 新版播放页 & 3.x 播放器适配: (#3187, #2615) + - 夜间模式 (#3647) + - 播放器投影 + - 启用双击控制 + - 控制栏触摸优化 + - 三连触摸支持 + - 隐藏视频标题层 + - 展开视频简介 + - 启用弹幕空降 + - 播放器控制栏背景色 + - 强制保留弹幕栏 + - 快捷键扩展 + - 外置稍后再看 + - 启用快速收藏 + - 传统连播模式 + +☕开发者相关 (来自预览版 v2.3.1) +- 重新整理了所有 CDN 调用, 并支持自定义 CDN 配置, 文档见 [doc/cdn.md](https://github.com/the1812/Bilibili-Evolved/blob/preview-features/doc/cdn.md). +- 拆分并整理了 `/src/core/settings` 的代码结构. +- 所有 webpack 配置更换为 TypeScript, 并启用 ESLint 检查. +- 重构了元数据注入功能, 新增了 i18n 和 description 注入, 详细用法可见 `webpack/inject-metadata/i18n.ts` 和 `webpack/inject-metadata/description.ts` 中的注释说明. +- 删除了用不到的包 `html-webpack-plugin`. +- 适配了 VSCode File Nesting 功能. + ## v2.3.3-preview 包含 v2.2.4 的所有更新内容. diff --git a/doc/donate.md b/doc/donate.md index 1bb27f07b..fa8e3354b 100644 --- a/doc/donate.md +++ b/doc/donate.md @@ -29,6 +29,9 @@ https://afdian.net/@the1812?tab=sponsor | 时间 | 用户名 | 单号后4位 | 金额 | | ------------------- | ---------------- | --------- | ------- | +| 2022.08.31 16:28:40 | 匿名 | 1249 | ¥50.00 | +| 2022.08.28 14:13:22 | 匿名 | 4359 | ¥5.00 | +| 2022.08.27 09:33:37 | 匿名 | 3496 | ¥5.00 | | 2022.08.23 20:21:47 | *I | 7157 | ¥10.00 | | 2022.08.16 01:11:59 | *生 | 3893 | ¥20.00 | | 2022.08.09 22:42:25 | H*l | 0339 | ¥5.88 | diff --git a/doc/features/features.json b/doc/features/features.json index 012e87d13..093cb7590 100644 --- a/doc/features/features.json +++ b/doc/features/features.json @@ -75,7 +75,7 @@ "type": "component", "name": "badgeHelper", "displayName": "直播勋章快速更换", - "description": "在直播区中, 可从功能面板中直接切换勋章和头衔. 默认加载 256 个 (同时也是上限), 可在选项中修改.", + "description": "在直播区中, 可从功能面板中直接切换勋章和头衔. 默认显示 256 个 (同时也是上限), 可在选项中修改.", "fullRelativePath": "../../registry/dist/components/live/badge-helper.js", "fullAbsolutePath": "registry/dist/components/live/badge-helper.js" }, @@ -163,7 +163,7 @@ "type": "component", "name": "customNavbar", "displayName": "自定义顶栏", - "description": "使用脚本提供的顶栏替换原版的主站顶栏 (非主站不替换), 启用后还可以在反广告插件 (例如 ABP) 中配置禁止原版顶栏的消息 iframe 以提升性能:\n- *://message.bilibili.com/pages/nav/index_new_pc_sync\n- *://message.bilibili.com/pages/nav/index_new_sync", + "description": "使用脚本提供的顶栏替换原版的主站顶栏 (非主站不替换), 启用后还可以在反广告插件 (例如 ABP) 中配置禁止原版顶栏的消息 iframe 以提升性能:\r\n- *://message.bilibili.com/pages/nav/index_new_pc_sync\r\n- *://message.bilibili.com/pages/nav/index_new_sync\r\n", "fullRelativePath": "../../registry/dist/components/style/custom-navbar.js", "fullAbsolutePath": "registry/dist/components/style/custom-navbar.js" }, @@ -283,7 +283,7 @@ "type": "component", "name": "sidebarOffset", "displayName": "侧栏垂直偏移", - "description": "给脚本的侧栏设置垂直偏移量, 范围为 -40% ~ 40%", + "description": "给脚本的侧栏设置垂直偏移量, 范围为 -35% ~ 40%", "fullRelativePath": "../../registry/dist/components/style/sidebar-offset.js", "fullAbsolutePath": "registry/dist/components/style/sidebar-offset.js" }, @@ -371,7 +371,7 @@ "type": "component", "name": "blackList", "displayName": "屏蔽黑名单up主", - "description": "by [@snowraincloud](https://github.com/snowraincloud)\n\n屏蔽黑名单up主", + "description": "by [@snowraincloud](https://github.com/snowraincloud)\n\n屏蔽黑名单up主, 根据up主的名称进行匹配,支持精确匹配和正则匹配", "fullRelativePath": "../../registry/dist/components/utils/black-list.js", "fullAbsolutePath": "registry/dist/components/utils/black-list.js" }, @@ -427,7 +427,7 @@ "type": "component", "name": "imageExporter", "displayName": "图片批量导出", - "description": "可以批量导出某个地方的图片, 目前支持动态和专栏.\r\n\r\n动态文件名变量:\r\n- `user`: 用户名\r\n- `id`: 动态 ID\r\n- `n`: 第 n 张图\r\n\r\n专栏文件名变量:\r\n- `title`: 专栏标题\r\n- `n`: 第 n 张图", + "description": "可以批量导出某个地方的图片, 目前支持动态和专栏.\r\n\r\n动态文件名变量:\r\n- `user`: 用户名\r\n- `originalUser`: 被转发用户名, 如果不是转发类型的动态则等于 `user`\r\n- `id`: 动态 ID\r\n- `n`: 第 n 张图\r\n\r\n专栏文件名变量:\r\n- `title`: 专栏标题\r\n- `n`: 第 n 张图", "fullRelativePath": "../../registry/dist/components/utils/image-exporter.js", "fullAbsolutePath": "registry/dist/components/utils/image-exporter.js" }, @@ -531,7 +531,7 @@ "type": "component", "name": "expandDanmakuList", "displayName": "展开弹幕列表", - "description": "每次加载视频时自动展开弹幕列表.", + "description": "每次加载视频时自动展开弹幕列表, 如果弹幕装载量超过 `最大弹幕数量`, 则不展开以免对页面造成卡顿.", "fullRelativePath": "../../registry/dist/components/video/danmaku/expand.js", "fullAbsolutePath": "registry/dist/components/video/danmaku/expand.js" }, @@ -744,6 +744,14 @@ "fullRelativePath": "../../registry/dist/plugins/settings-panel/recent-components.js", "fullAbsolutePath": "registry/dist/plugins/settings-panel/recent-components.js" }, + { + "type": "plugin", + "name": "customNavbar.items.channel", + "displayName": "自定义顶栏 - 频道", + "description": "为自定义顶栏添加一个频道入口.", + "fullRelativePath": "../../registry/dist/plugins/style/custom-navbar-channel.js", + "fullAbsolutePath": "registry/dist/plugins/style/custom-navbar-channel.js" + }, { "type": "plugin", "name": "customNavbar.items.darkMode", diff --git a/doc/features/features.md b/doc/features/features.md index ac62ce0bd..0b3a7159b 100644 --- a/doc/features/features.md +++ b/doc/features/features.md @@ -96,7 +96,7 @@ **GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/live/badge-helper.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/live/badge-helper.js) -在直播区中, 可从功能面板中直接切换勋章和头衔. 默认加载 256 个 (同时也是上限), 可在选项中修改. +在直播区中, 可从功能面板中直接切换勋章和头衔. 默认显示 256 个 (同时也是上限), 可在选项中修改. ### [直播弹幕发送栏](../../registry/dist/components/live/danmaku-sendbar.js) `liveDanmakuSendbar` @@ -344,7 +344,7 @@ **GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/style/sidebar-offset.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/style/sidebar-offset.js) -给脚本的侧栏设置垂直偏移量, 范围为 -40% ~ 40% +给脚本的侧栏设置垂直偏移量, 范围为 -35% ~ 40% ### [简化评论区](../../registry/dist/components/style/simplify/comments.js) `simplifyComments` @@ -460,7 +460,7 @@ by [@snowraincloud](https://github.com/snowraincloud) -屏蔽黑名单up主 +屏蔽黑名单up主, 根据up主的名称进行匹配,支持精确匹配和正则匹配 ### [更新链接替换](../../registry/dist/components/utils/change-update-urls.js) `changeUpdateUrls` @@ -541,6 +541,7 @@ by [@snowraincloud](https://github.com/snowraincloud) 动态文件名变量: - `user`: 用户名 +- `originalUser`: 被转发用户名, 如果不是转发类型的动态则等于 `user` - `id`: 动态 ID - `n`: 第 n 张图 @@ -668,7 +669,7 @@ by [@kdxcxs](https://github.com/kdxcxs) **GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/components/video/danmaku/expand.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/components/video/danmaku/expand.js) -每次加载视频时自动展开弹幕列表. +每次加载视频时自动展开弹幕列表, 如果弹幕装载量超过 `最大弹幕数量`, 则不展开以免对页面造成卡顿. ### [视频页默认定位](../../registry/dist/components/video/default-location.js) `videoDefaultLocation` @@ -975,6 +976,15 @@ by FoundTheWOUT 在设置面板中添加 "最近使用" 类别, 方便检索最近操作过的组件. +### [自定义顶栏 - 频道](../../registry/dist/plugins/style/custom-navbar-channel.js) +`customNavbar.items.channel` + +**AltCdn:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/plugins/style/custom-navbar-channel.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/plugins/style/custom-navbar-channel.js) + +**GitHub:** [`Stable`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/registry/dist/plugins/style/custom-navbar-channel.js) / [`Preview`](https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/registry/dist/plugins/style/custom-navbar-channel.js) + +为自定义顶栏添加一个频道入口. + ### [自定义顶栏 - 夜间模式开关](../../registry/dist/plugins/style/custom-navbar-dark-mode.js) `customNavbar.items.darkMode` diff --git a/doc/features/pack/pack.json b/doc/features/pack/pack.json index e60e048ec..ad188e266 100644 --- a/doc/features/pack/pack.json +++ b/doc/features/pack/pack.json @@ -201,7 +201,7 @@ "type": "component", "name": "customNavbar", "displayName": "自定义顶栏", - "description": "使用脚本提供的顶栏替换原版的主站顶栏 (非主站不替换), 启用后还可以在反广告插件 (例如 ABP) 中配置禁止原版顶栏的消息 iframe 以提升性能:\n- *://message.bilibili.com/pages/nav/index_new_pc_sync\n- *://message.bilibili.com/pages/nav/index_new_sync", + "description": "使用脚本提供的顶栏替换原版的主站顶栏 (非主站不替换), 启用后还可以在反广告插件 (例如 ABP) 中配置禁止原版顶栏的消息 iframe 以提升性能:\r\n- *://message.bilibili.com/pages/nav/index_new_pc_sync\r\n- *://message.bilibili.com/pages/nav/index_new_sync\r\n", "fullRelativePath": "../../registry/dist/components/style/custom-navbar.js", "fullAbsolutePath": "registry/dist/components/style/custom-navbar.js" }, diff --git a/registry/lib/components/style/custom-navbar/history/NavbarHistory.vue b/registry/lib/components/style/custom-navbar/history/NavbarHistory.vue index f26d4e1dd..0e6cd067e 100644 --- a/registry/lib/components/style/custom-navbar/history/NavbarHistory.vue +++ b/registry/lib/components/style/custom-navbar/history/NavbarHistory.vue @@ -6,6 +6,17 @@
+
+ + + + + + +
@@ -236,8 +276,9 @@ export default Vue.extend({ position: absolute; } } - @mixin round-button($width: 26px) { - width: $width; + @mixin round-button($size: 26px) { + width: $size; + height: $size; box-sizing: border-box; } .header { diff --git a/registry/lib/components/style/custom-navbar/transparent-fill.ts b/registry/lib/components/style/custom-navbar/transparent-fill.ts index 1bb64e50a..f40ac4fc7 100644 --- a/registry/lib/components/style/custom-navbar/transparent-fill.ts +++ b/registry/lib/components/style/custom-navbar/transparent-fill.ts @@ -31,7 +31,10 @@ export const checkTransparentFill = async (vm: { } return false }, - ).then(() => { + ).then(banner => { + if (banner.length === 0) { + return + } addComponentListener('customNavbar.transparent', value => { if (!getComponentSettings('hideBanner').enabled) { vm.toggleStyle(value, 'transparent') diff --git a/registry/lib/components/style/dark-mode/dark-mode.important.scss b/registry/lib/components/style/dark-mode/dark-mode.important.scss index 3b9210033..af6dddfdf 100644 --- a/registry/lib/components/style/dark-mode/dark-mode.important.scss +++ b/registry/lib/components/style/dark-mode/dark-mode.important.scss @@ -222,6 +222,9 @@ blockquote { @include foreground-color(); } +#bilibili-player { + box-shadow: 0 4px 8px 0 #0004 !important; +} #bilibiliPlayer { box-shadow: 0 4px 8px 0 #0004; @include background-color('2'); diff --git a/registry/lib/components/style/dark-mode/dark-slice-15.scss b/registry/lib/components/style/dark-mode/dark-slice-15.scss index 7c0bc314e..244919f8e 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-15.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-15.scss @@ -182,6 +182,18 @@ @include color("e"); } } +#bilibili-player-placeholder-bottom { + @include background-color('3'); + &-left, + &-right { + @include background-color('4'); + } +} +#bpx-svg-sprite-danmu-on { + path:last-child { + @include theme-fill(); + } +} .bpx-player-container { box-shadow: 0 4px 8px 0 #0004 !important; .squirtle-controller { @@ -196,12 +208,16 @@ @include background-color(); } .bpx-player-sending-bar { - @include background-color(); - .bpx-player-dm-setting:hover { - @include theme-fill(); + @include background-color('2'); + .bpx-player-video-btn-dm, + .bpx-player-dm-setting, + .bpx-player-dm-switch { + @include fill('a'); } + .bpx-player-dm-switch:hover, + .bpx-player-dm-setting:hover, .bpx-player-video-btn-dm:hover { - @include theme-fill(); + @include fill('e'); } .bpx-player-dm-input { @include color("e"); diff --git a/registry/lib/components/style/dark-mode/dark-slice-17.scss b/registry/lib/components/style/dark-mode/dark-slice-17.scss index 2a010e67a..17daac450 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-17.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-17.scss @@ -638,9 +638,21 @@ } .share_dropdown { @include color('e'); + @include background-color('3'); .box-right { @include border-color('4'); } + .capture-bar { + .bar-left { + @include color('a'); + } + .bar-right { + .copy-link { + @include theme-background-color(); + @include foreground-color(); + } + } + } .share-link { @include background-color('4'); #link_copy { @@ -651,6 +663,12 @@ @include theme-color(); } } + .box-top-right { + box-shadow: -0.5px 0 0 #555 !important; + } + .box-bottom { + @include background-color('4'); + } } .player-auxiliary-filter-playlist { @@ -804,3 +822,7 @@ } } } +#bilibili-player-placeholder, +.bpx-player-container { + box-shadow: none !important; +} diff --git a/registry/lib/components/style/hide/video/top-mask/index.ts b/registry/lib/components/style/hide/video/top-mask/index.ts index 5c8dd7a57..fcaf8d42f 100644 --- a/registry/lib/components/style/hide/video/top-mask/index.ts +++ b/registry/lib/components/style/hide/video/top-mask/index.ts @@ -1,10 +1,17 @@ import { defineComponentMetadata } from '@/components/define' -import { toggleStyle } from '@/components/styled-component' import { playerUrls } from '@/core/utils/urls' +const name = 'hideVideoTopMask' export const component = defineComponentMetadata({ + name, displayName: '隐藏视频标题层', - ...toggleStyle('hideVideoTopMask', () => import('./top-mask.scss')), + entry: none, + instantStyles: [ + { + name, + style: () => import('./top-mask.scss'), + }, + ], tags: [ componentsTags.style, ], diff --git a/registry/lib/components/style/hide/video/top-mask/top-mask.scss b/registry/lib/components/style/hide/video/top-mask/top-mask.scss index 327be2e73..d1db036a3 100644 --- a/registry/lib/components/style/hide/video/top-mask/top-mask.scss +++ b/registry/lib/components/style/hide/video/top-mask/top-mask.scss @@ -1,3 +1,4 @@ +.bpx-player-top-wrap, .bilibili-player-video-top { display: none !important; } diff --git a/registry/lib/components/style/player-shadow/player-shadow.scss b/registry/lib/components/style/player-shadow/player-shadow.scss index 8c458292e..d14c172d3 100644 --- a/registry/lib/components/style/player-shadow/player-shadow.scss +++ b/registry/lib/components/style/player-shadow/player-shadow.scss @@ -5,3 +5,7 @@ box-shadow: 0px 2px 8px 0px var(--theme-color-20) !important; } } +#bilibili-player-placeholder, +.bpx-player-container { + box-shadow: none !important; +} diff --git a/registry/lib/components/touch/combo-like/index.ts b/registry/lib/components/touch/combo-like/index.ts index 3f7519206..18a8ff5e1 100644 --- a/registry/lib/components/touch/combo-like/index.ts +++ b/registry/lib/components/touch/combo-like/index.ts @@ -3,7 +3,7 @@ import { videoUrls } from '@/core/utils/urls' const entry = async () => { const { select } = await import('@/core/spin-query') - const likeButton = await select('.ops span.like') as HTMLElement + const likeButton = await select(':is(.ops, .video-toolbar-v1) span.like') as HTMLElement if (!likeButton) { return } diff --git a/registry/lib/components/touch/double-click-control/_default-state.scss b/registry/lib/components/touch/double-click-control/_default-state.scss index 97d35665e..711ef5aad 100644 --- a/registry/lib/components/touch/double-click-control/_default-state.scss +++ b/registry/lib/components/touch/double-click-control/_default-state.scss @@ -8,6 +8,7 @@ visibility: hidden !important; } } + .bpx-player-shadow-progress-area, .bilibili-player-video-control-wrap { opacity: 1 !important; visibility: visible !important; @@ -19,6 +20,9 @@ bottom: -7px !important; visibility: visible !important; } + .bpx-player-control-top, + .bpx-player-control-mask, + .bpx-player-control-bottom, .bpx-player-top-wrap { opacity: 0 !important; visibility: hidden !important; diff --git a/registry/lib/components/touch/double-click-control/_hover-state.scss b/registry/lib/components/touch/double-click-control/_hover-state.scss index 096d3c417..89e5252ec 100644 --- a/registry/lib/components/touch/double-click-control/_hover-state.scss +++ b/registry/lib/components/touch/double-click-control/_hover-state.scss @@ -12,7 +12,14 @@ opacity: 1 !important; bottom: 44px !important; } - .bpx-player-top-wrap { + .bpx-player-shadow-progress-area { + opacity: 0 !important; + visibility: hidden !important; + } + .bpx-player-top-wrap, + .bpx-player-control-mask, + .bpx-player-control-bottom, + .bpx-player-control-top { opacity: 1 !important; visibility: visible !important; } diff --git a/registry/lib/components/touch/double-click-control/_pbp.scss b/registry/lib/components/touch/double-click-control/_pbp.scss index 794b363a1..7c6144440 100644 --- a/registry/lib/components/touch/double-click-control/_pbp.scss +++ b/registry/lib/components/touch/double-click-control/_pbp.scss @@ -31,6 +31,25 @@ } } } + + .bpx-player-pbp { + opacity: 0 !important; + bottom: 3px !important; + &.pin { + opacity: 1 !important; + } + .bpx-player-pbp-pin { + opacity: 0 !important; + } + } + &.touch-video-control-show .bpx-player-pbp { + opacity: 1 !important; + bottom: calc(100% - 1px) !important; + .bpx-player-pbp-pin { + opacity: 1 !important; + } + } + &.touch-video-control-show .bilibili-player-video-control { #bilibili_pbp, #bilibili_pbp_canvas { @@ -60,6 +79,9 @@ } } } + &.touch-video-control-show .bpx-player-pbp { + bottom: calc(100% + 5px) !important; + } } } } diff --git a/registry/lib/components/touch/double-click-control/_subtitle.scss b/registry/lib/components/touch/double-click-control/_subtitle.scss index 7ef2522a4..baf5a7e41 100644 --- a/registry/lib/components/touch/double-click-control/_subtitle.scss +++ b/registry/lib/components/touch/double-click-control/_subtitle.scss @@ -1,3 +1,5 @@ +@import 'common'; + @mixin subtitle { &.bilibili-player-area .subtitle-position.subtitle-position { &-bc, @@ -13,14 +15,30 @@ bottom: 68px !important; } } - .mode-webfullscreen &.touch-video-control-show, - .mode-fullscreen &.touch-video-control-show { - .subtitle-position.subtitle-position { - &-bc, - &-bl, - &-br { - bottom: 88px !important; + .bpx-player-subtitle-panel-position { + &[data-position='bottom'] { + bottom: 14px !important; + } + } + &.touch-video-control-show .bpx-player-subtitle-panel-position { + &[data-position='bottom'] { + bottom: 69px !important; + } + } + @include on-fullscreen { + &.touch-video-control-show { + .subtitle-position.subtitle-position { + &-bc, + &-bl, + &-br { + bottom: 88px !important; + } + } + .bpx-player-subtitle-panel-position { + &[data-position='bottom'] { + bottom: 88px !important; + } } } } -} \ No newline at end of file +} diff --git a/registry/lib/components/touch/player-control/player-control.scss b/registry/lib/components/touch/player-control/player-control.scss index 194a96b15..3fa7ec44a 100644 --- a/registry/lib/components/touch/player-control/player-control.scss +++ b/registry/lib/components/touch/player-control/player-control.scss @@ -1,10 +1,10 @@ -@import "common"; +@import 'common'; @mixin replace-with-icon() { display: block; width: 36px; color: #eee; - font: normal normal normal 20px/1 "Material Design Icons"; + font: normal normal normal 20px/1 'Material Design Icons'; text-rendering: auto; line-height: inherit; -webkit-font-smoothing: antialiased; @@ -35,7 +35,7 @@ display: none !important; } &::before { - content: "\F0279"; + content: '\F0279'; @include replace-with-icon(); } } @@ -45,7 +45,7 @@ display: none !important; } &::before { - content: "\F08FF"; + content: '\F08FF'; @include replace-with-icon(); } } @@ -55,7 +55,7 @@ } } } - @include on-fullscreen(".touch-player-control") { + @include on-fullscreen('.touch-player-control') { .bilibili-player-area { .bilibili-player-video-control-bottom-center { padding: 0 12px !important; @@ -100,7 +100,7 @@ display: none !important; } .squirtle-video-pagelist::before { - content: "\F0279"; + content: '\F0279'; @include replace-with-icon(); } } @@ -110,7 +110,7 @@ display: none !important; } .squirtle-video-speed::before { - content: "\F08FF"; + content: '\F08FF'; @include replace-with-icon(); } } @@ -127,8 +127,28 @@ right: 0 !important; } } + .bpx-player-control-top, + .bpx-player-control-bottom { + padding: 0 !important; + } + .bpx-player-pbp { + padding: 0 !important; + left: 0 !important; + width: 100% !important; + } + .bpx-player-ctrl-btn { + height: 100% !important; + padding-left: 2px !important; + padding-right: 2px !important; + &.bpx-player-ctrl-play { + padding-left: 12px !important; + } + &.bpx-player-ctrl-full { + padding-right: 12px !important; + } + } } - @include on-fullscreen(".touch-player-control") { + @include on-fullscreen('.touch-player-control') { .squirtle-controller { height: 72px !important; .squirtle-controller-wrap { diff --git a/registry/lib/components/utils/image-exporter/feed.ts b/registry/lib/components/utils/image-exporter/feed.ts index f6c81b8e9..954e56b78 100644 --- a/registry/lib/components/utils/image-exporter/feed.ts +++ b/registry/lib/components/utils/image-exporter/feed.ts @@ -1,4 +1,4 @@ -import { FeedsCard, addMenuItem, forEachFeedsCard } from '@/components/feeds/api' +import { FeedsCard, addMenuItem, forEachFeedsCard, RepostFeedsCard } from '@/components/feeds/api' import { ComponentEntry } from '@/components/types' import { getBlob } from '@/core/ajax' import { DownloadPackage } from '@/core/download' @@ -42,6 +42,7 @@ export const setupFeedImageExporter: ComponentEntry = async ({ settings: { optio const titleData = { user: card.username, id: card.id, + originalUser: (card as RepostFeedsCard).repostUsername ?? card.username, n: (index + 1).toString(), } pack.add(`${formatTitle(feedFormat, false, titleData)}${imageUrls[index].extension}`, blob) @@ -50,6 +51,7 @@ export const setupFeedImageExporter: ComponentEntry = async ({ settings: { optio const packTitleData = { user: card.username, id: card.id, + originalUser: (card as RepostFeedsCard).repostUsername ?? card.username, n: '', } await pack.emit(`${formatTitle(feedFormat, false, packTitleData)}.zip`) diff --git a/registry/lib/components/utils/image-exporter/desc.md b/registry/lib/components/utils/image-exporter/index.md similarity index 71% rename from registry/lib/components/utils/image-exporter/desc.md rename to registry/lib/components/utils/image-exporter/index.md index f9e3aa921..8505dd017 100644 --- a/registry/lib/components/utils/image-exporter/desc.md +++ b/registry/lib/components/utils/image-exporter/index.md @@ -2,6 +2,7 @@ 动态文件名变量: - `user`: 用户名 +- `originalUser`: 被转发用户名, 如果不是转发类型的动态则等于 `user` - `id`: 动态 ID - `n`: 第 n 张图 diff --git a/registry/lib/components/utils/image-exporter/index.ts b/registry/lib/components/utils/image-exporter/index.ts index fa8efb8ae..f27224db5 100644 --- a/registry/lib/components/utils/image-exporter/index.ts +++ b/registry/lib/components/utils/image-exporter/index.ts @@ -2,14 +2,10 @@ import { ComponentMetadata } from '@/components/types' import { matchUrlPattern } from '@/core/utils' import { columnUrls, feedsUrls } from '@/core/utils/urls' import { setupFeedImageExporter } from './feed' -import desc from './desc.md' export const component: ComponentMetadata = { name: 'imageExporter', displayName: '图片批量导出', - description: { - 'zh-CN': desc, - }, tags: [ componentsTags.feeds, componentsTags.utils, diff --git a/registry/lib/components/utils/keymap/actions.ts b/registry/lib/components/utils/keymap/actions.ts index fe7a61870..6cdc53ef3 100644 --- a/registry/lib/components/utils/keymap/actions.ts +++ b/registry/lib/components/utils/keymap/actions.ts @@ -126,11 +126,11 @@ export const builtInActions: Record = { }, coin: { displayName: '投币', - run: useClickElement('.video-toolbar .coin,.tool-bar .coin-info, .video-toolbar-module .coin-box, .play-options-ul > li:nth-child(2)'), + run: useClickElement('.video-toolbar .coin, .tool-bar .coin-info, .video-toolbar-module .coin-box, .play-options-ul > li:nth-child(2), .video-toolbar-v1 .coin'), }, favorite: { displayName: '收藏', - run: useClickElement('.video-toolbar .collect, .video-toolbar-module .fav-box, .play-options-ul > li:nth-child(3)'), + run: useClickElement('.video-toolbar .collect, .video-toolbar-module .fav-box, .play-options-ul > li:nth-child(3), .video-toolbar-v1 .collect'), }, pause: { displayName: '暂停/播放', @@ -143,7 +143,7 @@ export const builtInActions: Record = { let likeClick = true return ((context: KeyBindingActionContext) => { const { event } = context - const likeButton = dq('.video-toolbar .like, .tool-bar .like-info') as HTMLSpanElement + const likeButton = dq('.video-toolbar .like, .tool-bar .like-info, .video-toolbar-v1 .like') as HTMLSpanElement if (!likeButton) { return false } diff --git a/registry/lib/components/video/danmaku/airborne/airborne.scss b/registry/lib/components/video/danmaku/airborne/airborne.scss index 8de000746..211c82365 100644 --- a/registry/lib/components/video/danmaku/airborne/airborne.scss +++ b/registry/lib/components/video/danmaku/airborne/airborne.scss @@ -1,9 +1,7 @@ -.bilibili-player-video-danmaku { - .b-danmaku { - &.airborne { - text-decoration: underline; - cursor: pointer; - pointer-events: initial; - } +.b-danmaku { + &.airborne { + text-decoration: underline; + cursor: pointer; + pointer-events: initial; } } diff --git a/registry/lib/components/video/danmaku/expand/index.ts b/registry/lib/components/video/danmaku/expand/index.ts index 7d33abea5..0348d83d5 100644 --- a/registry/lib/components/video/danmaku/expand/index.ts +++ b/registry/lib/components/video/danmaku/expand/index.ts @@ -2,13 +2,39 @@ import { ComponentEntry, ComponentMetadata } from '@/components/types' import { videoChange } from '@/core/observer' import { select } from '@/core/spin-query' import { matchUrlPattern } from '@/core/utils' +import { useScopedConsole } from '@/core/utils/log' import { mediaListUrls, videoAndBangumiUrls } from '@/core/utils/urls' +const getDanmakuCount = async () => { + const countElement = await select('.bilibili-player-video-info-danmaku-number, .bpx-player-video-info-dm') + /* + 3.x: 已装填 n 条弹幕 + 2.x: n + */ + const countText = countElement?.textContent ?? '' + const countMatch = countText.match(/\d+/) + if (!countMatch) { + return null + } + const count = parseInt(countMatch[0]) + if (Number.isNaN(count)) { + return null + } + return count +} + const entry: ComponentEntry = async ({ settings: { options } }) => { + const console = useScopedConsole('展开弹幕列表') videoChange(async () => { if (mediaListUrls.some(url => matchUrlPattern(url)) && options.ignoreMediaList) { return } + const danmakuCount = await getDanmakuCount() + console.log(`当前弹幕量: ${danmakuCount}`) + if (danmakuCount !== null && danmakuCount > options.maxDanmakuCount) { + console.log(`超过了最大弹幕数量 ${options.maxDanmakuCount}, 跳过展开`) + return + } const danmakuBox = await select('.bui-collapse-wrap') if (danmakuBox && danmakuBox.classList.contains('bui-collapse-wrap-folded')) { const button = await select('.bui-collapse-header') as HTMLDivElement @@ -23,13 +49,17 @@ export const component: ComponentMetadata = { entry, tags: [componentsTags.video], description: { - 'zh-CN': '每次加载视频时自动展开弹幕列表.', + 'zh-CN': '每次加载视频时自动展开弹幕列表, 如果弹幕装载量超过 `最大弹幕数量`, 则不展开以免对页面造成卡顿.', }, options: { ignoreMediaList: { defaultValue: true, displayName: '合集类页面不自动展开', }, + maxDanmakuCount: { + defaultValue: 500, + displayName: '最大弹幕数量', + }, }, urlInclude: [ ...videoAndBangumiUrls, diff --git a/registry/lib/components/video/full-description/full-description.scss b/registry/lib/components/video/full-description/full-description.scss index e7b1f2fbf..6d3b97ceb 100644 --- a/registry/lib/components/video/full-description/full-description.scss +++ b/registry/lib/components/video/full-description/full-description.scss @@ -1,10 +1,12 @@ .video-desc .info, .video-desc .desc-info, +.video-desc-v1 .desc-info, .play-up-info .play-up-self { height: auto !important; } .video-desc .btn, .video-desc .toggle-btn, +.video-desc-v1 .toggle-btn, .play-up-info .play-up-self-btn { display: none !important; } diff --git a/registry/lib/components/video/full-description/index.ts b/registry/lib/components/video/full-description/index.ts index bb2c052bc..ad4d3939c 100644 --- a/registry/lib/components/video/full-description/index.ts +++ b/registry/lib/components/video/full-description/index.ts @@ -1,7 +1,7 @@ import { ComponentMetadata } from '@/components/types' import { videoAndBangumiUrls } from '@/core/utils/urls' import { videoChange } from '@/core/observer' -import { select } from '@/core/spin-query' +import { select, sq } from '@/core/spin-query' import { addStyle, removeStyle } from '@/core/style' import style from './full-description.scss' @@ -9,11 +9,14 @@ const name = 'fullVideoDescription' const entry = () => { addStyle(style, name) videoChange(async () => { - const desc = await select('.video-desc') + const desc = await select('.video-desc, .video-desc-v1') if (!desc) { return } - const expandButton = await select('.video-desc .btn[report-id="abstract_spread"], .video-desc .toggle-btn') as HTMLElement + const expandButton = await sq( + () => dq(desc, '[report-id="abstract_spread"], .toggle-btn') as HTMLElement, + it => it.style.display !== 'none', + ) expandButton?.click() }) } diff --git a/registry/lib/components/video/outer-watchlater/OuterWatchlater.vue b/registry/lib/components/video/outer-watchlater/OuterWatchlater.vue index 76ed452d9..5a1f9bc0e 100644 --- a/registry/lib/components/video/outer-watchlater/OuterWatchlater.vue +++ b/registry/lib/components/video/outer-watchlater/OuterWatchlater.vue @@ -1,5 +1,5 @@