cppreference黑夜模式
// ==UserScript==
// @name cppreference balck mode
// @description cppreference黑夜模式
// @license The Unlicense
// @version 1.1.0
// @author girl-dream
// @namespace https://github.com/girl-dream/
// @match https://cppreference.cn/*
// @match https://cppreference.dev/*
// @match https://cppreference.tw/*
// @match https://*.cppreference.net/*
// @match https://*.cppreference.dev/*
// @match https://*.cppreference.com/*
// @icon https://cppreference.cn/favicon.ico
// ==/UserScript==
(() => {
if (location.href.indexOf('cppreference.net') == -1) {
const form = document.querySelector('form')
const temp = form.querySelector('input')
form.target = '_blank'
form.action = 'https://www.bing.com/search'
temp.name = 'q1'
temp.value = `site:${location.host}`
}
const style = `
ins, .google-auto-placed,[id^="div-gpt-ad,carbonads"],#carbonads,#footer-icons {
display: none !important;
}
table,
#content *:not(a):not(table):not(th):not(tr):not(tbody):not(.t-mark-rev):not(tt):not(.kw1):not(.co1 span) {
color: #fff !important;
}
#cpp-content-base,
#cpp-footer-base,
#bodyContent,
body,
#cpp-head-first-base,
#cpp-head-second-base,
.mw-geshi,
#cpp-head-second-base span,
.t-member {
background: #17181A !important;
}
input[name='q'],
button[type='submit'],
input[type='submit'] {
background-color: #2d2d2d;
color: #fff;
border: 1px solid rgb(85, 85, 85);
outline: none;
}
a,
tt,
a:visited,
[class^="sy"],
#footer-info-lastmod {
color: #9198a1 !important;
}
th,
td,
table {
background: rgb(40, 43, 48) !important;
}
[class^="kw"],
[class^="nu"] {
color: #f5ab35 !important;
}
.mw-geshi {
background: none !important;
}
.t-navbar-menu > :first-child {
background: rgb(40, 43, 48) !important;
}
[class^="st"],
[class^="br"],
[class^="co"] {
color: #339900 !important;
}
.coliru-btn {
color: white !important;
background: rgb(40, 43, 48) !important;
box-shadow: none !important;
margin-bottom: 6px !important;
}
.t-inherited {
background-color: rgb(40, 43, 48) !important;
}
`
const styleSheet = new CSSStyleSheet()
styleSheet.replaceSync(style)
document.adoptedStyleSheets.push(styleSheet)
})();