mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Improve home hidden, remove 'removeGameMatchModule' option
This commit is contained in:
parent
799b0fcaaa
commit
1676d012d1
File diff suppressed because one or more lines are too long
2
min/home-hidden.min.css
vendored
2
min/home-hidden.min.css
vendored
@ -1 +1 @@
|
||||
body.home-hidden-animal .storey-box .proxy-box #bili_animal,body.home-hidden-anime .storey-box .proxy-box #bili_anime,body.home-hidden-car .storey-box .proxy-box #bili_car,body.home-hidden-cheese .storey-box .proxy-box #bili_cheese,body.home-hidden-cinephile .storey-box .proxy-box #bili_cinephile,body.home-hidden-dance .storey-box .proxy-box #bili_dance,body.home-hidden-digital .storey-box .proxy-box #bili_digital,body.home-hidden-documentary .storey-box .proxy-box #bili_documentary,body.home-hidden-douga .storey-box .proxy-box #bili_douga,body.home-hidden-ent .storey-box .proxy-box #bili_ent,body.home-hidden-fashion .storey-box .proxy-box #bili_fashion,body.home-hidden-food .storey-box .proxy-box #bili_food,body.home-hidden-game .storey-box .proxy-box #bili_game,body.home-hidden-guochuang .storey-box .proxy-box #bili_guochuang,body.home-hidden-information .storey-box .proxy-box #bili_information,body.home-hidden-kichiku .storey-box .proxy-box #bili_kichiku,body.home-hidden-life .storey-box .proxy-box #bili_life,body.home-hidden-live .storey-box .proxy-box #bili_live,body.home-hidden-manga .storey-box .proxy-box #bili_manga,body.home-hidden-movie .storey-box .proxy-box #bili_movie,body.home-hidden-music .storey-box .proxy-box #bili_music,body.home-hidden-read .storey-box .proxy-box #bili_read,body.home-hidden-technology .storey-box .proxy-box #bili_technology,body.home-hidden-teleplay .storey-box .proxy-box #bili_teleplay{display:none!important}.gui-settings-flat-button .home-hidden-settings.popup{align-items:stretch}.home-hidden-settings-item{padding:4px 12px;display:flex;align-items:center;border-radius:8px}.home-hidden-settings-item .mdi-eye-off{display:none}.home-hidden-settings-item:hover{background:#8882}.home-hidden-settings-item.home-hidden{opacity:.5}.home-hidden-settings-item.home-hidden .mdi-eye{display:none}.home-hidden-settings-item.home-hidden .mdi-eye-off{display:inline-flex}
|
||||
.gui-settings-flat-button .home-hidden-settings.popup{align-items:flex-start;flex-direction:row;flex-wrap:wrap;max-width:180px;left:-24px;transform:none}.home-hidden-settings-item{padding:4px 12px;flex-grow:1;display:flex;align-items:center;border-radius:8px}.home-hidden-settings-item .mdi-eye-off{display:none}.home-hidden-settings-item:hover{background:#8882}.home-hidden-settings-item.home-hidden{opacity:.5}.home-hidden-settings-item.home-hidden .mdi-eye{display:none}.home-hidden-settings-item.home-hidden .mdi-eye-off{display:inline-flex}
|
||||
2
min/home-hidden.min.js
vendored
2
min/home-hidden.min.js
vendored
@ -1 +1 @@
|
||||
(()=>(e,n)=>{const i=()=>!e.simplifyHome&&document.URL.includes("https://www.bilibili.com/");const a=[{name:"categories",displayName:"分区栏",style:`\n .bili-header-m>.bili-wrapper {\n visibility: hidden !important;\n height: 18px !important;\n }\n .primary-menu-itnl {\n visibility: hidden !important;\n height: 24px !important;\n padding: 0 !important;\n }\n`},{name:"trends",displayName:"活动/热门视频",style:`\n .first-screen #reportFirst1 { display: none !important; }\n .first-screen .space-between {\n margin-bottom: 0 !important;\n }\n .rcmd-box-wrap { display: none !important; }\n`},{name:"online",displayName:"在线列表",style:`\n .first-screen #reportFirst2 { display: none !important; }\n`},{name:"ext-box",displayName:"电竞赛事",style:`\n .first-screen #reportFirst3 { display: none !important; } `},{name:"special",displayName:"特别推荐",style:`\n #bili_report_spe_rec { display: none !important; }\n`},{name:"contact",displayName:"联系方式",style:`\n .international-footer { display: none !important; }\n`},{name:"elevator",displayName:"右侧分区导航",style:`\n .storey-box .elevator { display: none !important; }\n`},{name:"live",displayName:"直播"},{name:"douga",displayName:"动画"},{name:"anime",displayName:"番剧"},{name:"guochuang",displayName:"国创"},{name:"manga",displayName:"漫画"},{name:"music",displayName:"音乐"},{name:"dance",displayName:"舞蹈"},{name:"game",displayName:"游戏"},{name:"technology",displayName:"知识"},{name:"cheese",displayName:"课堂"},{name:"digital",displayName:"数码"},{name:"car",displayName:"汽车"},{name:"life",displayName:"生活"},{name:"food",displayName:"美食"},{name:"animal",displayName:"动物圈"},{name:"kichiku",displayName:"鬼畜"},{name:"fashion",displayName:"时尚"},{name:"information",displayName:"资讯"},{name:"ent",displayName:"娱乐"},{name:"read",displayName:"专栏"},{name:"movie",displayName:"电影"},{name:"teleplay",displayName:"电视剧"},{name:"cinephile",displayName:"影视"},{name:"documentary",displayName:"纪录片"}];const t=i=>{if(!e.homeHiddenItems.includes(i.name)){if(i.style){var a;(a=dq(`#home-hidden-style-${i.name}`))===null||a===void 0?void 0:a.remove()}else{document.body.classList.remove(`home-hidden-${i.name}`)}}else{if(i.style){n.applyImportantStyleFromText(i.style,`home-hidden-style-${i.name}`)}else{document.body.classList.add(`home-hidden-${i.name}`)}}};if(i()){a.forEach(t);n.applyImportantStyle("homeHiddenStyle")}return{widget:{condition:i,content:`\n<div class="gui-settings-flat-button" style="position: relative" id="home-hidden">\n<i class="mdi mdi-24px mdi-settings"></i>\n<span>首页过滤</span>\n<div class="home-hidden-settings popup">\n<div v-for="item in items" @click="toggle(item)" :key="item.name" class="home-hidden-settings-item" :class="{ 'home-hidden': hiddenItems.includes(item.name) }">\n<i class="mdi mdi-18px mdi-eye"></i>\n<i class="mdi mdi-18px mdi-eye-off"></i>\n {{ item.displayName }}\n</div>\n</div>\n</div>\n`,success:async()=>{const n=dq("#home-hidden");new Vue({el:dq(n,".popup"),data(){return{items:a,hiddenItems:[...e.homeHiddenItems]}},watch:{hiddenItems(n){e.homeHiddenItems=[...n]}},mounted(){const e=this.$el;n.addEventListener("click",(n=>{if(n.target===e||e.contains(n.target)){return}e.classList.toggle("opened")}))},methods:{async toggle(e){const n=this.hiddenItems;const i=n.indexOf(e.name);if(i!==-1){n.splice(i,1)}else{n.push(e.name)}await this.$nextTick();t(e)}}})}}}})();
|
||||
(()=>(e,n)=>{const i=()=>!e.simplifyHome&&document.URL.includes("https://www.bilibili.com/");const t=dqa(".proxy-box > div").map((e=>{var n,i,t;return{name:e.id.replace(/^bili_/,""),displayName:(n=(i=e.querySelector("header .name"))===null||i===void 0?void 0:(t=i.textContent)===null||t===void 0?void 0:t.trim())!==null&&n!==void 0?n:"未知分区"}}));const s=[{name:"categories",displayName:"分区栏",style:`\n .bili-header-m>.bili-wrapper {\n visibility: hidden !important;\n height: 18px !important;\n }\n .primary-menu-itnl {\n visibility: hidden !important;\n height: 24px !important;\n padding: 0 !important;\n }\n`},{name:"trends",displayName:"活动/热门视频",style:`\n .first-screen #reportFirst1 { display: none !important; }\n .first-screen .space-between {\n margin-bottom: 0 !important;\n }\n .rcmd-box-wrap { display: none !important; }\n`},{name:"online",displayName:"在线列表",style:`\n .first-screen #reportFirst2 { display: none !important; }\n`},{name:"ext-box",displayName:"电竞赛事",style:`\n .first-screen #reportFirst3 { display: none !important; } `},{name:"special",displayName:"特别推荐",style:`\n #bili_report_spe_rec { display: none !important; }\n`},{name:"contact",displayName:"联系方式",style:`\n .international-footer { display: none !important; }\n`},{name:"elevator",displayName:"右侧分区导航",style:`\n .storey-box .elevator { display: none !important; }\n`},...t];const d=i=>{if(!e.homeHiddenItems.includes(i.name)){if(i.style){var t;(t=dq(`#home-hidden-style-${i.name}`))===null||t===void 0?void 0:t.remove()}else{document.body.classList.remove(`home-hidden-${i.name}`)}}else{if(i.style){n.applyImportantStyleFromText(i.style,`home-hidden-style-${i.name}`)}else{document.body.classList.add(`home-hidden-${i.name}`)}}};if(i()){s.forEach(d);const e=t.map((({name:e})=>`\nbody.home-hidden-${e} .storey-box .proxy-box #bili_${e} {\n display: none !important;\n}\n`.trim())).join("\n");const i=n.import("homeHiddenStyle");n.applyImportantStyleFromText(e+i,"home-hidden-style")}return{widget:{condition:i,content:`\n<div class="gui-settings-flat-button" style="position: relative" id="home-hidden">\n<i class="mdi mdi-24px mdi-settings"></i>\n<span>首页过滤</span>\n<div class="home-hidden-settings popup">\n<div v-for="item in items" @click="toggle(item)" :key="item.name" class="home-hidden-settings-item" :class="{ 'home-hidden': hiddenItems.includes(item.name) }">\n<i class="mdi mdi-18px mdi-eye"></i>\n<i class="mdi mdi-18px mdi-eye-off"></i>\n {{ item.displayName }}\n</div>\n</div>\n</div>\n`,success:async()=>{const n=dq("#home-hidden");new Vue({el:dq(n,".popup"),data(){return{items:s,hiddenItems:[...e.homeHiddenItems]}},watch:{hiddenItems(n){e.homeHiddenItems=[...n]}},mounted(){const e=this.$el;n.addEventListener("click",(n=>{if(n.target===e||e.contains(n.target)){return}e.classList.toggle("opened")}))},methods:{async toggle(e){const n=this.hiddenItems;const i=n.indexOf(e.name);if(i!==-1){n.splice(i,1)}else{n.push(e.name)}await this.$nextTick();d(e)}}})}}}})();
|
||||
2
min/remove-promotions.min.js
vendored
2
min/remove-promotions.min.js
vendored
@ -1 +1 @@
|
||||
(()=>(e,t)=>{if(document.URL.replace(window.location.search,"")==="https://www.bilibili.com/"){addSettingsListener("removeGameMatchModule",(e=>{document.body.classList.toggle("remove-game-match-module",e)}),true);SpinQuery.any((()=>dqa(".gg-pic")),(t=>{t.forEach((t=>{const n=t.parentElement;n.style.display="none";const l=[...n.parentElement.childNodes].indexOf(n)+1;const i=n.parentElement.parentElement.querySelector(`.pic li:nth-child(${l})`);if(i){i.style.display="flex";const t=i.querySelector("a:not(.more-text)");t.insertAdjacentHTML("afterend",`\n<div class="blocked">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`);t.style.visibility="hidden";i.querySelector("a.more-text").style.display="none";i.querySelector("img").style.display="none"}}))}));SpinQuery.select(".focus-carousel.home-slide").then((t=>{if(!t){return}[...t.querySelectorAll(".gg-icon,.bypb-icon")].map((e=>e.parentElement.parentElement)).forEach((t=>{t.style.display="none";t.insertAdjacentHTML("afterend",`\n<div class="blocked new">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`)}))}))}addSettingsListener("preserveEventBanner",(e=>{document.body.classList.toggle("preserve-event-banner",e)}),true)})();
|
||||
(()=>(e,n)=>{if(document.URL.replace(window.location.search,"")==="https://www.bilibili.com/"){SpinQuery.any((()=>dqa(".gg-pic")),(n=>{n.forEach((n=>{const t=n.parentElement;t.style.display="none";const l=[...t.parentElement.childNodes].indexOf(t)+1;const i=t.parentElement.parentElement.querySelector(`.pic li:nth-child(${l})`);if(i){i.style.display="flex";const n=i.querySelector("a:not(.more-text)");n.insertAdjacentHTML("afterend",`\n<div class="blocked">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`);n.style.visibility="hidden";i.querySelector("a.more-text").style.display="none";i.querySelector("img").style.display="none"}}))}));SpinQuery.select(".focus-carousel.home-slide").then((n=>{if(!n){return}[...n.querySelectorAll(".gg-icon,.bypb-icon")].map((e=>e.parentElement.parentElement)).forEach((n=>{n.style.display="none";n.insertAdjacentHTML("afterend",`\n<div class="blocked new">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`)}))}))}addSettingsListener("preserveEventBanner",(e=>{document.body.classList.toggle("preserve-event-banner",e)}),true)})();
|
||||
@ -156,7 +156,6 @@ Resource.manifest = {
|
||||
displayNames: {
|
||||
removeAds: '删除广告',
|
||||
showBlockedAdsTip: '显示占位文本',
|
||||
removeGameMatchModule: '删除电竞赛事',
|
||||
preserveEventBanner: '保留活动横幅',
|
||||
},
|
||||
},
|
||||
|
||||
@ -197,7 +197,6 @@ export const settings = {
|
||||
keymapJumpSeconds: 85,
|
||||
urlParamsClean: true,
|
||||
collapseLiveSideBar: true,
|
||||
removeGameMatchModule: false,
|
||||
noDarkOnMember: true,
|
||||
feedsTranslate: false,
|
||||
feedsTranslateProvider: 'Bing',
|
||||
|
||||
@ -1,43 +1,15 @@
|
||||
$items: (
|
||||
live,
|
||||
douga,
|
||||
anime,
|
||||
guochuang,
|
||||
manga,
|
||||
music,
|
||||
dance,
|
||||
game,
|
||||
technology,
|
||||
cheese,
|
||||
digital,
|
||||
car,
|
||||
life,
|
||||
food,
|
||||
animal,
|
||||
kichiku,
|
||||
fashion,
|
||||
information,
|
||||
ent,
|
||||
read,
|
||||
movie,
|
||||
teleplay,
|
||||
cinephile,
|
||||
documentary
|
||||
);
|
||||
@each $item in $items {
|
||||
body.home-hidden-#{$item} {
|
||||
.storey-box .proxy-box #bili_#{$item} {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.home-hidden-settings {
|
||||
.gui-settings-flat-button &.popup {
|
||||
align-items: stretch;
|
||||
align-items: flex-start;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
max-width: 180px;
|
||||
left: -24px;
|
||||
transform: none;
|
||||
}
|
||||
&-item {
|
||||
padding: 4px 12px;
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 8px;
|
||||
|
||||
@ -6,6 +6,11 @@ type HomeHiddenOption = Readonly<{
|
||||
const isHome = () => {
|
||||
return !settings.simplifyHome && document.URL.includes('https://www.bilibili.com/')
|
||||
}
|
||||
const generatedOptions: HomeHiddenOption[] = dqa('.proxy-box > div')
|
||||
.map(it => ({
|
||||
name: it.id.replace(/^bili_/, ''),
|
||||
displayName: it.querySelector('header .name')?.textContent?.trim() ?? '未知分区',
|
||||
}))
|
||||
const homeHiddenOptions: HomeHiddenOption[] = [
|
||||
{
|
||||
name: 'categories', displayName: '分区栏', style: `
|
||||
@ -52,102 +57,7 @@ const homeHiddenOptions: HomeHiddenOption[] = [
|
||||
.storey-box .elevator { display: none !important; }
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "live",
|
||||
displayName: "直播"
|
||||
},
|
||||
{
|
||||
name: "douga",
|
||||
displayName: "动画"
|
||||
},
|
||||
{
|
||||
name: "anime",
|
||||
displayName: "番剧"
|
||||
},
|
||||
{
|
||||
name: "guochuang",
|
||||
displayName: "国创"
|
||||
},
|
||||
{
|
||||
name: "manga",
|
||||
displayName: "漫画"
|
||||
},
|
||||
{
|
||||
name: "music",
|
||||
displayName: "音乐"
|
||||
},
|
||||
{
|
||||
name: "dance",
|
||||
displayName: "舞蹈"
|
||||
},
|
||||
{
|
||||
name: "game",
|
||||
displayName: "游戏"
|
||||
},
|
||||
{
|
||||
name: "technology",
|
||||
displayName: "知识"
|
||||
},
|
||||
{
|
||||
name: "cheese",
|
||||
displayName: "课堂"
|
||||
},
|
||||
{
|
||||
name: "digital",
|
||||
displayName: "数码"
|
||||
},
|
||||
{
|
||||
name: "car",
|
||||
displayName: "汽车"
|
||||
},
|
||||
{
|
||||
name: "life",
|
||||
displayName: "生活"
|
||||
},
|
||||
{
|
||||
name: "food",
|
||||
displayName: "美食"
|
||||
},
|
||||
{
|
||||
name: 'animal',
|
||||
displayName: '动物圈',
|
||||
},
|
||||
{
|
||||
name: "kichiku",
|
||||
displayName: "鬼畜"
|
||||
},
|
||||
{
|
||||
name: "fashion",
|
||||
displayName: "时尚"
|
||||
},
|
||||
{
|
||||
name: "information",
|
||||
displayName: "资讯"
|
||||
},
|
||||
{
|
||||
name: "ent",
|
||||
displayName: "娱乐"
|
||||
},
|
||||
{
|
||||
name: "read",
|
||||
displayName: "专栏"
|
||||
},
|
||||
{
|
||||
name: "movie",
|
||||
displayName: "电影"
|
||||
},
|
||||
{
|
||||
name: "teleplay",
|
||||
displayName: "电视剧"
|
||||
},
|
||||
{
|
||||
name: "cinephile",
|
||||
displayName: "影视"
|
||||
},
|
||||
{
|
||||
name: "documentary",
|
||||
displayName: "纪录片"
|
||||
}
|
||||
...generatedOptions,
|
||||
]
|
||||
const syncState = (item: HomeHiddenOption) => {
|
||||
if (!settings.homeHiddenItems.includes(item.name)) {
|
||||
@ -166,7 +76,15 @@ const syncState = (item: HomeHiddenOption) => {
|
||||
}
|
||||
if (isHome()) {
|
||||
homeHiddenOptions.forEach(syncState)
|
||||
resources.applyImportantStyle('homeHiddenStyle')
|
||||
const generatedStyles = generatedOptions.map(({ name }) => {
|
||||
return `
|
||||
body.home-hidden-${name} .storey-box .proxy-box #bili_${name} {
|
||||
display: none !important;
|
||||
}
|
||||
`.trim()
|
||||
}).join('\n')
|
||||
const fixedStyles: string = resources.import('homeHiddenStyle')
|
||||
resources.applyImportantStyleFromText(generatedStyles + fixedStyles, 'home-hidden-style')
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@ -153,7 +153,6 @@
|
||||
<category icon="tool">工具</category>
|
||||
<checkbox indent="0" key="removeAds" dependencies=""></checkbox>
|
||||
<checkbox indent="1" key="showBlockedAdsTip" dependencies="removeAds"></checkbox>
|
||||
<checkbox indent="1" key="removeGameMatchModule" dependencies="removeAds"></checkbox>
|
||||
<checkbox indent="1" key="preserveEventBanner" dependencies="removeAds"></checkbox>
|
||||
<checkbox indent="0" key="watchLaterRedirect" dependencies=""></checkbox>
|
||||
<checkbox indent="1" key="watchLaterRedirectNavbar" dependencies="watchLaterRedirect"></checkbox>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
if (document.URL.replace(window.location.search, '') === 'https://www.bilibili.com/') {
|
||||
addSettingsListener('removeGameMatchModule', value => {
|
||||
document.body.classList.toggle('remove-game-match-module', value)
|
||||
}, true)
|
||||
// addSettingsListener('removeGameMatchModule', value => {
|
||||
// document.body.classList.toggle('remove-game-match-module', value)
|
||||
// }, true)
|
||||
SpinQuery.any(
|
||||
() => dqa('.gg-pic'),
|
||||
it => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user