// ==UserScript==
// @name 51nb-style
// @namespace http://tampermonkey.net/
// @version 2024-02-29
// @description ibmnb.com (green style)
// @author Envy Chen
// @match https://*.ibmnb.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @run-at document-body
// ==/UserScript==
(function() {
'use strict';
//document.body.style.display = 'none';
const styleCss = `
/* mobile */
.cr180_pg.cl {
background: #304633 !important;
}
.cr180_pmlist li a {
color: #4545b1 !important;
}
.space_profile_box th {
color: #eee !important;
}
.space_profile .cr_box .cr_name {
color: #eee !important;
}
.cr180_space_ext p span {
color: #eee !important;
}
.cr180_space_ext p {
color: #ddd !important;
}
.cr_sub, .tl .cr_c {
background: #314734 !important;
color: #ddd !important;
}
.tl .cr_author, .tl .cr_author a {
color: #ddd !important;
}
.tl .cr_date, .tl .cr_views, .tl .cr_reply {
color: #999 !important;
}
.cr180_nv, .forumorderby_title, .bm_title {
background: #134e1f;
box-shadow: rgba(0, 0, 0, 0.35) 0px -50px 36px -28px inset !important;
}
.cr180_forum_counts .z {
color: #eee !important;
}
.cr180_message {
background: #314734 !important;
color: #ddd !important;
}
.arrow_box {
background: #314734 !important;
}
.cr180_threadtitle {
background: #314734 !important;
}
.cr_sub, .cr_sub a, .cr_c {
border-left: 0 !important;
border-right: 0 !important;
border-bottom: 1px solid #888 !important;
}
div#thread_list {
background: #0e3115;
box-shadow: rgba(0, 0, 0, 0.35) 0px -50px 36px -28px inset !important;
}
.cr180_modmanage .cr_comment_s, .cr180_modmanage .cr_mods, .cr180_modmanage .cr_editp {
color: #ddd !important;
}
.cr180_pg .pg .first, .cr180_pg .pg .prev, .cr180_pg .pg .nxt, .cr180_pg .pg .last {
background: transparent !important;
}
span.cr_c_author a {
color: #000 !important;
}
form#poll {
/* background: #ccc !important;*/
}
.arrow_box {
border: 1px solid #888 !important;
}
.footer {
background-color: transparent !important;
}
/* desktop */
body {
background: #111 !important;
color: #ddd !important;
font-family: "Microsoft Yahei UI";
}
.edt .b2r a {
color: #000 !important;
}
/* edit reply */
.pbl a, .pbls a {
color: #000 !important;
}
td#fwin_content_nav {
color: #000 !important;
}
.p_pop a:hover, .p_pop a.a, #sctype_menu .sca {
background: #666 !important;
}
#post_extra_tb label.a {
color: #000 !important;
}
.exfm {
background: transparent;
border: 1px solid #888 !important;
}
.edt .bbar {
background: transparent !important;
}
.ntc_l {
color: #000 !important;
}
div#calendar {
background: #888 !important;
}
/* post by reward */
.exfm.cl .xg1 {
color: #eee !important;
}
/* post reply */
div#postbox .bar a {
color: #000 !important;
}
td#fwin_content_reply , td#fwin_content_reply a{
color: #000 !important;
}
div#fastposteditor a {
color: #000 !important;
}
#viewui_fontsize ul li {
color: #000 !important;
}
.ftid a {
color: #333 !important;
}
ul.tb li a {
color: #ccc !important;
}
ul.tb li.a a {
color: #333 !important;
}
.tb .a a, .tb .current a {
background: #fff !important;
}
#qmenu {
color: #000 !important;
}
.dt th {
background: transparent !important;
}
.ttp a, .ttp strong {
background: #314734 !important;
border: 1px solid #888 !important;
}
ul.tb a {
background: #333 !important;
}
table td {
/* background: #576459;*/
color: #ddd;
}
tr {
background: #314734 !important;
}
.tns th {
color: #ddd !important;
/* background: #576459;*/
border: none;
}
.tl .bm_c tr td, .tl .bm_c tr th {
background: #314734 !important;
}
.tl .bm_c {
border: 0;
}
.tl td em, .tl td em a {
color: #ddd !important;
}
div#second1 {
background: #314734;
border: 0 !important;
}
.fl_tb td, .tl .bm_c tr td, .tl .bm_c tr th {
border: 1px solid #0c3c0c;
}
.tl .th {
background: #314734 !important;
}
a {
color: #a5c8c6 !important;
}
a:visited {
color: #bdb070 !important;
}
.authi span {
color: #ddd !important;
}
.tl th em, .tl th em a {
color: #ddd !important;
}
.authi a {
/* color: #ddd !important;*/
}
span.ppm2 a {
color: #afcd09 !important;
}
a.xi2 {
color: #98bab8 !important;
}
.xg1, .xg1 a {
color: #a5c8c6 !important;
}
input#scbar_txt {
color: #000 !important;
}
i.pstatus {
color: #ccc !important;
}
.msgborder {
background: #2b4940;
color: #ddd !important;
border: 1px solid #888 !important;
border-top: 0 !important;
}
.t_f a font {
/* color: #ccc; */
}
.tl #forumnewshow a {
color: #cc0 !important;
border: 0 !important;
}
.tl #forumnewshow a:hover {
background: #425b42;
}
div#second1 li a:hover {
background: none;
border: 0 !important;
font-weight: 600;
}
.chart {
color: #ddd !important;
}
p.xg2 font {
color: #19a0e4;
}
.fl .bm_c p, .fl .bm_c dd {
color: #ddd !important;
}
.xi2, .xi2 a, .xi3 a {
color: #ddd !important;
font-weight: 600;
}
.bm .bm_h h1, .bm .bm_h h1 a, .bm .bm_h h2, .bm .bm_h h2 a, .bm .bm_h h3, .bm .bm_h h3 a {
color: #fefc4f !important;
}
div#toptb {
background: #314734;
}
.chart em {
color: #bbb !important;
}
.jg12 td {
background: #314734;
}
p.xg2 {
color: #ddd !important;
}
#eis_nv {
background: #134e1f;
box-shadow: rgba(0, 0, 0, 0.35) 0px -50px 36px -28px inset !important;
}
.bm .bm_h {
background: #134e1f;
box-shadow: rgba(0, 0, 0, 0.35) 0px -50px 36px -28px inset !important;
}
.msgheader {
background: #3a6357;
box-shadow: rgba(0, 0, 0, 0.35) 0px -50px 36px -28px inset !important;
color: #ddd !important;
border: 1px solid #888 !important;
border-bottom: 0 !important;
}
#ft {
color: #bbb !important;
}
.pi {
border: 1px solid #106410;
}
div#um p a {
color: #6cf !important;
}
div#um a font[color="blue"] {
color: #ddd !important;
}
.scbar_btn_td {
background: #0F3917 !important;
}
.hdc.cl h2 a img {
filter: brightness(0.8);
}
.bbs1, .bbs2 {
border: 1px solid #000 !important;
}
td.pls {
border-right: #000 1px solid !important;
}
.pbn {
padding-bottom: 0 !important;
margin-bottom: 5px !important;
}
/* custom reply text */
font[color^="#"] {
/* background: #F7F7F7;*/
}
em.xg2 {
color: #ddd;
}
.pf_l em {
color: #ddd;
}
#uhd {
background: transparent;
}
img.user_avatar[src*="noavatar.svg"] {
stroke-opacity: revert;
border-radius: 50%;
zoom: 120%;
}
a.bm_h {
background: transparent !important;
}
a.bm_h:hover {
background: #5e8363 !important;
}
.pg a, .pg strong, .pgb a, .pg label {
background: transparent;
border: 0;
color: #ddd;
}
.pg a.prev {
background: none;
}
.pg a.nxt {
background: none;
}
.pg a.prev:after {
content: '<';
color: #ddd;
}
.hdc.cl h2 a:after {
content: "51NB";
color: #ddd;
font-size: 40px;
font-family: "Microsoft Yahei UI";
line-height: 66px;
vertical-align: bottom;
background: -webkit-linear-gradient(rgb(238 239 238), rgb(57 56 56));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.hdc.cl h2 a img, div.logo img {
display: none !important;
}
#eis_nv li a:hover {
background: transparent !important;
font-weight: 600;
}
#eis_nv li {
background: none !important;
}
.pinf, .pinf strong {
color: #ddd !important;
}
img[src*="smiley"] {
filter: drop-shadow(2px 4px 6px black);
}
.p_pop, .p_pof, .sllt {
background: #333;
}
.jg12 td {
background: #134e1f !important;
border-bottom: 1px solid #000 !important;
}
td.t_f[id^="postmessage"] font[style*="color"], div[id^="postmessage"] font[style*="color"] {
background: #ccc !important;
display:inline-block;
}dl[id^="pmlist"] {
background: transparent !important;
}
dl[id^="pmlist"] {
background: transparent !important;
}
li#secondcurrent {
color: #ccc;
}
.alt, .alt th, .alt td {
background: transparent !important;
}
.tfx th, .tfx td {
background: transparent !important;
}
.tdats .h th {
color: #ddd !important;
}
font[color="red"] {
color: #e95959;
}
.nfl .f_c {
background: transparent !important;
}
.rfm table tr {
background: transparent !important;
}
.avt img, img.user_avatar {
background: none !important;
border: 0 !important;
}
.sttl {
background: transparent !important;
}
/* badges */
img[id^="md_"] {
filter: drop-shadow(1px 2px 3px #fff);
}
tr.fl_row a img {
filter: drop-shadow(2px 2px 4px #eee);
}
.tfm .d {
color: #eee !important;
}
span.xg1 {
color: #ccc !important;
}
div#pt {
margin: 0;
padding: 2px 0;
}
div#ct {
border: 1px solid #304633;
}
div#wp {
background: #304633 !important;
}
/* search results */
.pbw p {
color: #ccc !important;
}
/* qiandao */
div.tb a {
color: #000 !important;
}
.dt td, .dt th {
border-bottom: 1px solid #333;
}
.fl-table tr:nth-child(even) {
filter: brightness(0.8);
}
table#tablehead {
border: 0 !important;
}
.fl-table td {
border: 0 !important;
}
div#pt {
margin: 0;
padding: 2px 0;
}
.bm {
background: #304633 !important;
}
.bm .bm_c {
border: 2px solid #304633;
}
.fl-table td .lunar {
color: #ddd !important;
}
.bm_c .dt th {
background: #0F3918 !important;
}
/* config query */
.bbs1, .bbs2 {
background: transparent !important;
}
`;
const style = document.body.appendChild(document.createElement('style'));
style.type = 'text/css';
style.innerHTML = styleCss;
const style2 = document.body.appendChild(document.createElement('style'));
style2.type = 'text/css';
style2.innerHTML = `
.bbs_theme {
position: absolute;
top: 2px;
left: 150px;
}
@media screen and (max-width:480px) {
.bbs_theme {
left:5px;
}
}
select#sel_theme {
background: #000;
color: #fff;
}
.slidecontainer {
width: 100px;
display: inline-block;
position: absolute;
top: 5px;
}
/* The slider itself */
.slider {
-webkit-appearance: none;
width: 100%;
height: 10px;
border-radius: 5px;
background: #d3d3d3;
outline: none;
opacity: 0.9;
-webkit-transition: .2s;
transition: opacity .2s;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 22px;
height: 22px;
border-radius: 50%;
cursor: pointer;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAYCAIAAACeHvEiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAq5JREFUeNpi/P//PwMa+Pfr86cP7149vXf12o2Hj199/MEtJKOgqaevKisqJMjHy8HEgAH+o4C/n59f3Te/0ddQlAEL4DH0LZ2/7/zzT79Rdf1HMuXPlxt7pifZSjEQAAK28Z27r7z9jcWUv1/OLSk2lkCo5ZPVdPKLTEyKddOV58AwScQgcvbRp79QTfl1f3OrOcwRrGK6AZlVc7YceQlWdbA+XASrk3RDlpx7+w9uyuf7mxK1BCByguo+zctOf0I49uXqIj9BHH5T9O669PYX2JSfbzdXGLCARdnlHFu2PEYNuFdrcJvCwCCVuuzKj3//GT7eXOfFDxbhVIhsPfIJLfQJmMLA5dRz7cNvpkfHFu36COLLmrvGZlrxMpAGvh1auO/2B6Zbp/b+AXHF9XXdbQUZGUgFf64cvPiI6e7xXyAOr7iQug4PAxng/4mHL5je3YAELBs7PycDWeDVnz9MDKxgJiMQMJFnCiPDfyYxfTDzw5fvt16SZ4qGID+Tuq00iPn7yePbJ5//I8MQNidleSY9uwhw7vl85vKudZe+kWwIr7uFjgiThFlwqjEou325sm/hpPl3STOHUSUh1l6eG5iPvl9ZnAjNzOxyQTWrHv5CTrsv8aVdcde5519Dc+PvD1cnh2hCsz+7lGdO584r72Cm/NhSGSyE3QxR7/Zd738hlS/f7m0vtpOHSbPKm/vnVTZNXrj55Lkjs5Jc+LEYIWSaOPPKh1/oZd37Gzur/bSRCyR2QVkdfV1NCQEWNBOYpD2LlkDKBIwSExhCLy6v78m2EGbBV14aB7SvOfbsyz8c5S4E/P787Ob5nfM7M1y1RdiQUoWoskta3Zz1h248evsLXc9/Riw1Cagy+f31y6ev375/+/H927f/XFycHFycnNw8PNwczNgcCBBgAALk80Jz0kwqAAAAAElFTkSuQmCC");
}
.slider::-moz-range-thumb {
width: 22px;
height: 22px;
border-radius: 50%;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAYCAIAAACeHvEiAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAq5JREFUeNpi/P//PwMa+Pfr86cP7149vXf12o2Hj199/MEtJKOgqaevKisqJMjHy8HEgAH+o4C/n59f3Te/0ddQlAEL4DH0LZ2/7/zzT79Rdf1HMuXPlxt7pifZSjEQAAK28Z27r7z9jcWUv1/OLSk2lkCo5ZPVdPKLTEyKddOV58AwScQgcvbRp79QTfl1f3OrOcwRrGK6AZlVc7YceQlWdbA+XASrk3RDlpx7+w9uyuf7mxK1BCByguo+zctOf0I49uXqIj9BHH5T9O669PYX2JSfbzdXGLCARdnlHFu2PEYNuFdrcJvCwCCVuuzKj3//GT7eXOfFDxbhVIhsPfIJLfQJmMLA5dRz7cNvpkfHFu36COLLmrvGZlrxMpAGvh1auO/2B6Zbp/b+AXHF9XXdbQUZGUgFf64cvPiI6e7xXyAOr7iQug4PAxng/4mHL5je3YAELBs7PycDWeDVnz9MDKxgJiMQMJFnCiPDfyYxfTDzw5fvt16SZ4qGID+Tuq00iPn7yePbJ5//I8MQNidleSY9uwhw7vl85vKudZe+kWwIr7uFjgiThFlwqjEou325sm/hpPl3STOHUSUh1l6eG5iPvl9ZnAjNzOxyQTWrHv5CTrsv8aVdcde5519Dc+PvD1cnh2hCsz+7lGdO584r72Cm/NhSGSyE3QxR7/Zd738hlS/f7m0vtpOHSbPKm/vnVTZNXrj55Lkjs5Jc+LEYIWSaOPPKh1/oZd37Gzur/bSRCyR2QVkdfV1NCQEWNBOYpD2LlkDKBIwSExhCLy6v78m2EGbBV14aB7SvOfbsyz8c5S4E/P787Ob5nfM7M1y1RdiQUoWoskta3Zz1h248evsLXc9/Riw1Cagy+f31y6ev375/+/H927f/XFycHFycnNw8PNwczNgcCBBgAALk80Jz0kwqAAAAAElFTkSuQmCC");
cursor: pointer;
}
`;
//window.setTimeout(function(){
// document.body.style.display = '';
//}, 500);
//https://stackoverflow.com/questions/14196671/session-only-cookies-with-javascript
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return null;
}
var theme = getCookie('sel_theme');
if (theme == null) theme = 1;
var t = document.createElement('div');
t.className = 'bbs_theme';
t.innerHTML = `<select id="sel_theme" onchange="onSelTheme()"><option value="0">默认主题</option><option value="1">绿色主题</option></select><div class="slidecontainer">
<input type="range" min="1" max="100" value="50" class="slider" id="myRange">
</div>`;
document.body.appendChild(t);
window.onSelTheme = function(){
var val = document.getElementById('sel_theme').value;
if (val == 0){
style.innerHTML = "";
setCookie('sel_theme', 0);
}else if (val == 1){
style.innerHTML = styleCss;
setCookie('sel_theme', 1);
}
}
//alert(theme);
document.getElementById('sel_theme').value = theme;
window.onSelTheme();
// brightness setting
var brg = getCookie('cur_brg');
if (brg == null) brg = 50;
var slider = document.getElementById("myRange");
slider.value = brg;
// Update the current slider value (each time you drag the slider handle)
slider.oninput = function() {
document.body.style.filter = "brightness("+(parseInt(this.value,10)/100 + 0.5)+")";
setCookie('cur_brg', this.value);
}
slider.oninput();
})();