night_mode

Ночная тема

目前为 2020-09-16 提交的版本。查看 最新版本

// ==UserScript==
// @name              night_mode
// @author            Мифист
// @namespace         Мифист
// @description       Ночная тема
// @icon              http://daily.heroeswm.ru/upload/kvadro2_gvd.png
// @version           1.0
// @encoding          utf-8
// @include           https://*heroeswm.ru/*
// @exclude           */war*
// @exclude           */chat*
// @exclude           */frames*
// ==/UserScript==

(function(win, src) {
  'use strict';
  if (win.self != win.top || !/www\.heroeswm\.ru/.test(src) || /\.ru\/$|\/war|\/quest_(?:summary|join)/.test(src) || typeof localStorage !== 'object') return;
  var key = 'nightMode';
  var path = location.pathname.slice(1, -4);
  var html = document.documentElement;
  var head = document.head;
  var parseNode = function(html) {
    var el = document.createElement('div');
    el.innerHTML = html;
    return el.firstChild.cloneNode(!0);
  };
  var switcher = parseNode('<button id="night_mode_switcher" title="Включить/выключить ночную тему" data-icon="&#127912;" data-enabled></button>');
  var switcherStyle = parseNode('<style>#night_mode_switcher {position: fixed;right: 10px;bottom: 10px;margin: 0;padding: 0;background-color: transparent;border: none;outline: none;cursor: pointer;-webkit-filter: grayscale(1) brightness(0.2);filter: grayscale(1) brightness(0.2);z-index: 999;opacity: .9;}#night_mode_switcher[data-enabled="true"] {-webkit-filter: grayscale(1) brightness(1.2);filter: grayscale(1) brightness(1.2);}#night_mode_switcher:after {content: attr(data-icon);font-size: 20px;}#night_mode_switcher:hover {opacity: 1;}</style>');
  var darkStyle = parseNode('<style id="dark_style"></style>');
  var darkStyleCss = ('html, body.txt {color: #ccc;background-color: #222;border-color: #888;}body.txt * {border-color: #888;}body.txt .wbwhite,body.txt .wblight2 {background-color: #1d1d1d;}body.txt .wblight {background-color: #2d2d2d;}body a, body td, .txt {color: #ccc;}body.txt input, body.txt button {border-color: initial;}button, input[type="button"], input[type="submit"] {cursor: pointer;}body.txt :disabled {color: #666;background-color: #bbb;cursor: default;}body.txt button:not(:disabled):hover,body.txt input[type="submit"]:not(:disabled):hover {background-color: #fff;}body.txt b,body.txt h1,body.txt h2,body.txt h3,body.txt h4,body.txt h5,body.txt h6 {color: #d0bda6;}body.txt font[color] * {color: inherit;}body.txt a[href],body.txt a[href] > *,body.txt b > a[href] {color: #c9b087;}span > a[style="color:teal"] {color: #c9b087 !important;}body.txt a[href]:hover,body.txt a[href]:hover > *,body.txt a[href]:hover + font[color] {color: #da472d !important;}body.txt font[color="000000"],body.txt font[color="black"] {color: #999;}body.txt font[color="gray"],body.txt font[color="#7D7D7D"] {color: #999;}body.txt font[color="red"],body.txt font[color="#CC1100"],body.txt font[color="ff0000"] {color: #d03535;}body.txt font[color="green"],body.txt font[color="00ff00"] {color: #4f9a68;}body.txt font[color="blue"] {color: #3171a3;}body.txt font[color="purple"] {color: #ab3cab;}font[style$="color:#696156"] {color: #c9b087 !important;}#main_top_table table[width="970"] {position: relative;-webkit-filter: invert(1) grayscale(100%) contrast(1.05);filter: invert(1) grayscale(100%) contrast(1.05);z-index: 100;}#main_top_table td {color: #222;}#breadcrumbs ul * {color: #b7b7b7 !important;}#breadcrumbs a:hover {color: #c9b087 !important;}img[src$="male.gif"] {-webkit-filter: invert(.86);filter: invert(.86);}body.txt .cre_mon_parent div[valign="middle"] {color: #222;}#add_now_count {color: #c9b087;}.art_durability_hidden {color: #000;background-color: transparent;}img[name="imgcode"] {-webkit-filter: invert(.8);filter: invert(.8);}tr[bgcolor],td[bgcolor] {background-color: inherit;}tr[bgcolor="#ffffff"],td[bgcolor="#ffffff"] {background-color: #222;}tr[bgcolor="#eeeeee"],td[bgcolor="#eeeeee"] {background-color: #272727;}tr[bgcolor="#dddddd"] {background-color: #404040;}body.txt .sweet-overlay {background-color: rgba(27, 27, 27, 0.6);}body.txt .sweet-alert {background-color: #444;border: 2px solid #777;user-select: none;}body.txt .sweet-alert:not(.showSweetAlert) {opacity: 0 !important;}body.txt .sweet-alert,body.txt .sweet-alert * {transition: none;animation: none;}body.txt .sweet-alert p {color: #aaa;}body.txt .sweet-alert button {background-color: #607D8B !important;box-shadow: none !important;}body.txt .sweet-alert button.confirm {background-color: #795548 !important;}body.txt .sweet-alert button:hover {-webkit-filter: brightness(120%);filter: brightness(120%);}/* ------------------------------------------- *//* forum */table.forum.c_darker * {border-color: #888;}table.forum.c_darker tr {background-color: #222;}table.forum.c_darker tr > td[bgcolor="#F5F3EA"],table.forum.c_darker tr.second {background-color: #333;}table.forum.c_darker th {background-color: #555;}table.forum.c_darker td {color: #ccc !important;background-image: none;outline: 1px solid #444;outline-offset: -2px;}table.forum.c_darker td[style$="background-image: none"] {outline: none;}table.forum.c_darker tr > td[colspan] {background-color: #6d6d6d;}table.forum.c_darker tr.message_footer td {color: #888 !important;background-color: #333;border: none;}table.forum.c_darker td a[href] {color: #c9b087;}table.forum.c_darker a[href^="forum_thread"] > img {-webkit-filter: invert(.9) sepia(.6);filter: invert(.9) sepia(.6);}table.forum.c_darker span[style*="background-color: #C1CDCE"] {background-color: #444 !important;}table.forum.c_darker font[style*="color:#696156"] {color: #aaa !important;}table.forum.c_darker .fsm,table.forum.c_darker .forumt {color: inherit;}#nm_txta {background-color: #ddd;}/* roulette */html[data-page*="roul"] table[class="wb"][style="min-width:300px;"] > tbody > tr:first-child > td,html[data-page*="roul"] table[class="wbwhite"][style="min-width:600px;"] > tbody > tr:nth-child(3) > td,html[data-page*="roul"] table[class="wbwhite"][style="min-width:600px;"] > tbody > tr:nth-last-child(2) > td,form[name="rform"] td.wb2 {background-color: #555;}form[name="rform"] td[bgcolor="#005C11"] {background-color: #005C11;}/* tavern */td[style*="/taverna_bkg.jpg"],td[style*="/taverna_bkg.jpg"] td[class] {background-image: none !important;border-color: #666;}td[style*="/taverna_bkg.jpg"] td.tlight {background-color: #333;}td[style*="/taverna_bkg.jpg"] td.twhite {background-color: #464646;}/* events */.Global .TextBlock {background-color: rgba(0, 0, 0, .6);outline: 1px solid #999;overflow: hidden;}.Global .TextBlockContent {background-image: none;}/* map */#map_texts > div:not(:first-child) {color: #d69534;}#show_map {outline: 1px solid #444;}img[src*="/map/nl"] {border-radius: 50%;}img[src$="/star0t.gif"],img[src$="/star1t.gif"],img[src$="/star12t.gif"],img[src$="/speed_hunt.png"] {-webkit-filter: invert(.9) sepia(1);filter: invert(.9) sepia(1);}/* pvp_guild */a[href^="pvp_guild.php?t_"] > img {-webkit-filter: invert(.9) sepia(1);filter: invert(.9) sepia(1);}/* shop */html[data-page="shop"] table[class="wb"][width="95%"] > tbody > tr > td.wbwhite {background-color: #444;}img[src$="/galka.jpg"] {-webkit-filter: invert(.9) sepia(1);filter: invert(.9) sepia(1);}/* army_info */body.txt .army_info {background-image: none;background-color: #333;background: linear-gradient(#555, #111);}body.txt .army_info .scroll_content_half {color: inherit;}body.txt .army_info .scroll_content_half div {color: #d6b47d;}body.txt .army_info_skills {text-align: left;}body.txt .army_info .army_info_skills > * {color: #ccc;}body.txt .army_info .army_info_skills > a {color: #bbb;transition: none !important;}body.txt .army_info .army_info_skills > a:hover {color: #c9b087;}#easyTooltip {width: auto;min-width: auto;max-width: 320px;font-size: .95em;padding: .9em;color: #ddd;border-color: #bbb;background-color: #1c1c1c;background-image: none;text-align: justify;opacity: 1 !important;}/* leader_army */#army_info_div .bookmark {background-color: #736e6c;border-color: inherit;}#army_info_div .bookmark:hover {background-color: #a7a7a7;}#army_info_div .selected_bookmark {background-color: #3a3a3a;}#bookmark-1 > span {color: inherit;}#army_info_div .amount {color: #d6b47d;}#army_info_div .info_header_leadershipAmount {color: inherit;}/* inventory */html[data-page="inventory"] td.wb[id^="tbc"] {background-color: inherit !important;}html[data-page="inventory"] td.wb[id^="tbc"][style$="white;"] {background-color: #1f1f1f !important;}/* skillwhell */#skills_table .area_wheelInfoPanels {background-image: none;outline: 1px solid gray;background:url("https://dcdn3.heroeswm.ru/i/combat/corner4_lt.png") no-repeat top left,url("https://dcdn3.heroeswm.ru/i/combat/corner4_rt.png") no-repeat top right,url("https://dcdn3.heroeswm.ru/i/combat/corner4_lb.png") no-repeat bottom left,url("https://dcdn3.heroeswm.ru/i/combat/corner4_rb.png") no-repeat bottom right,url("https://dcdn3.heroeswm.ru/i/combat/winChatDesktop_border_t.png") top left repeat-x,url("https://dcdn3.heroeswm.ru/i/combat/winChatDesktop_border_b.png") bottom left repeat-x,url("https://dcdn3.heroeswm.ru/i/combat/winChatDesktop_border_l.png") top left repeat-y,url("https://dcdn3.heroeswm.ru/i/combat/winChatDesktop_border_r.png") top right repeat-y;background-color: #353535;}#skills_table .info_head3Wheel {color: #cca568;}#skills_table .wheel_abilitiesList {color: #e0c497;}#skills_table .info_head3_2Wheel {color: #888;}#skill_cur_cost {color: inherit;}#win_Loader {-webkit-filter: invert(.9) sepia(.7);filter: invert(.9) sepia(.7);}/* castle */script[src*="/castles.js"] + table td.wbwhite,script[src*="/castles.js"] + table tr[bgcolor="#FFFFFF"] {background-color: #333;}table[width="100%"][style*="/castle_tabs"] {background-image: none !important;}table[width="100%"][style*="/castle_tabs"] tr > td {outline: 1px solid #888;}table[width="100%"][style*="/castle_tabs1a.gif"] tr > td:first-child,table[width="100%"][style*="/castle_tabs2a.gif"] tr > td:last-child {background-color: #444;}html[data-page="castle"] tr[bgcolor="#dc988d"] {background-color: #795548;}html[data-page="castle"] tr[bgcolor="#9d9d9d"] {background-color: #555;}img[src$="/castle_show_ico.gif"],img[src$="/castle_hide_ico.gif"] {border-radius: 50%;}/* sms */img[src$="sms_flag.gif"] {-webkit-filter: invert(.9) sepia(1) grayscale(1);filter: invert(.9) sepia(1) grayscale(1);}form[action="sms.php"] + tbody > tr:first-child b {color: inherit !important;}form[action="/sms_blacklist.php"] td.wbcapt {background-color: #444;}/* task_guild */img[src$="/zvezda_empty.png"] {-webkit-filter: invert(.9) sepia(1);filter: invert(.9) sepia(1);}/* help */html[data-page="help"] table[bgcolor="#000000"] {background-color: #666;}html[data-page="help"] table[bgcolor="#FFFFFF"] {background-color: #222;}img[src*="/magic/l"],img[src$="/blood_rage.jpg"] {-webkit-filter: invert(.9) sepia(1);filter: invert(.9) sepia(1);}/* photo_pl_photos */#lbOverlay, #lbCenter, #lbBottomContainer {z-index: 100;}/* tour_hist */table.wbwhite[width][style^="BACKGROUND"] {background-color: #333 !important;}/* donate */html[data-page^="hwm_donate"] div[style*="color: #000000"] {color: inherit !important;}html[data-page^="hwm_donate"] .pay-sys {background-color: #353535;}');
  var nightModeToggle = function() {
    var check = String(!localStorage[key]).replace('false', '');
    this.setAttribute('data-enabled', check);
    localStorage[key] = check;
    darkStyle.textContent = check && darkStyleCss;
  };
  var nightModeInit = function(test) {
    if (!test) return;
    switcher.setAttribute('data-enabled', 'true');
    darkStyle.textContent = darkStyleCss;
  };
  html.setAttribute('data-page', path);
  head && head.appendChild(darkStyle);
  switcher.onclick = nightModeToggle;
  switcher.appendChild(switcherStyle);
  html.appendChild(switcher);
  nightModeInit(localStorage[key]);
})(window, location.href);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址