动漫之家增强

动漫之家去广告,并排布局,高度自适应,辅助翻页,暗夜模式

目前為 2021-02-02 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         动漫之家增强
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  动漫之家去广告,并排布局,高度自适应,辅助翻页,暗夜模式
// @author       Byaidu
// @match        *.dmzj.com/*
// @require      https://code.jquery.com/jquery-1.12.4.min.js
// @grant        GM_addStyle
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';
    //去广告
    GM_addStyle('*[style*="2147"]{display:none !important;}')
    GM_addStyle('*[style*="hidden"]{display:none !important;}')
    //去二维码
    GM_addStyle('.footer{display:none !important;}')
    GM_addStyle('.foot{display:none !important;}')
    //漫画并页排布
    GM_addStyle('#center_box{justify-content:center;flex-direction: row-reverse;display: flex;flex-wrap: wrap;}')
    //漫画高度自适应
    GM_addStyle('#center_box img{height:100vh !important;}')
    //漫画上下间隔缩小
    GM_addStyle('.inner_img{margin-top:20px !important;}')
    //漫画页暗夜模式
    if(location.href.indexOf("shtml")>=0){
        GM_addStyle('*{background: rgb(25,25,25) !important;}')
    }
    //上下方向键滚动页面,左右方向键切换章节
    let img_id=0
    $("body").keydown(function(event) {
        if (event.keyCode == 38) {
             if (img_id>0) img_id-=2
             $("html,body").animate({scrollTop: $("#img_"+img_id).offset().top}, 1000);
        } else if (event.keyCode == 40) {
             img_id+=2
             $("html,body").animate({scrollTop: $("#img_"+img_id).offset().top}, 1000);
        } else if (event.keyCode == 37) {
             location.href = $("#prev_chapter").attr("href");
        } else if (event.keyCode == 39) {
             location.href = $("#next_chapter").attr("href");
        }
    })
})();