// ==UserScript== // @name Qidian International/Webnovel Dark Theme // @namespace ew0345 // @version 2.9 // @description A dark theme for Webnovel // @license CC BY-NC Creative Commons Attribution-NonCommerical // @grant GM_addStyle // @run-at document-start // @match *://*.www.webnovel.com/* // @match *://*.webnovel.com/* // @match https://passport.webnovel.com/emaillogin* // @include https://passport.webnovel.com*/* // @include https://acts.webnovel.com*/* // @include http://acts.webnovel.com*/* // @downloadURL none // ==/UserScript== (function() { let css = ""; if (location.href.startsWith("https://www.webnovel.com") || location.href.startsWith("https://webnovel.com")) { css += ` /* * Author: Ew0345 * Version: 2.9f */ `; } if ((location.hostname === "www.webnovel.com" || location.hostname.endsWith(".www.webnovel.com")) || (location.hostname === "webnovel.com" || location.hostname.endsWith(".webnovel.com"))) { css += ` /* * Note: I seriously need to go through and fully rewrite this section *sigh* */ /* Main Page + Anything else I don't have a section for */ html { background: #1a1a1a !important; color: #eee !important; } ._color1 { background: #1a1a1a !important; color: #eee !important; } .g_header.cha-header, .g_header.fs16, .cha-header-in { background: #1a1a1a !important; color: #eee !important; } .g_footer { background: #1a1a1a !important; color: #eee !important; } .g_row.g_address.pr.mb25 { background: #1a1a1a !important; color: #eee !important; } .db.ell.ttl { background: #1a1a1a !important; } .db.ell { background: #232323 !important; } .g_col_2.pr { background: #1a1a1a !important; color: #eee !important; } .g_header.fs16 .g_wrap.cf { background: #1a1a1a !important; color: #eee !important; } .det-hd.pt25.mb30 { background: #1a1a1a !important; color: #eee !important; } .g_mod.cha-modal._on { background: #1a1a1a !important; color: #eee !important; } .det-jd.pt25.mb48 { background: #1a1a1a !important; color: #eee !important; } .g_header.cha-header a, .g_header.fs16 a, ._hd span { color: #e3e3e3 !important; } .cha-page-in, .g_header.cha-header, .g_header.fs16 { border-color: #1c1c1c !important; } .cha-page-in { background: #232323 !important; color: #eee !important; } .cha-content { background: #232323 !important; color: #eee !important; } .hom-h1.fl { background: #232323 !important; color: #eee !important; } .j_reading_wrap { background: #232323 !important; color: #eee !important; } .g_row.hom-books.hom-gutter.hon-continue { background: #232323 !important; color: #eee !important; } .cha-header-in .oh .cha-hd-mn, .cha-header-in .oh .cha-hd-mn-text { background: #1a1a1a !important; } /*.pr { background: #232323 !important; color: #eee !important; }*/ .p20 { background: #232323 !important; color: #eee !important; } .g_sub_hd { background: #232323 !important; color: #eee !important; } .g_col_4.hom-rec-1st { background: #232323 !important; color: #eee !important; } div.cf.g_wrap { background: #232323 !important; color: #eee !important; } ._ari strong { background: #232323 !important; color: #eee !important; } ._mer strong { background: #232323 !important; color: #eee !important; } ._red.i-font-dn { background: #232323 !important; color: #eee !important; } #j_size { background: #232323 !important; color: #eee !important; } ._add.i-font-up { background: #232323 !important; color: #eee !important; } textarea[name="content"] { background: #232323 !important; color: #eee !important; } .j_abuse_drop.g_drop, .j_abuse_drop.g_drop a, .j_abuse_drop.g_drop::before { background: #232323 !important; color: #eee !important; } ._user { background: #232323 !important; color: #eee !important; } .db.mb5.ell.ttc { background: #232323 !important; color: #eee !important; } /*.hom-bd::before { background: linear-gradient(to bottom, #232323, #232323) !important; }*/ .g_col_2 a { color: #eee !important; } .fl.ell.cha-hd.pr._scroll, .fl.ell.cha-hd.pr { background: #1a1a1a !important; } .g_wrap.det-abt.lh1d8.c_strong.fs16.mb30.pt20 p { color: #eee !important; } ul._bd.pr.oh { border-radius: 25px !important; padding-bottom: 1% !important; padding-left: 1% !important; } .hom-ann.hom-gutter .fs16 .ttl._more { color: rgba(192, 192, 192, .89) !important; } .g_h1 { color: lightslategray !important; font-style: italic !important; } .g_wrap.hom-h a { color: rgba(192, 192, 192, .89) !important; } .g_h3.mb10 a { color: lightslategray !important; font-style: italic !important; } .g_h3.mb10 small { color: #ccc !important; } .p20 .g_h3 { color: lightslategray !important; font-style: italic !important; } /*.p20 .g_score small,*/ .g_star_num small { color: #aaa !important; } .p20 p { color: #eee !important; font-style: italic !important; } .g_col_2 .g_h4, .g_h4.ell2row { color: lightslategray !important; font-style: italic !important; } .g_col_2 a._type { color: #7f7f7f !important; } /*.g_col_2 .g_score small { color: #aaa !important; }*/ .swiper-wrapper.hom-books .g_h4 { color: lightslategray !important; font-style: italic !important; } .swiper-wrapper.hom-books a._type { color: #7f7f7f !important; } /*.swiper-wrapper.hom-books .g_score small* { color: #aaa !important; }*/ .hom-tags a.j_suggestTag { background-color: #303030 !important; } .hom-tags a.j_suggestTag:hover { filter: invert(5%); } .hom-tags a.j_suggestTag .ell { color: #eee !important; } .w100p td a._tit, .w100p tr td a._tit, .w100p td a._rel { color: #eee !important; } .g_lang ._hd:hover { background-color: #4c5fe2 !important; } .g_lang p { background-color: #1a1a1a !important; } .g_lang p a, .g_lang p a._on { color: #eee !important; } .g_lang p a:hover, .g_lang p a._on:hover { background-color: #1f1f1f !important; } a._on[title="About"] span, a._on[title="Table of Contents"] span, a._on[title="About"]:active span, a._on[title="Table of Contents"]:active span { color: #b7b7b7 !important; } h3.g_h2.mb10, .mb15.lh1d2.oh { color: lightslategray !important; font-style: italic !important; } .g_wrap.det-abt.lh1d8.c_strong.fs16.mb48 p { color: #eee !important; } small.fs24, /*._score .g_score small { color: #aaa !important; }*/ .det-hd.mb48 { background-color: #1f1f1f !important; border-color: #202020 !important; } .g_bread.fs16.c_strong.pt25.pb25.ell a, .g_bread.fs16.c_strong.pt25.pb25.ell span.vam { color: #a4a4a4 !important; } .g_mod { background-color: #1a1a1a !important; border-color: #1f1f1f !important; } .mb5.ell.lh1d5._detail.c_strong.fwb { color: #eee !important; } .j_getApp, svg.mr5 { color: #eee !important; } ._hd svg { color: #eee !important; } .ui-select a, .ui-select.active a{ background-color: #303030 !important; } .ui-select-button:hover { filter: invert(5%) !important; } .ui-select-text { color: #eee !important; } .ui-select-datalist-li { background-color: #232323 !important; } .ui-select-datalist-li.selected, .ui-select-datalist-li:hover { filter: invert(5%); } .j_bookDetailModal { color: rgba(192, 192, 192, .89) !important; text-decoration: underline !important; } .g_mod_chat_reply, .j_modal_parent_review, .g_mod_chat_bd { background-color: #202020 !important; } .g_mod_chat_reply .g_mod_hd { color: lightslategray !important; font-style: italic !important; } ._readmore { background: rgba(0,0,0,.9) !important; } .g_msg_hd a span, .g_msg_hd a h3{ color: #eee !important; } .g_msg_quote a strong { color: #ccc !important; } .j_catalog li a { padding-left: 4% !important; } .g_msg_spo._retract { color: #eee !important; background-color: #232323 !important; } .g_msg_spo { background-color: #232323 !important; border-radius: 25px !important; } .g_msg_spo .g_msg_bd { color: #eee !important; } .ui-page, .ui-page-prev, .ui-page-next { color: #ddd !important; } .vam { color: #ddd !important; } .vam a { color: #ddd !important; } .g_mod_bd a { color: #ddd !important; } a[title="Power Ranking"], a[title="Power Ranking"] strong { color: #ccc !important; } .g_drop_hd span, .g_drop_hd svg { color: #eee !important; } .swiper-slide .g_book a .g_h4 { color: lightslategray !important; font-style: italic !important; } .swiper-slide .g_book a .g_h4:hover { text-decoration-color: #eee !important; } .m-thoughts ._words { color: #eee !important; } .m-thoughts ._tit span { color: lightslategray !important; } .hom-bd::before { background: linear-gradient(to bottom, #232323, #232323) !important; } .g_mod_chat_scroll, .g_mod_chat_scroll_em { background: #1f1f1f!important; } .rank-chk span svg { color: #aaa !important; } ._score small { color: #aaa !important; } .j_tagWarp .tag-link { background-color: #232323 !important; } .db.ell.pr { text-decoration: none !important; } .db.ell.pr:hover strong { text-decoration: underline !important; } .pt8 { color: lightslategray !important; font-style: italic !important; } svg.fl, svg.mr8 { color: #aaa !important; } .c_strong a, .c_strong span { color: #bbb !important; } .mb48.c_strong { color: #eee !important; font-style: italic !important; } .fl.c_strong:link, .fl.c_strong:visited { color: #ddd !important; } a._more { color: rgba(192,192,192,.89) !important; } a[href="/vote"] strong.vam, a[href="/vote"] span.vam { color: #999999 !important; } .fs16.fl.mt20 { color: #aaa !important; } /* links w/ span that have broken underlining in firefox */ .det-hd-detail a:hover, .j_getApp:hover, .j_reportStory:hover { text-decoration: none !important; } .det-hd-detail a:hover span, .j_getApp:hover span, .j_reportStory:hover span { text-decoration: underline !important; } .j_synopsis p { color: #aaa !important; } `; } if (location.href === "https://www.webnovel.com/history" || location.href === "https://webnovel.com/history" || location.href.startsWith("https://www.webnovel.com/library") || location.href.startsWith("https://webnovel.com/library")) { css += ` /* Library + History Pages */ .db.ell { background-color: #1a1a1a !important; } .g_wrap.pr h2 { color: lightslategray !important; font-style: italic !important; } ._tab.fs20.c_sm._slide a._on { font-style: italic !important; } a._on[title="Library"], a._on[title="History"], a[title="Library"], a[title="History"] { color: #ddd !important; } a._on[title="Library"]:hover, a._on[title="History"]:hover, a[title="Library"]:hover, a[title="History"]:hover { filter: invert(25%); } .his-list li::before { filter: invert(85%); } .his-list h3.g_h3 { color: lightslategray !important; font-style: italic !important; } .his-list .g_score small { color: #aaa !important; } .his-list .pr a.db.fs16 { color: #ddd !important; font-style: italic !important; } `; } if (location.href.startsWith("https://www.webnovel.com/category/") || location.href.startsWith("https://webnovel.com/category/")) { css += ` /* Category Search Page */ .mb5.pt5.g_h3.g_h2row, .mb5.fs20.f_mbo.pt5.oh, .ell2row, h3.mb8 { color: lightslategray !important; font-style: italic !important; } .fs16.lh1d5.c_strong.oh._txt { color: #eee !important; } .fl.mr10 { color: lightslategray !important; } ._bd { background-color: #2a2a2a !important; } ._bd a._on svg { color: #ddd !important; } ._bd a { color: #eee !important; } ._bd a:hover { background-color: #272727 !important; } .lst-nav._tab.fs20.j_list_tab._slide a._on, .lst-nav._tab.fs20.j_list_tab._slide a:hover { color: #ddd !important; font-style: italic !important; } .lst-nav._tab.fs20.j_list_tab._slide a { color: #ddd !important; } .j_bookList .g_score small { color: #aaa !important; } `; } if (location.href.startsWith("https://www.webnovel.com/search") || location.href.startsWith("https://webnovel.com/search")) { css += ` /* Search Page */ #search[type="text"] { color: #ddd !important; } .ui-datalist-datalist, .ui-datalist-option.selected { background-color: #232323 !important; } .ui-datalist-option span a { color: #eee !important; } .ui-datalist-option:hover { background-color: #303030 !important; } .g_h3 a strong { color: lightslategray !important; font-style: italic !important; } .g_star small { color: #aaa !important; } .g_ells { color: #eee !important; font-style: italic !important; } .db.ell { background: #1a1a1a !important; } .ser-rec a { color: #aaa !important; } `; } if (location.href.startsWith("https://passport.webnovel.com")) { css += ` /* Login Page */ body { background-color: #1a1a1a !important; } .m-main { background-color: #232323 !important; } .m-hd-bg h1 { color: #eee !important; } .m-hd-bg p { color: #bbb !important; } .extra-txt { color: #aaa !important; } `; } if (location.href.startsWith("https://passport.webnovel.com/emaillogin")) { css += ` /* Login w/ Email Page */ .m-form-fieldset legend { color: #eee !important; } ._int[name="email"], ._int[name="password"] { color: #ddd !important; } .i-eye { background-color: #232323 !important; } .m-fix-bottom { color: #aaa !important; } `; } if (location.href.startsWith("https://www.webnovel.com/vote") || location.href.startsWith("https://webnovel.com/vote") || location.href.startsWith("https://www.webnovel.com/trailer") || location.href.startsWith("https://webnovel.com/trailer")) { css += ` /* Novel Voting Page */ h4 a.c_strong { color: lightslategray !important; font-style: italic !important; } .g_score small, .g_score span { color: #aaa !important; } ul.j_queue li { background-color: #232323 !important; } .g_col_4 a h4 { color: lightslategray !important; font-style: italic !important; } `; } if (location.href.startsWith("https://www.webnovel.com/ranking/power") || location.href.startsWith("https://webnovel.com/ranking/power")) { css += ` .banner-title { color: lightslategray !important; } .banner-sub-title { color: darkslategray !important; } ._item_link h4, ._link h4 { color: lightslategray !important; font-style: italic !important; } ._rank_num.f_serif { color: #eee !important; } .g_col_4, li.pr { background: #171717 !important; } .g_star_num small { background: #171717 !important; } `; } if (location.href.startsWith("https://www.webnovel.com/message") || location.href.startsWith("https://www.webnovel.com/notifications") || location.href.startsWith("https://webnovel.com/message") || location.href.startsWith("https://webnovel.com/notifications")) { css += ` .lst-nav a._on.j_messageTab, .lst-nav a._on.j_notificationTab { color: lightslategray !important; font-style: italic !important; } .lst-nav a.j_messageTab:hover, .lst-nav a.j_notificationTab:hover { color: #eee !important; } `; } if (location.href.startsWith("https://acts.webnovel.com") || location.href.startsWith("http://acts.webnovel.com")) { css += ` body { background-color: #1a1a1a !important; } .g_header { background-color: #232323 !important; border-bottom: 2px solid rgba(23,23,23) !important;; } .g_banner { border: none !important; } label[title="rule"] { color: #eee !important; } label[title="rule"]:hover { background-color: #303030 !important; color: #e1e1e1 !important; } .j_nav a { color: #aaa !important; } .cf.pane._on li a { background-color: #202020 !important; } .book-item h3 { color: lightslategray !important; font-style: italic !important; } .book-item .tal { color: #aaa !important; } .mod { background-color: #232323 !important; color: #e1e1e1 !important; } .mod .rule h3 { color: #efefef } `; } if (location.href.startsWith("https://www.webnovel.com/profile/") || location.href.startsWith("http://www.webnovel.com/profile/")) { css += ` .fl a, .pro-card-ft a span { color: #eee !important; } a[href="/settings"]:hover { text-decoration-color: #eee !important; } `; } if (location.href === "https://www.webnovel.com/badges" || location.href === "http://www.webnovel.com/badges") { css += ` #badgeMod .g_mod_hd { color: #eee !important; } #badgeMod .g_mod_bd { background-color: #1a1a1a !important; } `; } if (location.href === "https://www.webnovel.com/" || location.href === "http://www.webnovel.com/") { css += ` .hom-bd { background: #232323 !important; background: -webkit-linear-gradient(top,#232323,#232323) !important; background: linear-gradient(to bottom,#232323,#232323) !important; } `; } if (location.href === "https://www.webnovel.com/settings" || location.href === "http://www.webnovel.com/settings") { css += ` ._label { color: #eee !important; } #userName, textarea[name="sign"], .fc_sel, .fc_sel select { background: #232323 !important; border-color: #292929; color: #eee !important; } `; } if (location.href.startsWith("https://www.webnovel.com/book/") || location.href.startsWith("http://www.webnovel.com/book/")) { css += ` /* Shoulda really added this section a long time ago rip me */ ._type.db.ell.c_sm.ttc, .oh, .mb32 a { background: #1a1a1a !important; } .mb20.mt20.c_strong { color: #aaa !important; } .det-hd-detail strong svg, .mb12 span, .lh24 a, .lh24 { color: #aaa !important; } .mb48, .mb8, .mb4 { color: #eee !important; } `; } if (typeof GM_addStyle !== "undefined") { GM_addStyle(css); } else { const styleNode = document.createElement("style"); styleNode.appendChild(document.createTextNode(css)); (document.querySelector("head") || document.documentElement).appendChild(styleNode); } })();