☄️动漫之家增强☄️

动漫之家去广告🚫,对旧式漫画页进行增强:并排布局📖、高度自适应↕️、辅助翻页↔️、暗夜模式🌙

当前为 2021-02-02 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         ☄️动漫之家增强☄️
// @namespace    http://tampermonkey.net/
// @version      0.3
// @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('.ad_bottom_code{display:none !important;}')
    //去二维码
    GM_addStyle('.footer{display:none !important;}')
    GM_addStyle('.foot{display:none !important;}')
    GM_addStyle('.float_code{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;border:0px !important;padding:0px !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");
        }
    })
})();