diff --git a/src/background/apis/anime.ts b/src/background/apis/anime.ts
new file mode 100644
index 00000000..28cf6fce
--- /dev/null
+++ b/src/background/apis/anime.ts
@@ -0,0 +1,14 @@
+import browser from 'webextension-polyfill'
+
+export const setupAnimeAPIs = () => {
+ browser.runtime.onMessage.addListener((message) => {
+ // get popular anime list
+ if (message.contentScriptQuery === 'getPopularAnimeList') {
+ const url = 'https://api.bilibili.com/pgc/web/rank/list?season_type=1&day=3'
+ return fetch(url)
+ .then(response => response.json())
+ .then(data => data)
+ .catch(error => console.error(error))
+ }
+ })
+}
diff --git a/src/background/apis/index.ts b/src/background/apis/index.ts
index 50f8ab7f..e4df751d 100644
--- a/src/background/apis/index.ts
+++ b/src/background/apis/index.ts
@@ -1,3 +1,4 @@
+import { setupAnimeAPIs } from './anime'
import { setupAuthAPIs } from './auth'
import { setupVideosAPIs } from './videos'
import { setupUserAPIs } from './user'
@@ -19,4 +20,5 @@ export const setupAllAPIs = () => {
setupMomentsAPIs()
setupHistoryAPIs()
setupFavoritesAPIs()
+ setupAnimeAPIs()
}
diff --git a/src/contentScripts/views/Anime/Anime.vue b/src/contentScripts/views/Anime/Anime.vue
new file mode 100644
index 00000000..3dbe5a59
--- /dev/null
+++ b/src/contentScripts/views/Anime/Anime.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
+
diff --git a/src/contentScripts/views/Anime/components/types.ts b/src/contentScripts/views/Anime/components/types.ts
new file mode 100644
index 00000000..603c9d9a
--- /dev/null
+++ b/src/contentScripts/views/Anime/components/types.ts
@@ -0,0 +1,27 @@
+export interface PopularAnime {
+ badge: '独家' | '会员抢先' | '会员专享' | '出品'
+ badge_info: {
+ bg_color: string
+ bg_color_night: string
+ text: string
+ }
+ badge_type: number
+ copyright: string
+ cover: string // 豎向封面
+ new_ep: {
+ cover: string
+ index_show: string
+ }
+ rank: number // 排名
+ rating: string // 評分
+ season_id: number
+ ss_horizontal_cover: string // 橫向封面
+ stat: {
+ danmaku: number // 彈幕
+ follow: number // 訂閲
+ series_follow: number // 當前系列訂閲???
+ view: number // 觀看數
+ }
+ title: string
+ url: string
+}
diff --git a/src/contentScripts/views/App.vue b/src/contentScripts/views/App.vue
index b813493d..301d8473 100644
--- a/src/contentScripts/views/App.vue
+++ b/src/contentScripts/views/App.vue
@@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'
import browser from 'webextension-polyfill'
import Home from './Home/Home.vue'
import Search from './Search/Search.vue'
+import Anime from './Anime/Anime.vue'
import { activatedPage, isShowTopbar } from '~/logic/storage'
import { language } from '~/logic'
import '~/styles/index.ts'
@@ -75,58 +76,45 @@ function changeActivatePage(pageName: AppPage) {
>
+ {{ item.title }}
+