Skip to content

Commit

Permalink
feat: hide home carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
Liumingxun committed Aug 1, 2024
1 parent a1df99a commit 320a4f9
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
packages/
typings/
dist/
**/dist/
dev/
node_modules/
!.github-json/
Expand Down
4 changes: 2 additions & 2 deletions registry/dist/components/style/simplify/home.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 22 additions & 3 deletions registry/lib/components/style/simplify/home/home.scss
Original file line number Diff line number Diff line change
@@ -1,33 +1,46 @@
body.simplifyHome-switch {
&-carousel {
.recommended-swipe.grid-anchor {
display: none !important;
}
}

&-categories {
.z-top-container.has-menu {
height: auto !important;
min-height: unset !important;
}
.bili-header-m > .bili-wrapper {

.bili-header-m>.bili-wrapper {
visibility: hidden !important;
height: 18px !important;
}

.primary-menu-itnl {
visibility: hidden !important;
height: 24px !important;
padding: 0 !important;
}

.bili-header__channel {
height: 12px !important;
}
.bili-header__channel > * {

.bili-header__channel>* {
display: none !important;
}

&.header-v3 .bili-wrapper {
padding-top: 8px !important;
border-top: none !important;
}
}

&-trends {
.first-screen #reportFirst1 {
display: none !important;
}

.first-screen .space-between {
margin-bottom: 0 !important;
}
Expand All @@ -38,30 +51,36 @@ body.simplifyHome-switch {
display: none !important;
}
}

&-online {
.first-screen #reportFirst2 {
display: none !important;
}
}

&-ext-box {
.first-screen #reportFirst3 {
display: none !important;
}
}

&-special {
#bili_report_spe_rec {
display: none !important;
}
}

&-contact {

.bili-footer .b-footer-wrap,
.international-footer {
display: none !important;
}
}

&-elevator {
.storey-box .elevator {
display: none !important;
}
}
}
}
24 changes: 15 additions & 9 deletions registry/lib/components/style/simplify/home/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { mainSiteUrls } from '@/core/utils/urls'
const switchMetadata = defineSwitchMetadata({
name: 'simplifyOptions',
switches: {
carousel: {
defaultValue: false,
displayName: '轮播图',
},
categories: {
defaultValue: false,
displayName: '分区栏',
Expand Down Expand Up @@ -74,15 +78,17 @@ export const component = wrapSwitchOptions(switchMetadata)({
() => dqa('.proxy-box > div'),
elements => elements.length > 0 || !isHome,
)
return Object.fromEntries(
categoryElements.map(it => [
it.id.replace(/^bili_/, ''),
{
displayName: it.querySelector('header .name')?.textContent?.trim() ?? '未知分区',
defaultValue: false,
},
]),
)
return categoryElements
? Object.fromEntries(
categoryElements.map(it => [
it.id.replace(/^bili_/, ''),
{
displayName: it.querySelector('header .name')?.textContent?.trim() ?? '未知分区',
defaultValue: false,
},
]),
)
: {}
}

const skipIds = ['推广']
Expand Down

0 comments on commit 320a4f9

Please sign in to comment.