-
Notifications
You must be signed in to change notification settings - Fork 11
/
dark_wiki.js
126 lines (118 loc) · 2.99 KB
/
dark_wiki.js
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
// from incredible-gmod.ru with <3
// https://github.com/Be1zebub/Small-GLua-Things/blob/master/dark_wiki.js
// https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo required
// ==UserScript==
// @name Gmod Wiki Dark Theme
// @namespace https://wiki.facepunch.com/gmod/
// @version 0.3
// @description Incredible dark theme for wiki.facepunch.com/gmod
// @author Phoenixf129 & Beelzebub
// @match https://wiki.facepunch.com/*
// @exclude *~edit
// @icon https://incredible-gmod.ru/assets/icons/inc32icon.png
// @grant none
// ==/UserScript==
(function() {
"use strict";
var Style = `
:root {
color-scheme: dark;
}
::-webkit-scrollbar {
width: 0.5em;
}
::-webkit-scrollbar-thumb {
background: rgb(92, 92, 92)
}
::-webkit-scrollbar-thumb:hover{
background: rgb(31, 31, 31);
}
.body > .content, #pagelinks a.active {
background: url(https://i.imgur.com/iKHU5u8.png);
}
.body, body > div.body > div.footer, body > div.body > div.content {
background: url(https://i.imgur.com/iKHU5u8.png);
background-color: rgba(0, 0, 0, 0.2) !important;
backdrop-filter: blur(2px);
}
.body > .footer > div > div ul li a {
color: #fff;
}
.markdown > .function .function_line {
background-color: rgba(0, 0, 0, 0.25) !important;
backdrop-filter: blur(4px);
}
.body-tabs ul li a.active {
background-color: #333;
color: #fff;
}
.markdown {
color: #999;
}
.markdown .code {
background-color: rgba(0, 0, 0, 0.25) !important;
backdrop-filter: blur(4px);
}
.markdown code {
background-color: rgba(0, 0, 0, 0.5) !important;
backdrop-filter: blur(4px);
}
.markdown span.key {
background-color: #000;
}
.markdown h2 {
color: #0082ff;
}
.markdown h3 {
color: #0082ff;
}
.body-tabs ul li a {
color: #fff;
}
.markdown table td {
border: 1px solid #111;
background-color: #222;
}
.markdown table th {
border: 1px solid #111;
background-color: #333;
}
.member_line {
color: #999;
}
.member_line a.subject {
color: #0082ff !important;
}
#ident > h1 > a::after {
content: "deprecated";
background-color: #b14a00;
color: #efefef;
font-size: 7px;
text-transform: uppercase;
padding: 2px;
margin-left: 5px;
display: inline-block;
position: relative;
top: -4px;
}
.highlight {
background-color: #dd610082;
}
`;
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName("head")[0];
if (!head) { return; }
style = document.createElement("style");
style.type = "text/css";
style.innerHTML = css;
head.appendChild(style);
}
function setElemStyle(selector, sname, svalue) {
var elem = document.querySelector(selector);
if (elem !== null) {
elem.style[sname] = svalue;
}
}
addGlobalStyle(Style);
})();