洛谷学术神器

更舒适的学术体验

安裝腳本?
作者推薦腳本

您可能也會喜歡 【洛谷】Luogu-BenBen-Limit-decadence

安裝腳本
  1. // ==UserScript==
  2. // @name 洛谷学术神器
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description 更舒适的学术体验
  6. // @author Trotyl°
  7. // @match *://*.luogu.com.cn/*
  8. // @match *://*.luogu.org/*
  9. // @grant none
  10. // ==/UserScript==
  11. (function () {
  12. $('document').ready(function(){setTimeout(function () {
  13. var benben_01=localStorage.benben, discuss_01=localStorage.discuss, chat_01=localStorage.chat, notification_01=localStorage.notification;
  14. $sidebar = $('#app-old .lg-index-content .lg-right.am-u-lg-3');
  15. $firstele = $($sidebar.children()[0]);
  16. $finder = $(`
  17. <div class="lg-article" id="console-form">
  18. <script>
  19. function save_benben_1(){
  20. localStorage.benben=1;
  21. location.href = "/";
  22. return true;
  23. }
  24. function save_benben_0(){
  25. localStorage.benben=0;
  26. location.href = "/";
  27. return true;
  28. }
  29. function save_discuss_1(){
  30. console.log("暂不支持隐藏讨论,敬请期待!");
  31. return true;
  32. }
  33. function save_discuss_0(){
  34. console.log("暂不支持隐藏讨论,敬请期待!");
  35. return true;
  36. }
  37. function all_1(){
  38. localStorage.benben=1;
  39. localStorage.discuss=1;
  40. localStorage.chat=1;
  41. localStorage.notification=1;
  42. location.href = "/";
  43. }
  44. function all_0(){
  45. localStorage.benben=0;
  46. localStorage.discuss=0;
  47. localStorage.chat=0;
  48. localStorage.notification=0;
  49. location.href = "/";
  50. }
  51. </script>
  52. <h3 align="center">学术控制台</h3>
  53. <div align="center">
  54. 是否隐藏犇犇<br>
  55. </div>
  56. <div align="center">
  57. <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>
  58. <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>
  59. 是否隐藏讨论<br>
  60. <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>
  61. <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>
  62. </div>
  63. <div align="center">
  64. <button class="am-btn am-btn-sm am-btn-primary" style="margin-top:1px;" id="all-button_1" onclick="all_1()">全部变为隐藏</button>
  65. <button class="am-btn am-btn-sm am-btn-primary" style="margin-top:1px;" id="all-button_0" onclick="all_0()">全部变为打开</button>
  66. </div>
  67. <div align="center"><small><small>你可以在这里控制你想打开的学术模式哦qwq</small></small></div>
  68. <small><small>反馈问题:<a href="https://www.luogu.com.cn/chat?uid=128369" target="_blank">洛谷私信</a> or <a href="https://gf.qytechs.cn/zh-CN/scripts/405841/feedback" target="_blank">讨论</a></small></small>
  69. </div>
  70. `);
  71.  
  72. $finder.insertAfter($firstele);
  73. benben_01 = localStorage.benben;
  74. console.log("benben_01:", benben_01);
  75. console.log("localStorage.benben:", localStorage.benben);
  76. /*输出各种状态*/
  77. /*
  78. console.log(benben_01);
  79. console.log(discuss_01);
  80. console.log(chat_01);
  81. console.log(notification_01);
  82. */
  83. /*-------*/
  84.  
  85. var hidden_benben_css="";
  86. hidden_benben_css += [".lg-index-benben>div+div+div {display: none!important}.lg-index-benben>div+div+div+ul {display: none!important} div.feed+.spinner {display: none}div.feed+.load-more,#feed-more{display: none!important}"
  87. ].join("\n");//隐藏犇犇的css
  88. var hidden_discuss_css="";
  89. hidden_discuss_css += [".lg-index-benben>div+div+div {display: none!important}div.feed+.spinner {display: none}div.feed+.load-more,#feed-more{display: none!important}"
  90. ].join("\n");
  91. console.log("犇犇状态:",benben_01);
  92. if (benben_01 == 1) {//隐藏犇犇
  93. console.log("隐藏犇犇!");
  94. if (typeof GM_addStyle != "undefined") {
  95. GM_addStyle(hidden_benben_css);
  96. } else if (typeof PRO_addStyle != "undefined") {
  97. PRO_addStyle(hidden_benben_css);
  98. } else if (typeof addStyle != "undefined") {
  99. addStyle(hidden_benben_css);
  100. } else {
  101. var node_benben = document.createElement("style");
  102. node_benben.type = "text/css";
  103. node_benben.appendChild(document.createTextNode(hidden_benben_css));
  104. var heads_benben = document.getElementsByTagName("head");
  105. if (heads_benben.length > 0) {
  106. heads_benben[0].appendChild(node_benben);
  107. } else {
  108. document.documentElement.appendChild(node_benben);
  109. }
  110. }
  111. }
  112. if (discuss_01 == 1) {//隐藏讨论
  113. console.log("暂不支持隐藏讨论,敬请期待!");
  114. }
  115. },500)});
  116. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址