Created
March 24, 2022 19:38
-
-
Save Be1zebub/fc3da2242d4bfb23f49b8bb311638ff3 to your computer and use it in GitHub Desktop.
Dark theme for wiki.facepunch.com/gmod (requires tampermonkey)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Gmod Wiki Dark Style | |
// @namespace https://wiki.facepunch.com/gmod/ | |
// @version 0.3 | |
// @description try to take over the world! | |
// @author Phoenixf129 & Beelzebub | |
// @match https://wiki.facepunch.com/* | |
// @exclude *~edit | |
// @icon https://files.facepunch.com/garry/822e60dc-c931-43e4-800f-cbe010b3d4cc.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; | |
} | |
`; | |
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); | |
/* | |
setElemStyle('.function_line', "backgroundColor", "#212121"); | |
window.onpopstate = history.onpushstate = function() { | |
console.log("nav test"); | |
setElemStyle('.function_line', "backgroundColor", "#212121"); | |
}; | |
*/ | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment