diff --git a/src/background/messageListeners/video.ts b/src/background/messageListeners/video.ts index 0cc3ee3d..3b0848ae 100644 --- a/src/background/messageListeners/video.ts +++ b/src/background/messageListeners/video.ts @@ -91,6 +91,14 @@ function handleMessage(message: any) { .then(data => data) .catch(error => console.error(error)) } + // https://github.com/SocialSisterYi/bilibili-API-collect/blob/def57d7a70ed1f39080069ba0f40648ce6ce2b90/docs/video_ranking/popular.md#%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E7%83%AD%E9%97%A8%E8%A7%86%E9%A2%91%E5%88%97%E8%A1%A8 + else if (message.contentScriptQuery === 'getPopularVideos') { + const url = `https://api.bilibili.com/x/web-interface/popular?pn=${message.pn ?? 1}&ps=${message.ps ?? 20}` + return fetch(url) + .then(response => response.json()) + .then(data => data) + .catch(error => console.error(error)) + } } function handleConnect() { diff --git a/src/components/VideoCard.vue b/src/components/VideoCard.vue index f39724e0..ac570368 100644 --- a/src/components/VideoCard.vue +++ b/src/components/VideoCard.vue @@ -22,6 +22,7 @@ const props = defineProps<{ aid?: number isFollowed?: boolean horizontal?: boolean + tag?: string }>() const videoUrl = computed(() => { @@ -64,6 +65,17 @@ function toggleWatchLater() { } } +function handleMouseMove() { + contentVisibility.value = 'visible' +} + +function handelMouseLeave() { + clearTimeout(mouseLeaveTimeOut.value) + mouseLeaveTimeOut.value = setTimeout(() => { + contentVisibility.value = 'auto' + }, 300) +} + // function submitDislike( // reasonID: number, // goto: string, @@ -125,45 +137,12 @@ function toggleWatchLater() {