From 57f28f8fad058ef71a36b0b9be0dcb0a0aa5fb4c Mon Sep 17 00:00:00 2001 From: the1812 Date: Wed, 5 Apr 2023 00:01:45 +0800 Subject: [PATCH 01/26] Update dark styles (#4007) --- .../style/dark-mode/_dark-definitions.scss | 110 ++++++++++-------- .../style/dark-mode/dark-slice-16.scss | 5 + .../style/dark-mode/dark-slice-17.scss | 67 +++++++++++ 3 files changed, 131 insertions(+), 51 deletions(-) diff --git a/registry/lib/components/style/dark-mode/_dark-definitions.scss b/registry/lib/components/style/dark-mode/_dark-definitions.scss index 1e5ac3a3d..98af23c80 100644 --- a/registry/lib/components/style/dark-mode/_dark-definitions.scss +++ b/registry/lib/components/style/dark-mode/_dark-definitions.scss @@ -1,90 +1,90 @@ -@mixin set-color($name, $level: "") { +@mixin set-color($name, $level: '') { $length: str-length($level); @if $length == 1 or $length == 2 { - #{$name}: #{"#" + $level + $level + $level} !important; + #{$name}: #{'#' + $level + $level + $level} !important; } @else if $length == 3 or $length == 6 { - #{$name}: #{"#" + $level} !important; + #{$name}: #{'#' + $level} !important; } @else if $length == 0 { #{$name}: transparent !important; } @else { - #{$name}: #{"#" + $level} !important; + #{$name}: #{'#' + $level} !important; } } -@mixin set-theme-color($name, $level: "") { - @if $level == "" { +@mixin set-theme-color($name, $level: '') { + @if $level == '' { #{$name}: var(--theme-color) !important; } @else { #{$name}: var(--theme-color-#{$level}) !important; } } -@mixin set-foreground-color($name, $level: "") { - @if $level == "" { +@mixin set-foreground-color($name, $level: '') { + @if $level == '' { #{$name}: var(--foreground-color) !important; } @else { #{$name}: var(--foreground-color-#{$level}) !important; } } -@mixin background-color($level: "") { - @include set-color("background-color", $level); +@mixin background-color($level: '') { + @include set-color('background-color', $level); } -@mixin color($level: "") { - @include set-color("color", $level); +@mixin color($level: '') { + @include set-color('color', $level); } -@mixin background($level: "") { - @include set-color("background", $level); +@mixin background($level: '') { + @include set-color('background', $level); } -@mixin border-color($level: "") { - @include set-color("border-color", $level); +@mixin border-color($level: '') { + @include set-color('border-color', $level); } -@mixin fill($level: "") { - @include set-color("fill", $level); +@mixin fill($level: '') { + @include set-color('fill', $level); } -@mixin stroke($level: "") { - @include set-color("stroke", $level); +@mixin stroke($level: '') { + @include set-color('stroke', $level); } -@mixin theme-background-color($level: "") { - @include set-theme-color("background-color", $level); +@mixin theme-background-color($level: '') { + @include set-theme-color('background-color', $level); } -@mixin theme-color($level: "") { - @include set-theme-color("color", $level); +@mixin theme-color($level: '') { + @include set-theme-color('color', $level); } -@mixin theme-background($level: "") { - @include set-theme-color("background", $level); +@mixin theme-background($level: '') { + @include set-theme-color('background', $level); } -@mixin theme-border-color($level: "") { - @include set-theme-color("border-color", $level); +@mixin theme-border-color($level: '') { + @include set-theme-color('border-color', $level); } -@mixin theme-fill($level: "") { - @include set-theme-color("fill", $level); +@mixin theme-fill($level: '') { + @include set-theme-color('fill', $level); } -@mixin theme-stroke($level: "") { - @include set-theme-color("stroke", $level); +@mixin theme-stroke($level: '') { + @include set-theme-color('stroke', $level); } -$vip-color: "FB7299"; +$vip-color: 'FB7299'; @mixin vip-color() { - @include set-color("color", $vip-color); + @include set-color('color', $vip-color); } @mixin vip-background-color() { - @include set-color("background-color", $vip-color); + @include set-color('background-color', $vip-color); } -@mixin foreground-background-color($level: "") { - @include set-foreground-color("background-color", $level); +@mixin foreground-background-color($level: '') { + @include set-foreground-color('background-color', $level); } -@mixin foreground-color($level: "") { - @include set-foreground-color("color", $level); +@mixin foreground-color($level: '') { + @include set-foreground-color('color', $level); } -@mixin foreground-background($level: "") { - @include set-foreground-color("background", $level); +@mixin foreground-background($level: '') { + @include set-foreground-color('background', $level); } -@mixin foreground-border-color($level: "") { - @include set-foreground-color("border-color", $level); +@mixin foreground-border-color($level: '') { + @include set-foreground-color('border-color', $level); } -@mixin foreground-fill($level: "") { - @include set-foreground-color("fill", $level); +@mixin foreground-fill($level: '') { + @include set-foreground-color('fill', $level); } @mixin to-white { @@ -123,16 +123,13 @@ $vip-color: "FB7299"; } } -@mixin back-top-btn( - $btn-selector: ".back-top-btn", - $arrow-selector: ".arrow-icon" -) { +@mixin back-top-btn($btn-selector: '.back-top-btn', $arrow-selector: '.arrow-icon') { #{$btn-selector} { @include border-color(); - @include background-color("3"); + @include background-color('3'); @if $arrow-selector { #{$arrow-selector} { - @include color("a"); + @include color('a'); } } &:hover { @@ -145,3 +142,14 @@ $vip-color: "FB7299"; } } } +@mixin contains($selector, $combineTarget: null) { + @if $combineTarget { + @at-root #{selector-unify($combineTarget, "[class*='#{$selector}']")} { + @content; + } + } @else { + [class*='#{$selector}'] { + @content; + } + } +} diff --git a/registry/lib/components/style/dark-mode/dark-slice-16.scss b/registry/lib/components/style/dark-mode/dark-slice-16.scss index 11e5e5e0d..f25ee209a 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-16.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-16.scss @@ -506,6 +506,11 @@ } } } + .dyn-card-opus { + &__title { + @include color('e'); + } + } } .bili-dyn-report { @include background-color('3'); 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 22fc1508a..2fde297a3 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-17.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-17.scss @@ -1015,6 +1015,34 @@ [class*='numberListItem_title'] { @include color('e'); } + @include contains('eplist_ep_list_order') { + @include to-theme('blue'); + } + @include contains('longListItem_wrap') { + @include color('e'); + &:hover { + @include background-color('5'); + @include contains('longListItem_text') { + @include theme-color(); + } + } + @include contains('longListItem_select', &) { + @include background-color('5'); + } + @include contains('longListItem_icon') { + path { + @include theme-fill(); + } + } + } + @include contains('modeChangeBtn_icon') { + path { + @include fill('a'); + } + &:hover path { + @include theme-fill(); + } + } } [class*='operation_split_line'] { @include border-color('4'); @@ -1025,3 +1053,42 @@ [class*='DanmukuBox_wrap'] { @include background(); } +@include contains('paybar_pay_bar') { + @include contains('paybar_btn_pay') { + @include border-color(); + @include theme-background-color(); + @include foreground-color(); + @include contains('paybar_active', &) { + @include background-color('4'); + @include color('e'); + } + } +} +.player-left-components { + @include contains('toolbar_toolbar') { + @include contains('toolbar_item_info') { + path { + @include fill('a'); + } + @include contains('toolbar_counts_num') { + @include color('a'); + } + &:hover { + path { + @include theme-fill(); + } + @include contains('toolbar_counts_num') { + @include theme-color(); + } + } + @include contains('toolbar_active', &) { + path { + @include theme-fill(); + } + @include contains('toolbar_counts_num') { + @include theme-color(); + } + } + } + } +} From 01f97e10b60766cd8e99d0e70f9a9da541f8a1c4 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 8 Apr 2023 20:40:45 +0800 Subject: [PATCH 02/26] Refactor contains function --- .../style/dark-mode/_dark-definitions.scss | 12 +- .../style/dark-mode/dark-slice-17.scss | 103 ++++++++---------- 2 files changed, 50 insertions(+), 65 deletions(-) diff --git a/registry/lib/components/style/dark-mode/_dark-definitions.scss b/registry/lib/components/style/dark-mode/_dark-definitions.scss index 98af23c80..69ffbb902 100644 --- a/registry/lib/components/style/dark-mode/_dark-definitions.scss +++ b/registry/lib/components/style/dark-mode/_dark-definitions.scss @@ -142,14 +142,6 @@ $vip-color: 'FB7299'; } } } -@mixin contains($selector, $combineTarget: null) { - @if $combineTarget { - @at-root #{selector-unify($combineTarget, "[class*='#{$selector}']")} { - @content; - } - } @else { - [class*='#{$selector}'] { - @content; - } - } +@function contains($class) { + @return "[class*='#{$class}']"; } 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 2fde297a3..e7dfb1dd8 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-17.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-17.scss @@ -744,7 +744,7 @@ .player-auxiliary-danmaku-multiple-control { @include background-color('2'); } - [class*='player-auxiliary-danmaku-btn-'] { + #{contains('player-auxiliary-danmaku-btn-')} { @include background-color(); } } @@ -902,44 +902,44 @@ @include theme-fill(); } -[class*='numberListItem_number_list_item'] { +#{contains('numberListItem_number_list_item')} { @include background-color('5'); @include border-color(); &:hover { @include theme-border-color(); } - &[class*='numberListItem_select'] { + &#{contains('numberListItem_select')} { @include theme-border-color(); - [class*='numberListItem_title'] { + #{contains('numberListItem_title')} { @include theme-color(); } } } -[class*='review_review_module'] { +#{contains('review_review_module')} { @include border-color('4'); - [class*='review_review_item_fill'] { + #{contains('review_review_item_fill')} { @include background-color('4'); } - [class*='review_module_title'], - [class*='review_review_title'] { + #{contains('review_module_title')}, + #{contains('review_review_title')} { @include color('e'); } - [class*='review_review_author'] { + #{contains('review_review_author')} { @include color('e'); - &[class*='review_is-vip'] { + &#{contains('review_is-vip')} { @include vip-color(); } } - [class*='review_review_content'] { + #{contains('review_review_content')} { @include color('a'); } } -[class*='epitem_ep_item'] { +#{contains('epitem_ep_item')} { &:hover { @include background-color('5'); } @@ -951,7 +951,7 @@ } } - &[class*='epitem_cursor'] { + &#{contains('epitem_cursor')} { @include background-color('5'); path { @include theme-fill(); @@ -959,83 +959,83 @@ } } -[class*='seasonlist_season_list'] { - [class*='seasonlist_ss_title'] { +#{contains('seasonlist_season_list')} { + #{contains('seasonlist_ss_title')} { @include color('e'); } - [class*='seasonlist_expand_more'] { + #{contains('seasonlist_expand_more')} { @include background-color('4'); @include color('e'); } } -[class*='mediainfo_media_info'] { +#{contains('mediainfo_media_info')} { @include border-color('4'); - [class*='mediainfo_media_desc'] { + #{contains('mediainfo_media_desc')} { &, & i { @include color('e'); } } - [class*='mediainfo_media_title'] { + #{contains('mediainfo_media_title')} { @include color('e'); } - [class*='mediainfo_av_link'], - [class*='mediainfo_home_link'], - [class*='mediainfo_media_pub'] { + #{contains('mediainfo_av_link')}, + #{contains('mediainfo_home_link')}, + #{contains('mediainfo_media_pub')} { @include color('a'); } - [class*='mediainfo_ellipsis'], - [class*='mediainfo_media_desc'] i { + #{contains('mediainfo_ellipsis')}, + #{contains('mediainfo_media_desc')} i { @include background(); @include theme-color(); } } -[class*='section_ep_section_module'] { +#{contains('section_ep_section_module')} { @include background-color('4'); - [class*='section_section_title'] { + #{contains('section_section_title')} { @include color('e'); } } -[class*='RecommendItem_wrap'] { - [class*='RecommendItem_title'] { +#{contains('RecommendItem_wrap')} { + #{contains('RecommendItem_title')} { @include color('e'); } } -[class*='eplist_ep_list_wrapper'] { +#{contains('eplist_ep_list_wrapper')} { @include background-color('4'); - [class*='eplist_list_title'] [class*='eplist_left_wrap'] h4 { + #{contains('eplist_list_title')} #{contains('eplist_left_wrap')} h4 { @include color('e'); } - [class*='numberListItem_title'] { + #{contains('numberListItem_title')} { @include color('e'); } - @include contains('eplist_ep_list_order') { + #{contains('eplist_ep_list_order')} { @include to-theme('blue'); } - @include contains('longListItem_wrap') { + #{contains('longListItem_wrap')} { @include color('e'); &:hover { @include background-color('5'); - @include contains('longListItem_text') { + #{contains('longListItem_text')} { @include theme-color(); } } - @include contains('longListItem_select', &) { + &#{contains('longListItem_select')} { @include background-color('5'); } - @include contains('longListItem_icon') { + #{contains('longListItem_icon')} { path { @include theme-fill(); } } } - @include contains('modeChangeBtn_icon') { + #{contains('modeChangeBtn_icon')} { path { @include fill('a'); } @@ -1044,48 +1044,41 @@ } } } -[class*='operation_split_line'] { +#{contains('operation_split_line')} { @include border-color('4'); } -[class*='mediainfo_btn_rating'] { +#{contains('mediainfo_btn_rating')} { @include background-color(); } -[class*='DanmukuBox_wrap'] { +#{contains('DanmukuBox_wrap')} { @include background(); } -@include contains('paybar_pay_bar') { - @include contains('paybar_btn_pay') { +#{contains('paybar_pay_bar')} { + #{contains('paybar_btn_pay')} { @include border-color(); @include theme-background-color(); @include foreground-color(); - @include contains('paybar_active', &) { + &#{contains('paybar_active')} { @include background-color('4'); @include color('e'); } } } .player-left-components { - @include contains('toolbar_toolbar') { - @include contains('toolbar_item_info') { + #{contains('toolbar_toolbar')} { + #{contains('toolbar_item_info')} { path { @include fill('a'); } - @include contains('toolbar_counts_num') { + #{contains('toolbar_counts_num')} { @include color('a'); } + &#{contains('toolbar_active')}, &:hover { path { @include theme-fill(); } - @include contains('toolbar_counts_num') { - @include theme-color(); - } - } - @include contains('toolbar_active', &) { - path { - @include theme-fill(); - } - @include contains('toolbar_counts_num') { + #{contains('toolbar_counts_num')} { @include theme-color(); } } From 4a0cc2674888118f4cdc17e13e4e73fc5b946c33 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 8 Apr 2023 20:52:19 +0800 Subject: [PATCH 03/26] Update dark styles --- .../lib/components/style/dark-mode/dark-slice-16.scss | 10 +++++----- .../lib/components/style/dark-mode/dark-slice-17.scss | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/registry/lib/components/style/dark-mode/dark-slice-16.scss b/registry/lib/components/style/dark-mode/dark-slice-16.scss index f25ee209a..32d8153fd 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-16.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-16.scss @@ -62,15 +62,15 @@ } } .bili-dyn-publishing { - z-index: 1; // 下面的 to-theme filter 会改变层级, 这里修复一下 @include dyn-container-skeleton(); @include background-color('4'); &__tools { &__item { - &.active, - &:hover { - @include to-theme('blue'); - } + // 这里用 filter 会导致弹窗内容也被影响, 暂时先去掉了 + // &.active, + // &:hover { + // @include to-theme('blue'); + // } &.emoji { @include background-color(); } 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 e7dfb1dd8..a810063d7 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-17.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-17.scss @@ -1085,3 +1085,8 @@ } } } +.bili-dyn-item { + .b-img { + @include background-color('3'); + } +} From 1a5aeba4c88794d3647ddb9d104048915b686127 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 8 Apr 2023 21:31:05 +0800 Subject: [PATCH 04/26] Fix bpx playerModePolyfill (#4007) --- src/components/video/player-adaptor/bpx.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/video/player-adaptor/bpx.ts b/src/components/video/player-adaptor/bpx.ts index 7c36d1ced..a5318905d 100644 --- a/src/components/video/player-adaptor/bpx.ts +++ b/src/components/video/player-adaptor/bpx.ts @@ -1,8 +1,9 @@ import { attributes } from '@/core/observer' import { select } from '@/core/spin-query' -import { preventEvent } from '@/core/utils' +import { playerReady, preventEvent } from '@/core/utils' const playerModePolyfill = async () => { + await playerReady() const bpxContainer = (await select('.bpx-player-container')) as HTMLElement if (!bpxContainer) { console.warn('[bpx player polyfill] bpxContainer not found') From 508b79115862c0fd3e676aa579c64dc48767987e Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 8 Apr 2023 22:33:17 +0800 Subject: [PATCH 05/26] Update dark styles for bangumi page (#4007) --- .../style/dark-mode/dark-mode.important.scss | 1 + .../components/style/dark-mode/dark-mode.scss | 1 + .../style/dark-mode/dark-slice-17.scss | 4 +- .../style/dark-mode/dark-slice-18.scss | 153 ++++++++++++++++++ 4 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 registry/lib/components/style/dark-mode/dark-slice-18.scss 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 4fb067077..4b0bd145e 100644 --- a/registry/lib/components/style/dark-mode/dark-mode.important.scss +++ b/registry/lib/components/style/dark-mode/dark-mode.important.scss @@ -1,4 +1,5 @@ @import './dark-definitions'; +@import 'common'; #disable-popup-modal, #vip-exchange-modal { diff --git a/registry/lib/components/style/dark-mode/dark-mode.scss b/registry/lib/components/style/dark-mode/dark-mode.scss index 9558efb73..179bef57b 100644 --- a/registry/lib/components/style/dark-mode/dark-mode.scss +++ b/registry/lib/components/style/dark-mode/dark-mode.scss @@ -15,5 +15,6 @@ @import "./dark-slice-15.scss"; @import "./dark-slice-16.scss"; @import "./dark-slice-17.scss"; +@import "./dark-slice-18.scss"; @import "./dark-navbar.scss"; @import "./dark-variables.scss"; 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 a810063d7..89c552fea 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-17.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-17.scss @@ -1067,7 +1067,7 @@ .player-left-components { #{contains('toolbar_toolbar')} { #{contains('toolbar_item_info')} { - path { + #{contains('toolbar_icon')} path { @include fill('a'); } #{contains('toolbar_counts_num')} { @@ -1075,7 +1075,7 @@ } &#{contains('toolbar_active')}, &:hover { - path { + #{contains('toolbar_icon')}path { @include theme-fill(); } #{contains('toolbar_counts_num')} { diff --git a/registry/lib/components/style/dark-mode/dark-slice-18.scss b/registry/lib/components/style/dark-mode/dark-slice-18.scss new file mode 100644 index 000000000..2e6b2e2ed --- /dev/null +++ b/registry/lib/components/style/dark-mode/dark-slice-18.scss @@ -0,0 +1,153 @@ +@import './dark-definitions'; +@import 'common'; + +#{contains('mediainfo_media_toolbar')} { + #{contains('mediainfo_btn_rating')} { + @include color('a'); + @include border-color('4'); + } + #{contains('mediainfo_btn_follow')} { + &#{contains('mediainfo_follow_active')}#ogv-weslie-media-info-follow { + @include background-color('4'); + @include color('a'); + } + } + #{contains('mediainfo_follow_options_list')} { + @include background-color('3'); + @include border-color(); + li { + @include color('e'); + &#{contains('mediainfo_disabled')} { + @include color('6'); + } + &:hover { + @include background-color('5'); + } + } + } +} +#{contains('upinfo_up_info')} { + #{contains('upinfo_btn_follow_up')} { + @include theme-color(); + } +} +#{contains('seasonlist_ss_badge')} { + &#{contains('seasonlist_blue')} { + @include theme-background-color(); + } +} +#{contains('navTools_wrap')} { + #{contains('navTools_item')} { + @include background-color('3'); + @include border-color('4'); + @include color('a'); + path { + @include fill('a'); + } + &:hover { + @include theme-background-color(); + @include border-color(); + @include foreground-color(); + path { + @include foreground-fill(); + } + } + } +} +#{contains('toolbar_watch_more')} { + @include background-color('3'); + @include border-color('4'); + @include no-shadow(); + #{contains('toolbar_title')} { + @include color('e'); + } +} +#{contains('toolbar_mobile_more')} { + @include background-color('3'); + @include border-color('4'); + @include no-shadow(); + #{contains('toolbar_video_title')} { + @include color('e'); + } + #{contains('toolbar_mobile_tip')} { + @include color('a'); + #{contains('toolbar_mobile_link')} { + @include theme-color(); + } + } + // 二维码需要加个边框才能识别 + canvas { + padding: 4px; + background-color: #fff; + } +} +#{contains('toolbar_share_more')} { + @include background-color('3'); + @include border-color('4'); + @include no-shadow(); + #{contains('toolbar_share_desc')} { + @include color('e'); + } + #{contains('toolbar_share_btn')} { + &:hover { + #{contains('toolbar_share_desc')} { + @include theme-color(); + } + } + &:not(#share_tieba) { + svg { + circle { + @include fill('e'); + // 这一排图标只有贴吧是做了减去顶层的... 其他的只能填个和背景相同的颜色假装是挖空的效果 + ~ path { + @include fill('3'); + } + } + } + &:hover { + circle { + @include theme-fill(); + } + } + } + } + #share_tieba { + path { + @include fill('e'); + } + &:hover path { + @include theme-fill(); + } + } +} +#{contains('dialogcoin_coin_operated')} { + @include background-color('3'); + #{contains('dialogcoin_icon_close')} { + path { + @include fill('a'); + } + } + #{contains('dialogcoin_coin_title')} { + @include color('e'); + span { + @include theme-color(); + } + } + #{contains('dialogcoin_like_checkbox')} { + @include color('e'); + input[type='checkbox']:checked + i { + @include to-theme('blue'); + } + } + #{contains('dialogcoin_coin_btn')} { + @include theme-background-color(); + @include border-color(); + @include foreground-color(); + &:hover { + @include theme-background-color('90'); + } + } + #{contains('dialogcoin_tips')} { + @include color('a'); + } +} From 315d830b20445384d5eae199496224c4dce90bc6 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 8 Apr 2023 22:45:54 +0800 Subject: [PATCH 06/26] Fix bvid convert (#4007) --- .../video/bvid-convert/BvidConvert.vue | 23 ++++++++----------- src/components/video/player-adaptor/bpx.ts | 4 ++-- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/registry/lib/components/video/bvid-convert/BvidConvert.vue b/registry/lib/components/video/bvid-convert/BvidConvert.vue index c22c0b631..d4082ba56 100644 --- a/registry/lib/components/video/bvid-convert/BvidConvert.vue +++ b/registry/lib/components/video/bvid-convert/BvidConvert.vue @@ -1,19 +1,17 @@ @@ -112,7 +110,6 @@ export default Vue.extend({ flex-direction: column; border-radius: 4px; padding: 6px 8px; - width: 100%; user-select: text; box-sizing: border-box; box-shadow: 0 0 0 1px #8884; diff --git a/src/components/video/player-adaptor/bpx.ts b/src/components/video/player-adaptor/bpx.ts index a5318905d..5ba6c5790 100644 --- a/src/components/video/player-adaptor/bpx.ts +++ b/src/components/video/player-adaptor/bpx.ts @@ -30,8 +30,8 @@ const idPolyfill = async () => { cid: pbp.options.cid.toString(), bvid: pbp.options.bvid, } - if (Object.values(idData).some(it => it === '' || parseInt(it) <= 0)) { - console.warn('[bpx player polyfill] invalid pbp data') + if (Object.values(idData).some(it => !it || parseInt(it) <= 0)) { + console.warn('[bpx player polyfill] invalid pbp data', pbp.options) } Object.assign(unsafeWindow, idData) } From f22105f3986d3ae04473b24f914490b264c27ffe Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 8 Apr 2023 22:49:09 +0800 Subject: [PATCH 07/26] Deprecate Ajax Hook API (#4117) --- src/plugins/ajax-hook/index.ts | 4 ++++ src/plugins/ajax-hook/listeners.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/ajax-hook/index.ts b/src/plugins/ajax-hook/index.ts index 1b48bb326..1fad39ce6 100644 --- a/src/plugins/ajax-hook/index.ts +++ b/src/plugins/ajax-hook/index.ts @@ -1,8 +1,12 @@ +/* ⚠ Ajax Hook API 已废弃, 请勿使用 */ + import { PluginMetadata } from '../plugin' // https://github.com/the1812/Bilibili-Evolved/issues/84 let ajaxHooked = false const handlerMap: Map void)[]> = new Map() + +/** @deprecated ⚠ Ajax Hook API 已废弃, 请勿使用 */ export const getHandlers = (name: string) => { const lowercase = name.toLowerCase() let handlers = handlerMap.get(lowercase) diff --git a/src/plugins/ajax-hook/listeners.ts b/src/plugins/ajax-hook/listeners.ts index 5138824f5..40945f9c2 100644 --- a/src/plugins/ajax-hook/listeners.ts +++ b/src/plugins/ajax-hook/listeners.ts @@ -1,3 +1,5 @@ +/* ⚠ Ajax Hook API 已废弃, 请勿使用 */ + import { getHandlers } from '.' type AjaxListenerType = @@ -12,6 +14,7 @@ type AjaxListenerType = /** * 添加Ajax监听器 + * @deprecated ⚠ Ajax Hook API 已废弃, 请勿使用 * @param type 事件类型 * @param listener 监听器函数 */ @@ -20,6 +23,7 @@ export const addAjaxListener = (type: AjaxListenerType, listener: (...args: any[ } /** * 移除Ajax监听器 + * @deprecated ⚠ Ajax Hook API 已废弃, 请勿使用 * @param type 事件类型 * @param listener 监听器函数 */ From a16eb0feb361a63d99f7008489e5f3930481d0b2 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 8 Apr 2023 23:54:27 +0800 Subject: [PATCH 08/26] Update dark styles --- registry/lib/components/style/dark-mode/dark-slice-15.scss | 5 +++++ 1 file changed, 5 insertions(+) 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 e578ab6e5..e13005666 100644 --- a/registry/lib/components/style/dark-mode/dark-slice-15.scss +++ b/registry/lib/components/style/dark-mode/dark-slice-15.scss @@ -218,6 +218,11 @@ .bpx-player-dm-switch { @include fill('a'); } + .bui-danmaku-switch-on { + path:last-child { + @include theme-fill(); + } + } .bpx-player-dm-switch:hover, .bpx-player-dm-setting:hover, .bpx-player-video-btn-dm:hover { From e8b4811681471cc762639e26b1e84740c78cf5e4 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sun, 9 Apr 2023 11:46:14 +0800 Subject: [PATCH 09/26] Fix season id (fix #4044) --- .../video/download/inputs/bangumi/batch.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/registry/lib/components/video/download/inputs/bangumi/batch.ts b/registry/lib/components/video/download/inputs/bangumi/batch.ts index 0f76fa9d8..b2ed73264 100644 --- a/registry/lib/components/video/download/inputs/bangumi/batch.ts +++ b/registry/lib/components/video/download/inputs/bangumi/batch.ts @@ -15,12 +15,18 @@ export const bangumiBatchInput: DownloadVideoInput = { getInputs: async instance => instance?.checkedInputItems ?? [], component: async () => createEpisodesPicker(async instance => { - const metaUrl = document.querySelector("meta[property='og:url']") - if (metaUrl === null) { - logError('获取番剧数据失败: 无法找到 Season ID') + const metadata = dq('script[type="application/ld+json"]') + if (!metadata) { + logError('获取番剧数据失败: 无法找到 Metadata') return [] } - const seasonId = metaUrl.getAttribute('content')?.match(/play\/ss(\d+)/)?.[1] + const metadataJson = JSON.parse(metadata.innerHTML.trim()) + const metaUrl: string = lodash.get(metadataJson, 'itemListElement.0.url', null) + if (metaUrl === null) { + logError('获取番剧数据失败: 无法找到 metaUrl') + return [] + } + const seasonId = metaUrl.match(/play\/ss(\d+)/)?.[1] if (seasonId === undefined) { logError('获取番剧数据失败: 无法解析 Season ID') return [] From 3b7d705fca984769d08f232402a9d422bb0e761a Mon Sep 17 00:00:00 2001 From: the1812 Date: Sun, 9 Apr 2023 12:08:24 +0800 Subject: [PATCH 10/26] Fix element null --- registry/lib/components/video/full-episode-title/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/registry/lib/components/video/full-episode-title/index.ts b/registry/lib/components/video/full-episode-title/index.ts index 35bbf44ae..3814909db 100644 --- a/registry/lib/components/video/full-episode-title/index.ts +++ b/registry/lib/components/video/full-episode-title/index.ts @@ -39,6 +39,9 @@ export const component = defineComponentMetadata({ select('.multi-page-v1 .head-left h3'), select('.base-video-sections-v1 .first-line-title'), ]).then(titleElement => { + if (!titleElement) { + return + } titleElement.addEventListener( 'click', (e: MouseEvent) => { From 650ffad6c22747e212100069d7bbaf0503242e9e Mon Sep 17 00:00:00 2001 From: the1812 Date: Sun, 9 Apr 2023 15:11:10 +0800 Subject: [PATCH 11/26] Fix video action buttons in watchlater (#3916) --- .../outer-watchlater/OuterWatchlater.vue | 13 ++++++++-- .../video/outer-watchlater/index.ts | 26 +++++++------------ .../video/quick-favorite/QuickFavorite.vue | 8 +++--- .../components/video/quick-favorite/index.ts | 23 +++++----------- src/components/api.ts | 2 ++ src/components/video/video-actions.ts | 26 +++++++++++++++++++ src/core/utils/urls.ts | 5 +++- 7 files changed, 63 insertions(+), 40 deletions(-) create mode 100644 src/components/video/video-actions.ts diff --git a/registry/lib/components/video/outer-watchlater/OuterWatchlater.vue b/registry/lib/components/video/outer-watchlater/OuterWatchlater.vue index 852ff9ba2..66ba0f847 100644 --- a/registry/lib/components/video/outer-watchlater/OuterWatchlater.vue +++ b/registry/lib/components/video/outer-watchlater/OuterWatchlater.vue @@ -1,5 +1,10 @@