您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
修复Bilibili Evolved (Offline)-V1的夜间模式
当前为
// ==UserScript== // @name 夜间模式修复 // @namespace http://tampermonkey.net/ // @version 1.1.7 // @description 修复Bilibili Evolved (Offline)-V1的夜间模式 // @author aotmd // @match https://www.bilibili.com/video/* // @match https://www.bilibili.com/medialist/play/* // @match https://t.bilibili.com/* // @match https://space.bilibili.com/* // @match https://live.bilibili.com/* // @match https://search.bilibili.com/* // @match https://www.bilibili.com/list/* // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @license MIT // ==/UserScript== (function () { let flag; let setting = { /*可用的值:[true|false]*/ 自动切换: true, 开始时间: '18:00', 结束时间: '6:00', 搜索样式更改:true }; if (GM_getValue('flag') !== undefined) { flag = GM_getValue('flag') } else { GM_setValue('flag', true); flag = true; } let styleElement = document.createElement('style'); document.getElementsByTagName('head')[0].appendChild(styleElement); styleElement.appendChild(document.createTextNode(` /*视频播放页规则*/ .v-wrap {background-color: #222!important; } .video-sections-content-list {background: black; } .video-episode-card__info.video-episode-card__info-playing {background-color: #6e6d6d!important; } .s_tag .tag-area .tag-item {background: #444!important; } /*播放器底部染黑,去除发光阴影*/ .bpx-player-sending-area { background: #222222; } div#bilibili-player-placeholder { box-shadow: 0 0 4px #f1f2f3; } div#bilibili-player-placeholder-bottom { background: #333; } /*动态页规则*/ .bili-dyn-item, .bili-dyn-item div { /*background: #444;*/ color: #e5e5e5; box-sizing: border-box; } .bili-dyn-content__orig.reference { background-color: #222; border: 2px solid; } .bili-dyn-title__text { color: white; } .bili-dyn-item { background: #444; } /*动态页UP主浮窗*/ .bili-user-profile { background: #444; color: #e5e5e5; } .bili-user-profile-view__info__stat span { color: #a3a3a3; } /*动态外显精彩评论*/ span.bili-rich-text-module.at { color: #e5e5e5; } /*动态页视频详情背景*/ .bili-dyn-card-video__body { background: #444; } /*动态页专栏预览*/ a.bili-dyn-card-article { background: #444; } /*动态页,转载视频着色*/ .dyn-ugc__wrap { background-color: #444!important; } /*动态页,直播预览着色*/ .dyn-reserve .dyn-reserve__card { background-color: #444; } /*动态页,相关装扮着色*/ .dyn-additional-common__wrap { background: #444; } /*动态页图片控制栏*/ .bili-album__watch__control { background: #444; } /*动态页中上部分*/ .bili-dyn-publishing { background: #444; } /*1.1.2 动态页投票*/ .dyn-vote__body { background: #444; } /*1.1.2 动态页直播*/ .bili-dyn-card-live__body { background: #444; } .bili-dyn-up-list { background: #444; } .bili-dyn-list-tabs__list { background: #444; } .bili-dyn-up-list__item__name.bili-ellipsis { color: #e5e5e5; } .bili-dyn-list-tabs__item { color: #e5e5e5; } /*动态左侧栏着色*/ .bili-dyn-live-users { background: #444; } .bili-dyn-live-users__item__uname.bili-ellipsis { color: #e5e5e5; } .bili-dyn-live-users__item__title.bili-ellipsis { color: #e5e5e5; } .bili-dyn-live-users__title { color: white; } /*动态页自身名片*/ .bili-dyn-my-info { background: #444; } /*动态页公告*/ .bili-dyn-banner { background: #444; } /*动态页右侧栏*/ .topic-panel { background: #444; } span.topic-panel__nav-title { color: #e5e5e5; } .relevant-topic__title { color: #e5e5e5; } /*直播顶部修复*/ div#head-info-vm { background-color: #444!important; } /*1.1.5搜索页修复,改了下辣眼睛的搜索页面*/ a.text1 { color: snow!important; } /*1.1.7 修复颜色*/ .tag-panel,.comment-container { background-color: #222!important; } body.harmony-font.win.round-corner.dark { --text1: #eee; --graph_bg_regular: #444; } div#bilibili-player-placeholder { box-shadow: 0 0 2px var(--bg3)!IMPORTANT; } .action-list-container { background: #444!important; } `)); if (flag) { styleElement.setAttribute("type",'text/css'); } else { styleElement.setAttribute("type",'text'); } if(setting.自动切换){ window.setInterval(() => { if (new Date().getHours() >= new Date('1900/1/1 '+setting.开始时间).getHours()) { if(flag)return; flag = true; styleElement.setAttribute("type",'text/css'); } if (new Date().getHours() < new Date('1900/1/1 '+setting.开始时间).getHours() && new Date().getHours() >= new Date('1900/1/1 '+setting.结束时间).getHours()) { if(!flag)return; flag = false; styleElement.setAttribute("type",'text'); } GM_setValue('flag', flag); }, 1000); } let a1 = document.createElement('button'); a1.className = "gt1 button2"; document.body.appendChild(a1); a1.innerText = "黑暗模式"; a1.onclick = function () { flag = !flag; if (flag) { styleElement.setAttribute("type",'text/css'); } else { styleElement.setAttribute("type",'text'); } GM_setValue('flag', flag); }; addStyle(` .gt1 { padding: 5px 5px; font-size: 14px; color: snow; position: fixed; border-radius: 4px; right: 5px; top: 10%; z-index: 999999; text-align: center; text-decoration: none; display: inline-block; margin: 4px 2px; -webkit-transition-duration: 0.4s;/* Safari */ transition-duration: 0.4s; cursor: pointer; background-color: #4CAF50; border: 2px solid #4CAF50; } .gt1:hover { background-color: white; color: black; } .button2:hover { font-size: 14px; padding: 5px 10px; -webkit-transition: 0.5s; opacity: 1; margin: -3px 2px; right: 5px; } .button2 { padding: 0px; font-size: 12px; opacity: 0.2; right: -40px; } `); if(setting.搜索样式更改){ addStyle(` /*1.1.5搜索页修复,改了下辣眼睛的搜索页面*/ /*改成每行显示4个*/ .col_md_2 { flex: 5 0 20.666667%; max-width: 30.666667%; } /*专栏改成每行显示一个*/ .col_6.mb_x40 { flex: 0 0 100%; max-width: 100%; /* left: 281px; */ } /*宽度限制从100%改为80%*/ .i_wrapper { width: 80%; max-width: 2200px; margin: 0 auto; padding: 0 56px; } `); } /** * 添加浏览器执行事件 * @param func 无参匿名函数 */ function addLoadEvent(func) { let oldOnload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function () { try { oldOnload(); } catch (e) { console.log(e); } finally { func(); } } } } //添加css样式 function addStyle(rules) { let styleElement = document.createElement('style'); styleElement["type"] = 'text/css'; document.getElementsByTagName('head')[0].appendChild(styleElement); styleElement.appendChild(document.createTextNode(rules)); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址