From fb1b2c0cfbe9166bd41b7354514fee83bb3cbfc8 Mon Sep 17 00:00:00 2001 From: Rinne Date: Sun, 27 Apr 2025 23:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=B9=E6=8D=AE=E5=85=B3?= =?UTF-8?q?=E6=B3=A8=E5=88=86=E7=BB=84=E7=AD=9B=E9=80=89=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feeds/group-filter/FilterPanel.vue | 169 ++++++++++++++++++ .../feeds/group-filter/_blocker.scss | 6 + .../components/feeds/group-filter/index.md | 1 + .../components/feeds/group-filter/index.ts | 34 ++++ 4 files changed, 210 insertions(+) create mode 100644 registry/lib/components/feeds/group-filter/FilterPanel.vue create mode 100644 registry/lib/components/feeds/group-filter/_blocker.scss create mode 100644 registry/lib/components/feeds/group-filter/index.md create mode 100644 registry/lib/components/feeds/group-filter/index.ts diff --git a/registry/lib/components/feeds/group-filter/FilterPanel.vue b/registry/lib/components/feeds/group-filter/FilterPanel.vue new file mode 100644 index 000000000..57d611817 --- /dev/null +++ b/registry/lib/components/feeds/group-filter/FilterPanel.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/registry/lib/components/feeds/group-filter/_blocker.scss b/registry/lib/components/feeds/group-filter/_blocker.scss new file mode 100644 index 000000000..380b04995 --- /dev/null +++ b/registry/lib/components/feeds/group-filter/_blocker.scss @@ -0,0 +1,6 @@ +@mixin pattern-block { + .bili-dyn-list__item.pattern-block, + .feed-card .card.pattern-block { + display: none !important; + } +} diff --git a/registry/lib/components/feeds/group-filter/index.md b/registry/lib/components/feeds/group-filter/index.md new file mode 100644 index 000000000..2bed93a06 --- /dev/null +++ b/registry/lib/components/feeds/group-filter/index.md @@ -0,0 +1 @@ +按照关注分组筛选动态 diff --git a/registry/lib/components/feeds/group-filter/index.ts b/registry/lib/components/feeds/group-filter/index.ts new file mode 100644 index 000000000..704e38731 --- /dev/null +++ b/registry/lib/components/feeds/group-filter/index.ts @@ -0,0 +1,34 @@ +import { defineComponentMetadata } from '@/components/define' +import { feedsCardsManager } from '@/components/feeds/api' + +const entry = async () => { + const { select } = await import('@/core/spin-query') + let leftPanel: HTMLElement + if (feedsCardsManager.managerType === 'v2') { + const leftAside = await select('.bili-dyn-home--member aside.left') + const section = document.createElement('section') + section.classList.add('group-filter-section') + leftAside.insertAdjacentElement('afterbegin', section) + leftPanel = section + } else { + leftPanel = await select('.home-container .left-panel') + } + if (leftPanel === null) { + return + } + const FeedsFilterCard = await import('./FilterPanel.vue') + const { mountVueComponent } = await import('@/core/utils') + leftPanel.insertAdjacentElement('afterbegin', mountVueComponent(FeedsFilterCard).$el) +} + +export const component = defineComponentMetadata({ + name: 'groupFilter', + entry, + displayName: '动态分组过滤', + author: { name: 'Rinne', link: 'https://github.com/OharaRinneY' }, + urlInclude: [ + // 仅动态首页 + /^https:\/\/t\.bilibili\.com\/$/, + ], + tags: [componentsTags.feeds], +})