清爽洛谷插件

一个让洛谷更加清爽的插件。

主要是基于 Stylish 使一些洛谷的内容不显示。也有一些对 extend-luogu 的功能的关闭。不排除以后会使用 TamperMonkey。

安装

依赖

  • Stylish
  • 洛谷
  • extend-luogu(可选)

步骤

  • 在 Stylish 中点击 “Create New Styles”;
  • 在页面的 “Sections” 下 “Code 1” 内复制下面的 CSS 代码;
  • “Sections” 中的 “Applies to” 后面选择 “URLs on the domain”,后面内容填 www.luogu.com.cn
  • 左上角 “Edit” 下的 “Enter a name.” 中填 cleaner-luogu
  • 点击 “Edit” 下的 “Save”。

更新

  • 在 Stylish 中点击 “Manage All Styles”;
  • 在页面右边找到 “cleaner-luogu”,点击其下的 “Edit”;
  • 在页面的 “Sections” 下 “Code1” 内用更新的 CSS 代码覆盖旧的;
  • 点击 “Edit” 下的 “Save”。

源码

Stylish:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* 回退 exlg 的头像 dropdown */
span.wrapper.hover > div.dropdown > div.center > div { display: none }
span.wrapper.hover > div.dropdown > div.center > div.ops { display: block }
div#exlg-dash { display: none }
span.wrapper.hover > div.dropdown > div.center > footer { padding-top: 0; padding-bottom: 0 }
.color-none.exlg-dash-options:nth-child(7) { display: none }

div#exlg-board > h2 { display: none } /* exlg logo */
div#exlg-board ~ div.lg-article:nth-child(2) { display: none } /* 本站公告 */
div#exlg-board ~ div.lg-article:nth-child(4) { display: none!important } /* 友情链接 */
div#exlg-board ~ div.lg-article:nth-child(3) > h2 ~ h2 { display: none } /* 智能推荐 */
div#exlg-board ~ div.lg-article:nth-child(3) > h2 ~ h2 ~ div { display: none } /* 智能推荐内容 */
div.am-u-lg-9.am-u-md-8.lg-index-benben.lg-right > div.lg-article:first-child { display: none } /* 近期比赛 */
div.am-u-lg-3.am-u-md-4.lg-right { display: flex; flex-direction: column-reverse } /* 前置任务计划 */

div.solution-article { display: none } /* 隐藏题解 */
span.exlg-badge { display: none } /* 隐藏 badge */
section.side > div { display: none } /* 隐藏侧边栏广告 */
div.footer > img.qr-img { display: none } /* 隐藏 footer 的二维码 */

/* 隐藏首页的 slider */
div.am-g > div.am-u-md-12 > div.lg-article > div.am-g > div.am-u-md-8 { display: none }
div.am-g > div.am-u-md-12 > div.lg-article { display: flex; justify-content: center }
div.lg-punch { width: auto }