-
-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathzhihu-black.user.js
More file actions
204 lines (192 loc) · 6.25 KB
/
zhihu-black.user.js
File metadata and controls
204 lines (192 loc) · 6.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// ==UserScript==
// @name 知乎的深色主题
// @name:zh-CN 知乎的深色主题
// @description 知乎的深色主题风格
// @description:zh-CN 知乎的深色主题风格
// @author Benjamin L
// @namespace https://github.com/bensgith/userscripts
// @supportURL https://github.com/bensgith/userscripts
// @homepageURL https://github.com/bensgith/userscripts
// @homepage https://github.com/bensgith/userscripts
// @license MIT
// @match https://www.zhihu.com/*
// @icon https://static.zhihu.com/heifetz/favicon.ico
// @grant GM_addStyle
// @run-at document-idle
// @compatible chrome
// @compatible firefox
// @compatible edge
// @compatible opera
// @compatible safari
// @compatible kiwi
// @compatible qq
// @compatible via
// @compatible brave
// @version 2025.6.2.1
// @downloadURL https://raw.githubusercontent.com/ChinaGodMan/UserScripts/main/zhihu-black/zhihu-black.user.js
// @updateURL https://raw.githubusercontent.com/ChinaGodMan/UserScripts/main/zhihu-black/zhihu-black.user.js
// ==/UserScript==
(function () {
'use strict'
///////////////////////////////
// top story container
//////////////////////////////
if (document.getElementsByClassName('Topstory').length > 0) {
var cssTopstory = `
/* top story container */
.TopstoryItem--advertCard {
display: none;
}
.Topstory-mainColumn {
width: 787px;
}
.Topstory-mainColumnCard .Card {
border-bottom-color: #414141 !important;
}
`
GM_addStyle(cssTopstory)
}
/////////////////////////////////////////////////////
// Question details page
///////////////////////////////////////////////////
if (document.getElementsByClassName('QuestionPage').length > 0) {
var cssQuestionPage = `
/* question details page */
.QuestionHeader-footer,
.Pc-word, /* advertisement */
.Reward, /* reward option */
.Question-sideColumnAdContainer, /* 侧边栏广告 */
.AnswerInfo-favlist-title .AnswerInfo-favlist-followers, /* 被收藏次数 */
.AnswerInfo-favlist-author /* 被收藏的作者信息 */ {
display: none;
}
.QuestionHeader,
.QuestionHeader-footer {
background-color: #1E1E1E;
color: #D4D4D4;
}
.QuestionHeader-title,
.NumberBoard-itemValue {
color: white;
}
.QuestionHeader-main {
padding-left: 0;
}
.Question-mainColumn {
width: 752px;
}
.css-1qyytj7 /* 侧边栏 */{
max-width: 234px;
}
.InputButton {
background-color: #1E1E1E;
}
.AuthorInfo {
max-width: none;
}
/* article separator line */
.List-item+.List-item:after {
border-bottom-color: #414141;
}
/* Yanxuan special column meta info */
.KfeCollection-IntroCard-newStyle-mobile,
.KfeCollection-IntroCard-newStyle-pc {
background-color: #414141;
}
`
GM_addStyle(cssQuestionPage)
}
/////////////////////////////////////////////////////
// Search result page
///////////////////////////////////////////////////
if (document.getElementsByClassName('Search-container').length > 0) {
var cssSearch = `
/* Search result page */
.SearchTabs,
.css-knqde /* right side panel */ {
display: none;
}
.Search-container,
.SearchMain {
width: 1050px;
}
`
GM_addStyle(cssSearch)
}
/////////////////////////////////////////////////
// main page
////////////////////////////////////////////////
var css = `
/* hidden elements */
.FollowButton, /* 关注按钮 */
.KfeCollection-CreateSaltCard, /* 盐先作者平台 */
.css-173vipd, /* 推荐关注 */
.css-2pfapc, /* 帮助中心 举报中心 关于知乎 备案信息 */
.Pc-card, /* 侧边栏广告 */
.Pc-Business-Card-PcTopFeedBanner /* 首页顶部广告banner */{
display: none;
}
/* common elements */
body {
background-color: #333333;
}
a,
a:hover,
input.Input {
color: white !important;
}
.css-17rnw55 /* app header background */ {
background-color: #323233;
color: white;
}
.SearchBar {
max-width: 670px;
}
.SearchBar-input {
background-color: #3C3C3D !important;
}
/* article common */
.Card {
background-color: #1E1E1E;
color: #D4D4D4;
}
.ContentItem-actions {
background-color: #1E1E1E;
}
.Button--blue {
background-color: #0E639C !important;
color: white !important;
}
.css-1503iqi, /* collapse comment button */
.css-1503iqi:hover,
.VoteButton,
.CornerButton {
background-color: #0E639C;
color: white;
}
/* comments area */
.css-1jpzztt {
color: #D4D4D4;
}
.css-kt4t4n,
.css-7wvdjh, /* reply content in reply box in comments */
.css-1e7fksk /* reply list in reply box in comments */ {
background-color: #1E1E1E;
}
.css-70t8h2 {
background: unset;
border-bottom: unset;
}
/* input box border in comments */
.css-14zbeoe,
.css-u76jt1 {
border-color: #414141;
}
/* timeline font color in story topic */
.css-13brsx3,
.css-r4op92 /* 评论回复 */ {
color: white;
}
`
GM_addStyle(css)
})()