// ==UserScript==
// @name 百度夜间模式
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Baidu night mode
// @author Mattew
// @match https://*.baidu.com/*
// @match https://baidu.com/*
// @match http://*.baidu.com/*
// @match http://baidu.com/*
// @grant none
// ==/UserScript==
(
function() {
'use strict';
function black(){
var lg = $("#result_logo");
if(lg.length==1){
$(lg).html('<img src="//www.baidu.com/img/[email protected]" width="101" height="33" border="0" alt="到百度首页" title="到百度首页">')
}
$("#search").css("background-color","#222");
$("body").css("background-color","#222");
$("#rs").css("background-color","#222");
$("#head").css("background","#333");
$("#s_tab").css("background","#333");
$("#content_right").css("background","#333");
$("#content_right").css("border-left","1px solid #333");
$("#content_right").css("border-radius","10px");
$("#content_right").css("padding-top","20px");
$("a").css("color","rgba(200,200,200,.9)");
$("a").css("background","rgba(0,0,0,0)");
$("strong").css("background","rgba(0,0,0,0)");
$("b").css("color","rgba(230,230,230,1)");
$("em").css("color","rgba(245,245,249,1)");
$("input").css("color","rgba(230,230,230,1)");
$("body").css("color","rgba(200,200,200,1)");
$("#c-tip-con").css("background-color","#333");
$("strong > .pc").css("background","#555");
$("#foot").css("background","#333");
$("#foot").css("border-top","1px solid #333");
$("#help").css("background","#333");
$(".s_btn").css("background","#555");
$(".s_btn").css("border-bottom","1px solid #555");
$(".s_ipt_wr").css("background","#333")
$(".c-summary").css("color","rgba(200,200,200,1)");
$(".EC_newppim").remove();
$(".layout").remove();
$(".c-table").css("background-color","rgba(0,0,0,0)");
$("th").css("background-color","rgba(0,0,0,0)");
$(".soutu-btn").css("background","#333url(https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/soutu/img/camera_new_5606e8f.png) no-repeat");
$(".s_ipt").css("background-color","rgba(0,0,0,.2)");
}
setInterval(function(){
let timeNow = new Date()
let hourNow = timeNow.getHours()
if (hourNow > 18) {
black();
}
if (hourNow < 7) {
black();
}},300);
// Your code here...
})();