Add event banner support

This commit is contained in:
the1812 2020-03-22 13:55:51 +08:00
parent 86f466d539
commit cde1d5d49c
17 changed files with 67 additions and 27 deletions

View File

@ -441,6 +441,7 @@ declare global {
useDefaultLiveQuality: boolean,
recordLiveDanmaku: boolean,
foregroundColorMode: '自动' | '白色' | '黑色'
preserveEventBanner: boolean
latestVersionLink: string,
currentVersion: string,
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -51,10 +51,11 @@
"custom-navbar-video-list.min.js": "08D6713144E910C1303CB610A5890A5663B92BE82630BDA3C8E6299FB4A429E2",
"custom-navbar-watchlater-list.min.js": "623DA447FAFCF271E34C1A1D19B2721B78C7BC478A38C04ECF2DCA6427D006F0",
"danmaku-converter.min.js": "908389A7D4E5F8546075B74F41BF03BD974073B4203723A575CF22082B358692",
"dark.min.css": "39406A339A4CB28C10CFF75844FAB844E61157353B563C2121199890C0116680",
"dark.min.css": "F5B7B0F2322AD760AF7F735750B0A7B5A1837313926C35942019C597952C22A4",
"dark-important.min.css": "9381B563726BCA701DD77C7AD572793538A45CB839F56008A55EE46821EA1B05",
"dark-navbar.min.css": "A2D91F11127D165571ACCC53004EDDB118CEE110F9B020D7E0541E1C8FAEA478",
"dark-schedule.min.js": "853C446547603F4F0425F19F09F73335C9EC451A790C1C07E5E5B88A09E9B453",
"dark-slice-9.min.css": "AB628BE1F36B5BB4B9A16CD432F343DFE2DB30C281F745E3D863009A733228E0",
"dark-styles.min.js": "71AF9CBD74BD3F570515C46801AE66A52665DCEDE2F4941AA90D12A4F1381A6E",
"debounce.min.js": "54D33E1273C1F3FE19550BF1844339C3D54D6B01DF8A39C3162D95B93B079CFA",
"default-danmaku-settings.min.css": "D9942B184FEDA7B08CFA0C34920E97D7A83B81762DCBF757642EBB60F95FF25D",
@ -99,7 +100,7 @@
"full-tweets-title.min.css": "13A0CF1C96F374CED3FA59A532E28B4B620D7A4C374385A363F32AD1A7656764",
"full-tweets-title.min.js": "DD57BB732ABEF7739CA84AEFF97E86F8984FCC4A8A75B957213622350B2A7C37",
"gui-settings.min.css": "A5A154D022A3D1B0AFFBFDF0AE490980B3BD363A8EFC7AD16AD88B8D4ECB3D76",
"gui-settings.min.html": "78DC59F4CB7F2BCD7EC5F4E1F474818063ED876F4E308BEE35551709C9673A1A",
"gui-settings.min.html": "83E61554E8C82C0E458839DDA0AF754FD5E589D08D7D59B7F43DD32D4571DBF6",
"gui-settings.min.js": "029562CA0C0DEFCCBFF38C662C56C651C09847CDB78A99873E3ABA9936B428BA",
"haruna-scale.min.js": "FD079C86741F614FD63E733CF9B7B896A7D20110754815A540F3341D4DC252B2",
"hide-bangumi-reviews.min.js": "7265C0CE994FDA926355A9A4F9B207E7E68E749D47332F3C537EF93E97927A23",
@ -157,8 +158,8 @@
"rank-list.vue.min.js": "9982073307A5C19F9CA1BA131D574047DC0FC131DA5F8840585D663B3643D150",
"record-live-danmaku.min.js": "64DC9C8F49971B3C846749E4BE343C9185310DA157996450667FE9C5C62525F6",
"record-live-danmaku.vue.min.js": "740784A24CD5326095C269FD33A5B498ADAAF03FE31B136060888D7E7B616BD3",
"remove-promotions.min.css": "A5C7A22113A8E470F386CC0FFEBEB5FA62C5AA905B7CBC2683E8B610B6903A44",
"remove-promotions.min.js": "A24F613643F11D06B2E0BF3CD0BA0B952062C34A4F6A46470F94EF23661D4319",
"remove-promotions.min.css": "6FB1BD260737887D3BF266299121F3D5BA2B88379492F05E42B95E49A6B91967",
"remove-promotions.min.js": "9749B85A95F5E6AE4F5B58A69D7ED7CA3B239C0A0794C6577A01B2B72D12054F",
"remove-top-mask.min.js": "A15C1EC10D2E1A61845B1ADAE51860553F96427059E10443B1E53FAF48F45304",
"remove-watermark.min.js": "5A63C694BB9E68EA9FDA394D61D227FA31A504E31783C62BF42AACC3FC78C8C4",
"reorder.min.js": "4E956A2CEEC46CCDED9417E96BC84AEF706946B5E9898A32CCB19F00DBBADC1F",

Binary file not shown.

2
min/dark.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
#home_popularize .adpos,#home_popularize .l-con,#reportFirst2 .extension,#slide_ad,.activity-m,.bili-header-m .nav-menu .nav-con .nav-item .text-red,.bilibili-player-promote-wrap,.gg-floor-module,.gg-window .operate-card,.home-app-download,.international-home .banner-card,.mascot,.mobile-link-l,.video-page-game-card,.video-page-special-card,body.remove-game-match-module #reportFirst3,body.remove-game-match-module .bili-wrapper>.home-match{display:none!important}#home_popularize{position:relative!important}.gg-window .online,.popularize-module .online{position:absolute!important;top:50%!important;right:.5%!important;transform:translateY(-100%)!important}.gg-window .online{right:0!important;padding:0 16px!important}#reportFirst2{position:relative;margin-bottom:4px}.blocked-ads{width:440px;height:220px;display:flex;color:#888;background-color:#8882;font-size:24pt;font-weight:700;align-items:center;justify-content:space-evenly}.blocked-ads.new{width:459px;height:202px}body.compact .blocked-ads{width:480px;height:240px}
#home_popularize .adpos,#home_popularize .l-con,#reportFirst2 .extension,#slide_ad,.bili-header-m .nav-menu .nav-con .nav-item .text-red,.bilibili-player-promote-wrap,.gg-floor-module,.gg-window .operate-card,.home-app-download,.international-home .banner-card,.mascot,.mobile-link-l,.video-page-game-card,.video-page-special-card,body.remove-game-match-module #reportFirst3,body.remove-game-match-module .bili-wrapper>.home-match,body:not(.preserve-event-banner) .activity-m{display:none!important}#home_popularize{position:relative!important}.gg-window .online,.popularize-module .online{position:absolute!important;top:50%!important;right:.5%!important;transform:translateY(-100%)!important}.gg-window .online{right:0!important;padding:0 16px!important}#reportFirst2{position:relative;margin-bottom:4px}.blocked-ads{width:440px;height:220px;display:flex;color:#888;background-color:#8882;font-size:24pt;font-weight:700;align-items:center;justify-content:space-evenly}.blocked-ads.new{width:459px;height:202px}body.compact .blocked-ads{width:480px;height:240px}

View File

@ -1 +1 @@
(()=>{return(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-ads">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`);t.style.visibility="hidden";i.querySelector("a.more-text").style.display="none";i.querySelector("img").style.display="none"}})});SpinQuery.select(".gg-carousel.home-slide").then(t=>{if(!t){return}[...t.querySelectorAll(".gg-icon")].map(e=>e.parentElement.parentElement).forEach(t=>{t.style.display="none";t.insertAdjacentHTML("afterend",`\n<div class="blocked-ads new">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`)})})}}})();
(()=>{return(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 s=n.parentElement.parentElement.querySelector(`.pic li:nth-child(${l})`);if(s){s.style.display="flex";const t=s.querySelector("a:not(.more-text)");t.insertAdjacentHTML("afterend",`\n<div class="blocked-ads">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`);t.style.visibility="hidden";s.querySelector("a.more-text").style.display="none";s.querySelector("img").style.display="none"}})});SpinQuery.select(".gg-carousel.home-slide").then(t=>{if(!t){return}[...t.querySelectorAll(".gg-icon")].map(e=>e.parentElement.parentElement).forEach(t=>{t.style.display="none";t.insertAdjacentHTML("afterend",`\n<div class="blocked-ads new">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`)})})}addSettingsListener("preserveEventBanner",e=>{document.body.classList.toggle("preserve-event-banner",e)},true)}})();

View File

@ -198,6 +198,7 @@ Resource.manifest = {
removeAds: '删除广告',
showBlockedAdsTip: '显示占位文本',
removeGameMatchModule: '删除电竞赛事',
preserveEventBanner: '保留活动横幅',
}
},
watchLaterRedirect: {

View File

@ -216,6 +216,7 @@ export const settings = {
useDefaultLiveQuality: false,
recordLiveDanmaku: false,
foregroundColorMode: '自动',
preserveEventBanner: false,
cache: {},
}
const fixedSettings = {

View File

@ -470,6 +470,26 @@ $highlight-map: (
}
}
}
.activity-m {
.inside-wrp {
@include border-color("4");
.right .inside-bg::before {
background-image: linear-gradient(90deg, #222, transparent 30%) !important;
}
}
.hinter-msg {
@include color("e");
}
.b-btn-praise {
@include theme-background-color();
@include foreground-color();
&.voted {
@include color("a");
@include border-color();
@include background-color("3");
}
}
}
.international-home .contact-help {
@include color("9");
@include background-color("3");

View File

@ -132,6 +132,7 @@
<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="0" key="favoritesRedirect" dependencies=""></checkbox>
<checkbox indent="0" key="hideTopSearch" dependencies=""></checkbox>

View File

@ -3,7 +3,6 @@
#home_popularize .adpos,
.gg-floor-module,
.home-app-download,
.activity-m,
.bilibili-player-promote-wrap,
.bili-header-m .nav-menu .nav-con .nav-item .text-red,
.mobile-link-l,
@ -13,6 +12,7 @@
#reportFirst2 .extension,
.video-page-special-card,
.mascot,
body:not(.preserve-event-banner) .activity-m,
body.remove-game-match-module .bili-wrapper > .home-match,
body.remove-game-match-module #reportFirst3 {
display: none !important;

View File

@ -37,3 +37,6 @@ if (document.URL.replace(window.location.search, '') === 'https://www.bilibili.c
})
})
}
addSettingsListener('preserveEventBanner', value => {
document.body.classList.toggle('preserve-event-banner', value)
}, true)