Greasy Fork is available in English.
隐藏:犇犇、讨论、私信、通知等,专心刷题!
当前为
// ==UserScript==
// @name 洛谷学术神器
// @namespace http://tampermonkey.net/
// @version 0.103
// @description 隐藏:犇犇、讨论、私信、通知等,专心刷题!
// @author TNT°
// @match *://*.luogu.com.cn/*
// @match *://*.luogu.org/*
// @grant none
// ==/UserScript==
(function () {
$('document').ready(function(){setTimeout(function () {
var benben_01, discuss_01, chat_01, notification_01;
localStorage.benben=0;
$sidebar = $('#app-old .lg-index-content .lg-right.am-u-lg-3');
$firstele = $($sidebar.children()[0]);
$finder = $(`
<div class="lg-article" id="console-form">
<script>
function save_benben_1(){
localStorage.benben=1;
console.log(localStorage.benben);
location.href = "/";
return true;
}
function save_benben_0(){
return true;
}
function save_discuss_1(){
return true;
}
function save_discuss_0(){
return true;
}
function save_chat_1(){
return true;
}
function save_chat_0(){
return true;
}
function save_notification_1(){
return true;
}
function save_notification_0(){
return true;
}
</script>
<h3 align="center">学术控制台</h3>
<div align="center">
是否隐藏犇犇<br>
</div>
<div align="center">
<button class="am-btn am-btn-sm am-btn-primary lg-left" style="background: rgb(82, 196, 26) none repeat scroll 0% 0%; color: rgb(255, 255, 255);" id="benben-button_1" onclick="save_benben_1()">是</button>
<button class="am-btn am-btn-sm am-btn-primary lg-right" style="background: rgb(254, 76, 97) none repeat scroll 0% 0%; color: rgb(255, 255, 255);" id="benben-button_0" onclick="save_benben_0()">否</button><br><br>
是否隐藏讨论<br>
<button class="am-btn am-btn-sm am-btn-primary lg-left" style="background: rgb(82, 196, 26) none repeat scroll 0% 0%; color: rgb(255, 255, 255); id="discuss-button_1" onclick="save_discuss_1()">是</button>
<button class="am-btn am-btn-sm am-btn-primary lg-right" style="background: rgb(254, 76, 97) none repeat scroll 0% 0%; color: rgb(255, 255, 255);" id="discuss-button_0" onclick="save_discuss_0()">否</button><br><br>
是否隐藏私信<br>
<button class="am-btn am-btn-sm am-btn-primary lg-left" style="background: rgb(82, 196, 26) none repeat scroll 0% 0%; color: rgb(255, 255, 255);" id="chat-button_1" onclick="save_chat_1()">是</button>
<button class="am-btn am-btn-sm am-btn-primary lg-right" style="background: rgb(254, 76, 97) none repeat scroll 0% 0%; color: rgb(255, 255, 255);" id="chat-button_0" onclick="save_chat_0()">否</button><br><br>
是否隐藏通知<br>
<button class="am-btn am-btn-sm am-btn-primary lg-left" style="background: rgb(82, 196, 26) none repeat scroll 0% 0%; color: rgb(255, 255, 255);" id="notification-button_1" onclick="save_notification_1()">是</button>
<button class="am-btn am-btn-sm am-btn-primary lg-right" style="background: rgb(254, 76, 97) none repeat scroll 0% 0%; color: rgb(255, 255, 255);" id="notification-button_0" onclick="save_notification_0()">否</button><br><br>
</div>
<div align="center"><small><small>你可以在这里控制你想打开的学术模式哦qwq</small></small></div>
<small><small>反馈问题:<a href="https://www.luogu.com.cn/chat?uid=128369" target="_blank">洛谷私信</a> or <a href="http://greasyfork.icu/zh-CN/scripts/405841/feedback" target="_blank">讨论</a></small></small>
</div>
`);
$finder.insertAfter($firstele);
benben_01 = localStorage.benben;
console.log("benben_01:", benben_01);
console.log("localStorage.benben:", localStorage.benben);
/*输出各种状态*/
/*
console.log(benben_01);
console.log(discuss_01);
console.log(chat_01);
console.log(notification_01);
*/
/*-------*/
var hidden_benben_css="";
hidden_benben_css += [".lg-index-benben>div+div+div+ul {display: none!important}.lg-index-benben>div+div+div {display: none!important}div.feed+.load-more,#feed-more{display: none!important}"
].join("\n");//隐藏犇犇的css
var hidden_discuss_css="";
hidden_discuss_css += [".lg-index-content.am-center>div:fihttps://www.luogu.com.cn/judgementrst-child+div+div>div:first-child+div>div:first-child+div{display: none!important}"
].join("\n");
console.log("犇犇状态:",benben_01);
if (benben_01 == 1) {//隐藏犇犇
console.log("隐藏犇犇!");
if (typeof GM_addStyle != "undefined") {
GM_addStyle(hidden_benben_css);
} else if (typeof PRO_addStyle != "undefined") {
PRO_addStyle(hidden_benben_css);
} else if (typeof addStyle != "undefined") {
addStyle(hidden_benben_css);
} else {
var node_benben = document.createElement("style");
node_benben.type = "text/css";
node_benben.appendChild(document.createTextNode(hidden_benben_css));
var heads_benben = document.getElementsByTagName("head");
if (heads_benben.length > 0) {
heads_benben[0].appendChild(node_benben);
} else {
document.documentElement.appendChild(node_benben);
}
}
benben_01 = 0;
localStorage.benben=0;
}
console.log(localStorage.benben);
},500)});
})();