From bcdd87092f91ad8f1bffa72156b9adeeacc3279e Mon Sep 17 00:00:00 2001 From: Hakadao Date: Wed, 14 Feb 2024 02:00:01 +0800 Subject: [PATCH 1/8] fix: resolve #247 --- src/components/VideoCard/VideoCard.vue | 3 +++ src/contentScripts/views/Home/components/ForYou.vue | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/VideoCard/VideoCard.vue b/src/components/VideoCard/VideoCard.vue index 941c0822..bdfdbb4f 100644 --- a/src/components/VideoCard/VideoCard.vue +++ b/src/components/VideoCard/VideoCard.vue @@ -22,6 +22,7 @@ interface Props { capsuleText?: string bvid?: string aid?: number + uri?: string /** If you want to show preview video, you should set the cid value */ cid?: number epid?: number @@ -42,6 +43,8 @@ const videoUrl = computed(() => { return `https://www.bilibili.com/video/${props.bvid ?? `av${props.aid}`}` else if (props.epid) return `https://www.bilibili.com/bangumi/play/ep${props.epid}` + else if (props.uri) + return props.uri else return '' }) diff --git a/src/contentScripts/views/Home/components/ForYou.vue b/src/contentScripts/views/Home/components/ForYou.vue index a4a087fd..fa220600 100644 --- a/src/contentScripts/views/Home/components/ForYou.vue +++ b/src/contentScripts/views/Home/components/ForYou.vue @@ -173,6 +173,7 @@ function jumpToLoginPage() { :published-timestamp="video.pubdate" :bvid="video.bvid" :cid="video.cid" + :uri="video.uri" show-preview /> @@ -191,7 +192,8 @@ function jumpToLoginPage() { :bvid="video.bvid" :view-str="video.cover_left_text_1" :danmaku-str="video.cover_left_text_2" - :cid="video?.player_args?.cid " + :cid="video?.player_args?.cid" + :uri="video.uri" show-preview /> From c3be373b1f9b2ae58679876ccbeb7f6cb3026e17 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Wed, 14 Feb 2024 17:04:44 +0800 Subject: [PATCH 2/8] style: adjust the background color of text selection --- src/styles/main.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/main.scss b/src/styles/main.scss index 39d28c54..c019e2a2 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -31,8 +31,8 @@ html.bewly-design > ::-webkit-scrollbar-track { } ::selection { - color: white; - background: var(--bew-theme-color-80); + color: var(--bew-text-1); + background: var(--bew-fill-3); } html.bewly-design, From ba9aad596d97d8244742a0fb3dd6a7bd1eb65f46 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Wed, 14 Feb 2024 23:48:12 +0800 Subject: [PATCH 3/8] style: adjust --bew-filter-icon-glow effect --- src/styles/variables.scss | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/styles/variables.scss b/src/styles/variables.scss index 381889db..759c8fed 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -5,8 +5,11 @@ --bew-filter-glass: blur(20px) saturate(180%); --bew-filter-icon-glow: saturate(0) brightness(2) - drop-shadow(0 0 2px var(--bew-theme-color)) - drop-shadow(0 0 4px var(--bew-theme-color)); + drop-shadow(0 0 0.5px white) + drop-shadow(0 0 0.5px var(--bew-theme-color)) + drop-shadow(0 0 0.5px var(--bew-theme-color)) + drop-shadow(0 0 0.5px var(--bew-theme-color)) + drop-shadow(0 0 2px var(--bew-theme-color-80)); // #region shadow --bew-shadow-1: 0 4px 6px -1px rgb(0 0 0 / 0.1), From 4f9250d22a20463764ac0f3bb7279c93e04ddd3d Mon Sep 17 00:00:00 2001 From: Hakadao Date: Wed, 14 Feb 2024 23:50:00 +0800 Subject: [PATCH 4/8] style: adjust styles --- src/styles/adaptedStyles/comments.scss | 7 +------ src/styles/main.scss | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/styles/adaptedStyles/comments.scss b/src/styles/adaptedStyles/comments.scss index b4ea1661..7b7541ca 100644 --- a/src/styles/adaptedStyles/comments.scss +++ b/src/styles/adaptedStyles/comments.scss @@ -57,12 +57,7 @@ color: var(--bew-theme-color-80); } - .reply-content-container .reply-content .icon { - filter: saturate(0) brightness(2) - drop-shadow(0 0 1px var(--bew-theme-color)) - drop-shadow(0 0 4px var(--bew-theme-color)); - } - + .reply-content-container .reply-content .icon, .bb-comment .comment-list .list-item .text .jump-img, .comment-bilibili-fold .comment-list .list-item .text .jump-img, .bb-comment .comment-list .list-item .text-con .jump-img, diff --git a/src/styles/main.scss b/src/styles/main.scss index c019e2a2..74289fff 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -32,6 +32,10 @@ html.bewly-design > ::-webkit-scrollbar-track { ::selection { color: var(--bew-text-1); + background: var(--bew-fill-2); +} + +.dark ::selection { background: var(--bew-fill-3); } From 2adad911f1d2fa32b0774493b66b9f8208fe4471 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Thu, 15 Feb 2024 00:05:12 +0800 Subject: [PATCH 5/8] style: adjust --bew-filter-icon-glow effect --- src/styles/variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/variables.scss b/src/styles/variables.scss index 759c8fed..b729c45e 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -5,7 +5,7 @@ --bew-filter-glass: blur(20px) saturate(180%); --bew-filter-icon-glow: saturate(0) brightness(2) - drop-shadow(0 0 0.5px white) + drop-shadow(0 0 0.2px white) drop-shadow(0 0 0.5px var(--bew-theme-color)) drop-shadow(0 0 0.5px var(--bew-theme-color)) drop-shadow(0 0 0.5px var(--bew-theme-color)) From f7f7698403670839ea256cc6494e4e5daf676841 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Thu, 15 Feb 2024 02:09:44 +0800 Subject: [PATCH 6/8] refactor: #204 --- .../LongCoverCard/LongCoverCard.vue | 19 +++++---- .../TopBar/components/HistoryPop.vue | 39 +++++++++---------- .../TopBar/components/MomentsPop.vue | 32 +++++++-------- src/components/VideoCard/VideoCard.vue | 36 ++++++++--------- .../views/Favorites/Favorites.vue | 3 +- src/contentScripts/views/History/History.vue | 28 +++++-------- .../views/WatchLater/WatchLater.vue | 14 +++---- src/utils/main.ts | 3 +- 8 files changed, 77 insertions(+), 97 deletions(-) diff --git a/src/components/LongCoverCard/LongCoverCard.vue b/src/components/LongCoverCard/LongCoverCard.vue index 5160b57b..2a711b9d 100644 --- a/src/components/LongCoverCard/LongCoverCard.vue +++ b/src/components/LongCoverCard/LongCoverCard.vue @@ -18,20 +18,20 @@ defineProps<{ diff --git a/src/components/TopBar/components/HistoryPop.vue b/src/components/TopBar/components/HistoryPop.vue index d33f2c3b..37caf46c 100644 --- a/src/components/TopBar/components/HistoryPop.vue +++ b/src/components/TopBar/components/HistoryPop.vue @@ -5,7 +5,7 @@ import { onMounted, reactive, ref, watch } from 'vue' import { useDateFormat } from '@vueuse/core' import type { HistoryItem } from '../types' import { HistoryType } from '../types' -import { removeHttpFromUrl, smoothScrollToTop } from '~/utils/main' +import { isHomePage, removeHttpFromUrl, smoothScrollToTop } from '~/utils/main' import { calcCurrentTime } from '~/utils/dataFormatter' const { t } = useI18n() @@ -199,7 +199,10 @@ function getHistoryList(type: HistoryType, viewAt = 0 as number) { {{ tab.name }} - + {{ $t('common.view_all') }} @@ -208,7 +211,7 @@ function getHistoryList(type: HistoryType, viewAt = 0 as number) {
- + - + -
+
- + diff --git a/src/components/TopBar/components/MomentsPop.vue b/src/components/TopBar/components/MomentsPop.vue index 42128575..fc2922bd 100644 --- a/src/components/TopBar/components/MomentsPop.vue +++ b/src/components/TopBar/components/MomentsPop.vue @@ -5,7 +5,7 @@ import { onMounted, reactive, ref, watch } from 'vue' import { isNewArticle, isNewVideo, setLastestOffsetID } from '../notify' import { MomentType } from '../types' import type { MomentItem } from '../types' -import { getCSRF, getUserID, smoothScrollToTop } from '~/utils/main' +import { getCSRF, getUserID, isHomePage, smoothScrollToTop } from '~/utils/main' import { calcTimeSince } from '~/utils/dataFormatter' const { t } = useI18n() @@ -308,7 +308,10 @@ function toggleWatchLater(aid: number) { {{ tab.name }}
- + {{ $t('common.view_all') }} @@ -317,7 +320,7 @@ function toggleWatchLater(aid: number) {
- @@ -342,17 +341,12 @@ function toggleWatchLater(aid: number) { @@ -373,7 +367,7 @@ function toggleWatchLater(aid: number) { ? `https://space.bilibili.com/${moment.uid}` : moment.url " - target="_blank" + :target="isHomePage() ? '_blank' : '_self'" rel="noopener noreferrer" > -
+ @@ -314,10 +315,8 @@ function handelMouseLeave() { - - {{ title }} + + {{ title }} + diff --git a/src/contentScripts/views/Favorites/Favorites.vue b/src/contentScripts/views/Favorites/Favorites.vue index 476c230d..b1f43be7 100644 --- a/src/contentScripts/views/Favorites/Favorites.vue +++ b/src/contentScripts/views/Favorites/Favorites.vue @@ -195,7 +195,6 @@ function handleUnfavorite(favoriteResource: FavoriteResource) { diff --git a/src/contentScripts/views/History/History.vue b/src/contentScripts/views/History/History.vue index 15b25863..043ce6c7 100644 --- a/src/contentScripts/views/History/History.vue +++ b/src/contentScripts/views/History/History.vue @@ -261,12 +261,12 @@ function jumpToLoginPage() {
- +

- {{ - historyItem.show_title - ? historyItem.show_title - : historyItem.title - }} + {{ historyItem.show_title ? historyItem.show_title : historyItem.title }}

diff --git a/src/contentScripts/views/WatchLater/WatchLater.vue b/src/contentScripts/views/WatchLater/WatchLater.vue index 57d516db..9a1154b6 100644 --- a/src/contentScripts/views/WatchLater/WatchLater.vue +++ b/src/contentScripts/views/WatchLater/WatchLater.vue @@ -117,11 +117,9 @@ function jumpToLoginPage() {
{{ item.title }} @@ -214,8 +211,7 @@ function jumpToLoginPage() { hover:bg="$bew-theme-color-10" duration-300 pr-2 - :href="`//space.bilibili.com/${item.owner.mid}`" target="_blank" - @click.stop="" + :href="`//space.bilibili.com/${item.owner.mid}`" target="_blank" rel="noopener noreferrer" > diff --git a/src/utils/main.ts b/src/utils/main.ts index 39696e40..45fd492c 100644 --- a/src/utils/main.ts +++ b/src/utils/main.ts @@ -8,6 +8,7 @@ export function getCookie(name: string): string { const parts: Array = value.split(`; ${name}=`) if (parts.length === 2) return parts?.pop()?.split(';').shift() || '' + return '' } /** @@ -43,7 +44,7 @@ export function removeHttpFromUrl(url: string): string { } export function openLinkToNewTab(url: string) { - window.open(url, '_blank') + window.open(url, '_blank', 'noopener noreferrer') } /** From 7e033f3de0679ca895b10f8dd6e12cf3db959975 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Thu, 15 Feb 2024 02:19:25 +0800 Subject: [PATCH 7/8] refactor: #204 --- .../TopBar/components/FavoritesPop.vue | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/components/TopBar/components/FavoritesPop.vue b/src/components/TopBar/components/FavoritesPop.vue index b9d7746b..97992d07 100644 --- a/src/components/TopBar/components/FavoritesPop.vue +++ b/src/components/TopBar/components/FavoritesPop.vue @@ -2,7 +2,7 @@ import type { Ref } from 'vue' import { onMounted, reactive, ref, watch } from 'vue' import type { FavoriteCategory, FavoriteResource } from '../types' -import { getUserID, removeHttpFromUrl, smoothScrollToTop } from '~/utils/main' +import { getUserID, isHomePage, removeHttpFromUrl, smoothScrollToTop } from '~/utils/main' import { calcCurrentTime } from '~/utils/dataFormatter' const favoriteCategories = reactive>([]) @@ -148,20 +148,20 @@ defineExpose({ {{ activatedFavoriteTitle }} - + {{ $t('common.view_all') }}