Greasy Fork

手机看图、小说适配

自动滚动,图片集合,页面旋转,字体放大,去除浮动广告,模拟点击

目前为 2023-12-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         手机看图、小说适配
// @namespace    http://tampermonkey.net/
// @version      9.500.8.92
// @description  自动滚动,图片集合,页面旋转,字体放大,去除浮动广告,模拟点击
// @author       You
// @match        *://*/*
// @require      https://cdn.bootcss.com/jquery/3.7.1/jquery.min.js
// @run-at       document-body
// @license      MIT
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);

(function($) {

    'use strict';

    if (document.querySelector('.JqMA-btn-all')) {
        return;
    }

    var DSImg = 1;

    function dqSlt(selectPath) {

        return $(document.querySelectorAll(selectPath)).add($(document.querySelectorAll('iframe')).contents().find(selectPath));

    }

    var winWidth = parseInt(dqSlt("html").width()),
        winProp = window.innerHeight / window.innerWidth,
        winHeight = parseInt(winWidth * winProp);
    if (winHeight < 400 || winWidth < 200) {
        winWidth = 393;
        winHeight = 767;
        winProp = 767 / 393;
    }

    var winW = winWidth > winHeight ? winHeight * 0.9 : winWidth;

    var wHeight = winW * 0.1;

    var SPicH = winWidth * 0.12;

    var top = (winHeight - wHeight) * 0.5;

    var Jq_style = `html{
            overflow-y: visible !important;
        }
        html,body {
            overflow-wrap: break-word !important;
            scroll-behavior: auto !important;
            filter: none !important;
            min-height: ${winHeight}px !important;
        }
        .JqMA-css-yScroll{
            overflow-y: scroll!important;
        }
        .JqMA-css-xScroll{
            overflow-x: scroll!important;
        }
        .JqMA-css-hide{
            display: none !important;
        }
        .JqMA-css-fixed {
            position: fixed !important;
        }
        .JqMA-inner-transform {
            transform: translate(0%, 0%) !important;
            padding-top:${1.5 * winHeight}px !important;
            padding-bottom:${winHeight * winProp - 0.6 * winWidth}px !important;
        }
        #JqMA-inner-pic,
        #JqMA-inner-pic img {
            min-width: auto !important;
            max-width: auto !important;
            border: 0 !important;
        }
        .JqMA-inner-rotate {
            float: right !important;
            position: relative !important;
            left: -100% !important;

            padding-bottom:${winHeight * winProp - 0.6 * winWidth}px !important;

            transform: rotateZ(-90deg) !important;
            transform-origin: 100% 0 !important;
            -webkit-transform: rotateZ(-90deg) !important;
            -webkit-transform-origin: 100% 0 !important;
            -moz-transform: rotateZ(-90deg) !important;
            -moz-transform-origin: 100% 0 !important;

            width: ${winHeight}px !important;
        }
        #JqMA-inner-pic,
        #JqMA-inner-pic *:not(.JqMA-mark-pageNext) {
            box-sizing: border-box !important;
            margin: 0 !important;
            border-radius: 0 !important;
            float: none !important;
            opacity: 1 !important;
            visibility: visible !important;
            filter: none !important;
            max-height: auto !important;
        }
        #JqMA-inner-pic {
            width: 100% !important;
            height: auto !important;
            overflow: visible !important;
            text-align: left !important;
            display: block !important;
            position: relative !important;
            z-index: 2147483646 !important;
            font: 0 "Fira Sans", sans-serif !important;
            background: black !important;
            padding: ${0.2 * winHeight}px 0 ${0.5 * winHeight}px 0 !important;
        }
        #JqMA-inner-pic *{
            padding: 0 !important;
            position: static !important;
        }
        #JqMA-inner-pic *::before,
        #JqMA-inner-pic *::after {
            display: none !important;
        }
        #JqMA-inner-pic picture,
        #JqMA-inner-pic img {
            display: inline-block;
            width: 100%;
            height: auto;
            object-fit: contain !important;
            min-height: auto !important;
            background: gray !important;
        }
        #JqMA-inner-pic xmp,
        #JqMA-inner-pic a {
            color: #F2F2F2;
            background: black !important;
            vertical-align: top !important;
            overflow-wrap: break-word !important;
            min-height: auto !important;
            height: ${SPicH}px !important;
            overflow: hidden !important;
            font-size: ${winW * 0.045}px !important;
            cursor: pointer !important;
        }
        #JqMA-inner-pic a:visited {
            color: #741274 !important;
        }
        .JqMA-css-smallPic {
            width: 12% !important;
            height: ${SPicH}px !important;
        }
        #JqMA-inner-pic xmp {
            display: none;
            white-space: pre-wrap !important;
            white-space: -moz-pre-wrap !important;
            white-space: -pre-wrap !important;
            white-space: -o-pre-wrap !important;
            word-wrap: break-word !important;
            text-align: left !important;
            border: 0 !important;
            line-height: 1.3 !important;
            width: auto !important;
            min-width: 52% !important;
            max-width: 76% !important;
        }
        #JqMA-inner-pic a{
            display: inline-block;
            line-height: normal !important;
            width: 12% !important;
            min-width: auto !important;
            max-width: auto !important;
            text-align: center !important;
            text-decoration: none !important;
            border: ${0.002 * winW}px solid red !important;
        }
        .JqMA-btn-all {
            color: white;
            text-align: center !important;
            line-height: 2.8 !important;
            border-radius: 0 !important;
            cursor: pointer !important;
            z-index: 2147483647 !important;
            padding: 0 !important;
            border: 0 !important;
            font-weight: bold !important;
            filter: none !important;
            position: fixed !important;
            font-size: ${winW * 0.036}px !important;
            height: ${wHeight}px !important;
            max-height: auto !important;
            min-height: auto !important;
            width: ${wHeight}px !important;
            max-width: auto !important;
            min-width: auto !important;
        }
        .JqMA-mark-pageNext,
        .pagetual_pageBar {
            display: block !important;
            height: 0 !important;
            min-height: auto !important;
            margin: 0 !important;
            border: 0 !important;
            padding: 0 !important;
            overflow: hidden !important;
        }
        .JqMA-css-textBig {
            text-align: left !important;
            text-indent:2em !important;
            letter-spacing: normal !important;
            line-height: normal !important;
            filter: none !important;
            overflow-wrap: break-word !important;
        }
        .JqMA-css-textBig:not(a,a *) {
            color: #F2F2F2 !important;
            background-color: black !important;
        }`;

    var jianG = wHeight;

    var left = 0;

    var left2 = wHeight + left;

    var left3 = wHeight + left2;

    var sameCss = "left:" + left + "px;";
    var sameCss2 = "left:" + left2 + "px;";
    var sameCss3 = "left:" + left3 + "px;";

    var scrollNum = parseInt(winW * 0.2);

    var animateTime = 2000;

    var scrollJu = 4;

    var picwh = 50;

    function addInput(id1, value1, style1, class1 = "") {
        var input_node = $('<div>').attr({
            class: "JqMA-btn-all" + " " + class1,
            id: id1,
            style: style1 + ";background:black !important;"
        }).html(value1);
        dqSlt("html").first().append(input_node);
    }

    addInput('JqMA-btn-del', 'X', sameCss + "top:" + (top) + "px");
    addInput('JqMA-btn-width', 'W', sameCss + "top:" + (top - 1 * jianG) + "px");
    addInput('JqMA-btn-pic', 'P', sameCss + "top:" + (top - 2 * jianG) + "px");
    addInput('JqMA-btn-rotate', 'R', sameCss + "top:" + (top - 3 * jianG) + "px");
    addInput('JqMA-btn-down', '▽', sameCss + "top:" + (top - 4 * jianG) + "px");
    addInput('JqMA-btn-up', '△', sameCss + "top:" + (top - 5 * jianG) + "px");
    addInput('JqMA-btn-DS', "S", sameCss + "top:" + (top - 6 * jianG) + "px");
    addInput('JqMA-btn-scrollPH', "O", sameCss + "top:" + (top - 7 * jianG) + "px");
    addInput('JqMA-btn-transform', "T", sameCss + "top:" + (top + jianG) + "px");
    addInput('JqMA-btn-jia', '+', sameCss + "top:" + (top + 2 * jianG) + "px");
    addInput('JqMA-btn-jian', '-', sameCss + "top:" + (top + 3 * jianG) + "px");
    addInput('JqMA-btn-next', "N", sameCss + "top:" + (top + 4 * jianG) + "px");
    addInput('JqMA-btn-picwh', picwh, sameCss + "top:" + (top + 5 * jianG) + "px", "JqMA-css-hide");

    addInput('JqMA-btn-Ju', scrollJu, sameCss2 + "top:" + (top) + "px");

    setTimeout(function() {

        delHide();

        dqSlt("body").filter(function() {
            return $(this).css("overflow-y") == "hidden";
        }).addClass("JqMA-css-yScroll");

        checkIframe();

        var iframeNum = 0;

        setInterval(function() {

            var newIfrNum = dqSlt("*").length;

            if (iframeNum < newIfrNum) {

                iframeNum = newIfrNum;

                checkIframe();
            }

        }, 2 * 1000);

    }, 10);

    function checkIframe() {

        dqSlt('body').first().append(
            dqSlt("html").first().children(":not(head,body,.JqMA-btn-all,#pagetual-picker)")
        );

        dqSlt("head:not(.JqMA-mark-addStyle)").addClass("JqMA-mark-addStyle").append(
            $("<style>").attr({
                type: 'text/css'
            }).html(Jq_style)
        );

        dqSlt("html").off("click.clickScroll").on('click.clickScroll', function(event) {

            var _target = $(event.target);

            if (_target.is("a,a *")) {
                return;
            }

            if (_target.is(".JqMA-css-textBig,.JqMA-css-textBig *,:has(.JqMA-css-textBig)")) {

                autoScrollBy((xMove == 1 ? winWidth : winHeight) - parseInt(fSize) * 1.4);

            } else if (_target.is("img,:has(img,picture),#JqMA-inner-pic *")) {

                if (_target.is("img:not(#JqMA-inner-pic *)") &&
                    _target[0].naturalWidth && !picSizeOut(_target[0], 50)) {
                    return;
                }

                autoScrollBy(0.4 * (xMove == 1 ? winWidth : winHeight));
            }
        });

        dqSlt("html").off("touchstart.stopPause").on("touchstart.stopPause", ":not(.JqMA-btn-move)", function() {

            if (Dscroll % 2 != 0) {

                dqSlt("#JqMA-btn-Ju").trigger("click");

                pauseScroll = 1;
            }
        }).off("touchend.stopPause").on("touchend.stopPause", function() {

            stopPause();
        });
    }

    var scrollPH = 0;

    dqSlt("html").on('click', '#JqMA-btn-scrollPH', function() {
        scrollPH += 1;
        if (scrollPH % 2 != 0) {
            dqSlt("#JqMA-btn-scrollPH").css("color", "green");

        } else {
            dqSlt("#JqMA-btn-scrollPH").css("color", "white");
        }
    });

    dqSlt("html").on('click', '#JqMA-btn-next', function() {

        var pageDom;

        if (picZ > 0) {
            pageDom = dqSlt(".JqMA-mark-pageNext");
        } else {
            pageDom = dqSlt(".pagetual_pageBar");
        }

        var _len = pageDom.length;

        pageDom.each(function(index, dom) {

            var offsetDiff = -0.5 * (xMove == 1 ? winWidth : winHeight);

            if (xMove == 1) {
                offsetDiff += $(this).offset().left - $(window).scrollLeft();

            } else {
                offsetDiff += $(this).offset().top - $(window).scrollTop();

            }

            if (offsetDiff > 1) {

                autoScrollBy(offsetDiff);

                dqSlt("#JqMA-btn-next").html(index + 2);

                return false;
            }
            if (index == _len - 1) {
                _len = 0;
            }
        });
        if (_len == 0) {
            var ul_height = dqSlt("#JqMA-inner-pic").height() + dqSlt("#JqMA-inner-pic").offset().top;
            autoScrollTo(ul_height);
        }
    });

    var Dtransform = 0;

    dqSlt("html").on('click', '#JqMA-btn-transform', function() {

        Dtransform += 1;

        if (Dtransform % 2 != 0) {

            dqSlt("body").addClass("JqMA-inner-transform");

            dqSlt(":not(head *,.JqMA-btn-all,#pagetual-picker)").filter(function() {
                return /sticky/.test($(this).css("position"));
            }).addClass("JqMA-css-fixed");

            autoScrollBy(1.5 * winHeight);

            dqSlt("#JqMA-btn-transform").css("color", "green");

        } else {

            dqSlt(".JqMA-inner-transform").removeClass("JqMA-inner-transform");

            dqSlt(".JqMA-css-fixed").removeClass("JqMA-css-fixed");

            autoScrollBy(-1.5 * winHeight);

            dqSlt("#JqMA-btn-transform").css("color", "white");
        }
    });

    dqSlt("#JqMA-btn-DS").css("color", "green");

    dqSlt("html").on('click', '#JqMA-btn-DS', function() {

        DSImg += 1;
        if (DSImg == 2) {
            DSImg = 0;
            dqSlt("#JqMA-btn-DS").css("color", "white");
        } else {
            dqSlt("#JqMA-btn-DS").css("color", "green");
        }
        if (picZ > 0) {
            picZ -= 1;
            dqSlt("#JqMA-btn-pic").trigger("click");
        }
    });

    var Drotate = 0;
    var xMove = 0;

    dqSlt("html").on('click', '#JqMA-btn-rotate', function() {

        Drotate += 1;

        if (Drotate % 2 != 0) {

            var _scrollTop = getScrollTop();

            dqSlt("#JqMA-btn-rotate").css("color", "green");

            dqSlt("html,body,div").filter(function() {
                return $(this).css("overflow-y") != "hidden" &&
                    $(this).css("overflow-x") == "hidden" &&
                    $(this).height() > 0.5 * winHeight;
            }).addClass("JqMA-css-xScroll");

            autoScrollTo(0);

            setTimeout(function() {

                dqSlt('body').addClass("JqMA-inner-rotate");

                xMove = 1;

                autoScrollTo(_scrollTop * winProp);

                dqSlt('.JqMA-btn-all').each(function() {
                    var _this = $(this);

                    var _clone = _this.clone().removeAttr("id").addClass("JqMA-btn-left")
                        .css('margin-left', (winHeight * winProp - winWidth * 0.8) + "px");

                    _clone.on("scroll", function() {
                        $(this).html(_this.html()).css("color", _this.css("color"));
                    }).on("click", function() {
                        _this.trigger("click");
                        dqSlt(".JqMA-btn-all").trigger("scroll");
                    }).appendTo(dqSlt("html").first());
                });

            }, 100);

        } else {

            var _scrollLeft = getScrollLeft();

            dqSlt("#JqMA-btn-rotate").css("color", "white");

            autoScrollTo(0);

            setTimeout(function() {

                dqSlt(".JqMA-inner-rotate").removeClass("JqMA-inner-rotate");

                xMove = 0;

                autoScrollTo(_scrollLeft / winProp);

                dqSlt(".JqMA-btn-left").remove();

            }, 100);
        }
    });

    function getScrollLeft() {
        return dqSlt("html").scrollLeft() + dqSlt("body").scrollLeft();

    }

    function getScrollTop() {
        return dqSlt("html").scrollTop() + dqSlt("body").scrollTop();

    }

    var pauseScroll = 0;
    var Dpause;

    dqSlt("#JqMA-btn-Ju,#JqMA-btn-down,#JqMA-btn-up").addClass("JqMA-btn-move");

    dqSlt("html").on('click', "a,#JqMA-btn-down,#JqMA-btn-up", function() {

        if (Dscroll % 2 != 0) {
            dqSlt("#JqMA-btn-Ju").trigger("click");
        }
        setTimeout(function() {
            if (Dscroll % 2 != 0) {
                dqSlt("#JqMA-btn-Ju").trigger("click");
            }
        }, 300);
    });

    function stopPause() {

        if (pauseScroll == 1) {

            clearTimeout(Dpause);

            Dpause = setTimeout(function() {

                pauseScroll = 0;

                if (Dscroll % 2 == 0) {

                    dqSlt("#JqMA-btn-Ju").trigger("click");
                }
            }, 200);
        }
    }

    $(document).scroll(function() {

        stopPause();
    });

    function visibleDiv() {
        return dqSlt("div").filter(function() {

            return $(this).css("overflow-y") != "hidden" &&
                $(this).height() > 0.5 * winHeight;
        });
    }

    function autoScrollBy(scrollBy_Ju, speed = 0) {

        if (scrollPH % 2 == 0) {

            if (xMove == 1) {

                dqSlt("html,body").stop().animate({
                    scrollLeft: "+=" + scrollBy_Ju + "px"
                }, speed, "linear");

            } else {

                dqSlt("html,body").stop().animate({
                    scrollTop: "+=" + scrollBy_Ju + "px"
                }, speed, "linear");
            }
        } else {

            visibleDiv().stop().animate({
                scrollTop: "+=" + scrollBy_Ju + "px"
            }, speed, "linear");
        }
    }

    function autoScrollTo(scrollTo_Ju, speed = 0) {

        if (scrollPH % 2 == 0) {

            if (xMove == 1) {

                dqSlt("html,body").stop().animate({
                    scrollLeft: scrollTo_Ju
                }, speed, "linear");

            } else {

                dqSlt("html,body").stop().animate({
                    scrollTop: scrollTo_Ju
                }, speed, "linear");
            }
        } else {

            visibleDiv().stop().animate({
                scrollTop: scrollTo_Ju
            }, speed, "linear");
        }
    }

    var timeout_4;

    dqSlt("html").on('touchstart', '#JqMA-btn-width', function() {
        timeout_4 = setTimeout(function() {

            if (document.querySelector("#JqMA-allStrWord")) {

                dqSlt("#JqMA-allStrWord").remove();
                dqSlt('#JqMA-btn-aWord').css("color", "white");
            } else {

                var allStr = "";

                dqSlt(":not(style,script,noscript)").each(function() {

                    var addStr = $(this).clone().children().remove().end().text().replace(/\s+/g, " ");

                    if (addStr.replace(/[^一-鿯0-9]/g, "").length > 6) {
                        allStr += "<br><br>";
                    }
                    allStr += addStr + " ";
                });

                dqSlt("body").first().prepend($("<div>").attr({
                    id: "JqMA-allStrWord",
                }).html(allStr));

                dqSlt('#JqMA-btn-aWord').css("color", "green");
            }

        }, 500);
    }).on('touchend', '#JqMA-btn-width', function() {
        clearTimeout(timeout_4);
    });

    var widthN = 13;
    var fontZ, fSize;

    dqSlt("html").on('click', '#JqMA-btn-width', function() {

        function interFn() {

            dqSlt(":not(.JqMA-css-textBig,#JqMA-inner-pic,#JqMA-inner-pic *,.JqMA-btn-all,#pagetual-picker *)").filter(function() {

                return $(this).clone().children().remove().end().text()
                    .replace(/[0-9\s]+/g, "").length > 0;

            }).addClass("JqMA-css-textBig");

            var textBig = $(dqSlt(".JqMA-css-textBig"));

            textBig.css(wordCss);

            var _scale = fSize != "inherit" ? parseInt(fSize / 23 * 100) / 100 : 1;

            var DShadow = "grayscale(100%) contrast(200%) brightness(1000%)";

            textBig.children("em:not(.JqMA-css-textBig),img").filter(function() {
                return $(this).outerWidth() < 0.1 * winW && $(this).outerHeight() < 0.1 * winW;
            }).css({

                "transform": "scale(" + _scale + ")",
                "-webkit-transform": "scale(" + _scale + ")",
                "-moz-transform": "scale(" + _scale + ")",

                "margin": "0 " + (_scale * 9 - 9) + "px",

                "filter": DShadow,
                "-webkit-filter": DShadow,
                "-moz-filter": DShadow,

            });

            if (fSize == "inherit") {
                textBig.removeClass("JqMA-css-textBig");
            }
        }

        fSize = widthN > 13 + 3 ? "inherit" : parseInt(winWidth / widthN);

        var wordCss = {
            "font-size": fSize
        };

        clearInterval(fontZ);
        interFn();

        if (fSize != "inherit") {

            var fontNum = 0;

            fontZ = setInterval(function() {

                var newFotNum = dqSlt("*").length;

                if (fontNum < newFotNum) {

                    fontNum = newFotNum;

                    interFn();
                }

            }, 2 * 1000);

            dqSlt("#JqMA-btn-width").html(20 - widthN).css("color", "green");

        } else {
            dqSlt("#JqMA-btn-width").html("W").css("color", "white");
            widthN -= 3 * 3;
        }

        widthN += 3;

    });

    function picSizeOut(_this, picwh_2 = null) {

        var natureW = _this.naturalWidth;

        var natureH = _this.naturalHeight;

        if (!picwh_2) {
            picwh_2 = picwh;
        }

        return natureW >= picwh_2 && natureH >= picwh_2 &&
            natureW / natureH <= 6;

    }

    dqSlt("html").on('click', "#JqMA-btn-picwh", function() {

        dqSlt(".JqMA-btn-all").hide();

        var _outStop = setTimeout(function() {

            $(document).off("click.picwh");

            dqSlt(".JqMA-btn-all").show();
        }, 3000);

        setTimeout(function() {

            $(document).on("click.picwh", function(event) {

                var _target = $(event.target);

                $(document).off("click.picwh");

                dqSlt(".JqMA-btn-all").show();

                clearTimeout(_outStop);

                if (_target.is("#JqMA-inner-pic .JqMA-mark-imgLoaded")) {

                    if (_target[0].naturalWidth < _target[0].naturalHeight) {

                        picwh = _target[0].naturalWidth + 1;
                    } else {
                        picwh = _target[0].naturalHeight + 1;
                    }
                    if (picwh < 50) {

                        picwh = 50;
                    }
                } else {
                    picwh = 50;
                }

                if (picZ == 1) {

                    dqSlt("#JqMA-inner-pic br").hide();

                    dqSlt("#JqMA-inner-pic xmp").hide();

                    dqSlt("#JqMA-inner-pic .JqMA-mark-imgLoaded").filter(function() {
                        return picSizeOut(this);
                    }).each(function() {

                        $(this).closest("#JqMA-inner-pic > *")
                            .nextAll("br").slice(0, 9).show();

                        $(this).closest("#JqMA-inner-pic > *")
                            .nextAll("xmp").slice(0, 9).css("display", "inline-block");

                    }).removeClass("JqMA-css-smallPic").closest("picture").removeClass("JqMA-css-smallPic");

                    dqSlt("#JqMA-inner-pic .JqMA-mark-imgLoaded").filter(function() {
                        return !picSizeOut(this);
                    }).addClass("JqMA-css-smallPic").closest("picture").addClass("JqMA-css-smallPic");

                } else {

                    dqSlt("#JqMA-inner-pic .JqMA-mark-imgLoaded").filter(function() {
                        return picSizeOut(this);
                    }).show().closest("picture").show();

                    dqSlt("#JqMA-inner-pic .JqMA-mark-imgLoaded").filter(function() {
                        return !picSizeOut(this);
                    }).hide().closest("picture").hide();
                }

                dqSlt("#JqMA-btn-picwh").html(picwh);

            });
        }, 100);

    });

    var timeout_1;

    dqSlt("html").on('touchstart', '#JqMA-btn-pic', function() {
        timeout_1 = setTimeout(function() {

            if (picZ > 0) {
                picZ -= 1;
                dqSlt("#JqMA-btn-pic").trigger("click");
            }

        }, 500);
    }).on('touchend', '#JqMA-btn-pic', function() {
        clearTimeout(timeout_1);
    });

    var widthZ,
        picZ = 0;

    dqSlt("html").on('click', "#JqMA-btn-pic", function() {
        getImgArr();
    });

    function getImgArr() {

        function interFn() {

            var newImgArr = [];

            var _text = dqSlt("html").clone().find("head,style,script,noscript").remove().end().text()
                .match(/http.*?[.](xbm|tif|pjp|svgz|jpg|jpeg|ico|tiff|gif|svg|jfif|webp|png|bmp|pjpeg|avif)/g);

            function testHref(_href) {
                return !/^javascript:|^#($|[A-Za-z_][A-Za-z0-9_]*$)/.test(_href.trim());
            }

            if (picZ == 1) {

                dqSlt("a").filter(function() {
                    return $(this).attr("href") && testHref($(this).attr("href")) && !/_blank/.test($(this).attr("target"));
                }).attr({
                    target: "_blank",
                    rel: "noopener noreferrer"
                }).addClass("JqMA-mark-aNewPage");
            }

            dqSlt(":not(html,.JqMA-mark-imgSelected,picture *,#JqMA-inner-pic *)").filter(function() {

                var _img = $(this);
                return _img.is("a,img,:has(img),.pagetual_pageBar") || _img.css("background-image").split(/[""'']/).length > 1;

            }).each(function(inum, dom) {

                var dataObj = [],
                    _img = $(this);

                _img.addClass("JqMA-mark-imgSelected");

                if (_img.is(".pagetual_pageBar")) {

                    newImgArr.push($("<div>").attr({
                        class: "JqMA-mark-pageNext"
                    }));
                    return true;
                }

                if (picZ == 2 && inum == 0 && _text) {
                    dataObj = dataObj.concat(_text);
                }

                var _picStr = null;

                if (_img.is("picture")) {

                    _picStr = $("<picture>");

                    var _picChild;

                    _img.children().each(function() {

                        if ($(this).is("img")) {
                            _picChild = $("<img>").attr({
                                width: "300",
                                height: "100"
                            });
                        } else {
                            _picChild = $("<source>");
                        }
                        _picStr.append(_picChild.attr({
                            alt: $(this).attr("alt") ? "JU-IMG" : null,
                            src: $(this).attr("src") ? $(this).attr("src") : null,
                            srcset: $(this).attr("srcset") ? $(this).attr("srcset") : null,
                            media: $(this).attr("media") ? $(this).attr("media") : null,
                            type: $(this).attr("type") ? $(this).attr("type") : null,
                        }));

                        preImgArr.push($(this).attr("srcset") ? $(this).attr("srcset") :
                            $(this).attr("src") ? $(this).attr("src") : null);
                    });

                    _picStr = _picStr.prop("outerHTML");

                    if (preImgArr.indexOf(_picStr) == -1) {

                        preImgArr.push(_picStr);

                        newImgArr.push(_picStr);
                    } else {
                        _picStr = null;
                    }
                }

                var _backImg = _img.css("background-image").split(/[""'']/);

                dataObj.push(
                    _img.attr("src") ? _img.attr("src") : null,
                    _backImg.length > 1 ? _backImg[1] : null
                );

                if (DSImg != 0) {

                    var _attributes = [],
                        _data = Object.values(_img.data());

                    _attributes.push(_img[0].attributes);

                    if (_img.is("picture")) {

                        _img.children().each(function() {

                            _attributes.push($(this)[0].attributes);

                            _data = _data.concat(Object.values($(this).data()));
                        });
                    }

                    _attributes.forEach(function(attrs) {

                        $.each(attrs, function(index, item) {

                            if (!/^(src|style|srcset|class|id|type|href|onclick)$|^data-|^:/.test(item.name)) {

                                _data.push(item.value);
                            }
                        });
                    });

                    _data.forEach(function(i) {

                        if (typeof i == "object") {

                            try {
                                i = JSON.stringify(i);

                            } catch (error) {

                                return;
                            }
                        } else if (typeof i != "string") {

                            return;
                        }

                        if (/[""'']/.test(i)) {

                            var _isp = i.split(/[""'']/).filter(function(j) {

                                return j.length > 9 && /^http/.test(j.trim());
                            });
                            dataObj = dataObj.concat(_isp);

                        } else if (/%22%2C%22/.test(i)) {

                            var _isp = i.split(/%22/).filter(function(j) {

                                return j.length > 9 && /^http/.test(j.trim());

                            });
                            dataObj = dataObj.concat(_isp);

                        } else {
                            dataObj.push(i);
                        }
                    });
                }

                dataObj = Array.from(new Set(dataObj));

                var _imgStr = null;

                dataObj.forEach(function(i) {

                    if (typeof i != "string") {

                        return
                    }

                    i = i.trim();

                    try {
                        i = decodeURIComponent(i);
                        i = decodeURI(i);
                        i = unescape(i);
                    } catch (error) {
                        console.log(error);
                    }

                    if (/^data:image/.test(i)) {
                        i = i.replace(/[^A-Za-z0-9+/=>;]{0,9}$/, "");
                    }

                    if (/^[a-z/]/.test(i) && /[?/]/.test(i) &&
                        !/[.](txt|shtml|html|htm)$/.test(i) &&
                        preImgArr.indexOf(i) == -1) {

                        preImgArr.push(i);

                        _imgStr = $("<img>").attr({
                            src: i,
                            loading: "lazy",
                            alt: "JU-IMG",
                            width: "300",
                            height: "100",
                            srcset: _img.attr("srcset") ? _img.attr("srcset") : null
                        }).prop("outerHTML");

                        newImgArr.push(_imgStr);
                    }
                });

                if (_imgStr || _picStr) {

                    var _a = _img.find("a").first();

                    if (_a.length == 0) {

                        _a = _img.closest("a");
                    }

                    var _img_2 = _img;

                    for (var i = 0; i < 9; i++) {

                        if (_a.length > 0 || _img_2.is("body")) {

                            break;
                        } else {

                            _a = _img_2.siblings("a").first();

                            if (_a.length == 0) {

                                _a = _img_2.siblings().find("a").first();
                            }

                            _img_2 = _img_2.parent();
                        }
                    }

                    var _newA = $("<a>").html("IMG");

                    _newA.on("click", function() {
                        _img.trigger("click");
                    });

                    function returnLength(lStr) {
                        return lStr.replace(/[0-9\s]+/g, "").replace(/[一-龟]/g, "aa").length > 9;
                    }

                    var _imgText = _img.clone().find("style,script,noscript").remove().end().text();

                    var _pStr = (_img.attr("alt") && returnLength(_img.attr("alt")) ? _img.attr("alt") :
                        _img.attr("title") ? _img.attr("title") :
                        returnLength(_imgText) ? _imgText :
                        "");

                    if (_a.length > 0) {

                        var _a_2 = _a;

                        for (var i = 0; i < 9; i++) {

                            if (_pStr != "" || _a_2.is("body")) {

                                break
                            } else {

                                _imgText = _a_2.clone().find("style,script,noscript").remove().end().text();

                                _pStr = (_a_2.attr("title") ? _a_2.attr("title") :
                                    returnLength(_imgText) ? _imgText :
                                    "");

                                _a_2 = _a_2.parent();
                            }
                        }

                        _newA.on("click", function() {
                            _a.trigger("click");
                        });

                        var _aHref = _a.attr("href");

                        if (_aHref) {

                            if (_img.is("a") || _img.closest("a").length == 0) {

                                _newA.attr({
                                    href: _aHref
                                });
                            }

                            if (testHref(_aHref)) {

                                _newA.attr({
                                    target: "_blank",
                                    rel: "noopener noreferrer"
                                });
                            }

                            var hrefImg = _aHref.match(/http.*?[.](xbm|tif|pjp|svgz|jpg|jpeg|ico|tiff|gif|svg|jfif|webp|png|bmp|pjpeg|avif)/g);

                            if (DSImg != 0 && hrefImg) {

                                hrefImg = hrefImg[0];

                                try {
                                    hrefImg = decodeURIComponent(hrefImg);
                                    hrefImg = decodeURI(hrefImg);
                                    hrefImg = unescape(hrefImg);
                                } catch (error) {
                                    console.log(error);
                                }

                                if (preImgArr.indexOf(hrefImg) == -1) {

                                    preImgArr.push(hrefImg);

                                    _imgStr = $("<img>").attr({
                                        src: hrefImg,
                                        loading: "lazy",
                                        alt: "JU-IMG",
                                        width: "300",
                                        height: "100",
                                        srcset: _img.attr("srcset") ? _img.attr("srcset") : null
                                    }).prop("outerHTML");

                                    newImgArr.push(_imgStr);
                                }
                            }
                        }
                    }

                    newImgArr.push(_newA,
                        $("<xmp>").html(_pStr.trim().replace(/\s+/g, " ").substring(0, 99)));
                }
            });

            newImgArr = Array.from(new Set(newImgArr));

            if (newImgArr.toString() != imgArr.toString()) {

                var newArrEx = newImgArr.filter(function(n) {
                    return imgArr.indexOf(n) == -1;
                });

                imgArr = imgArr.concat(newArrEx);

                dqSlt("#JqMA-inner-pic").append(newArrEx);

                dqSlt("#JqMA-inner-pic img").off("error.imgError").on("error.imgError", function() {

                    if ($(this).attr("src").indexOf("=http") > -1) {

                        $(this).attr("src", $(this).attr("src").replace(/(?<==http.*?)&.*$/, "").replace(/^.*=(?=http)/, ""));
                    }

                    if (picZ == 1 && !/^data:image/.test($(this).attr("src").trim())) {

                        $(this).addClass("JqMA-css-smallPic").closest("picture").addClass("JqMA-css-smallPic");
                    } else {
                        $(this).hide().closest("picture").hide();
                    }
                });

                dqSlt("#JqMA-inner-pic img:not(.JqMA-mark-imgLoaded)").on("load", function() {

                    $(this).addClass("JqMA-mark-imgLoaded");

                    if (picZ == 1 && picSizeOut(this, 50)) {

                        $(this).closest("#JqMA-inner-pic > *")
                            .nextAll("a").slice(0, 9).not("br + a").before("<br>");

                    }

                    if (picSizeOut(this)) {

                        if (picZ == 1) {
                            $(this).removeClass("JqMA-css-smallPic").closest("picture").removeClass("JqMA-css-smallPic");

                            $(this).closest("#JqMA-inner-pic > *")
                                .nextAll("br").slice(0, 9).show();

                            $(this).closest("#JqMA-inner-pic > *")
                                .nextAll("xmp").slice(0, 9).css("display", "inline-block");

                        } else {
                            $(this).show().closest("picture").show();
                        }

                    } else {

                        if (picZ == 1) {
                            $(this).addClass("JqMA-css-smallPic").closest("picture").addClass("JqMA-css-smallPic");
                        } else {
                            $(this).hide().closest("picture").hide();
                        }
                    }
                });
            }
            if (picZ == 2) {
                dqSlt("#JqMA-inner-pic > *:not(img,picture)").hide();
            }
        }

        clearInterval(widthZ);

        dqSlt("#JqMA-inner-pic").remove();

        dqSlt(".JqMA-mark-imgSelected").removeClass("JqMA-mark-imgSelected");

        dqSlt(".JqMA-mark-aNewPage").removeClass("JqMA-mark-aNewPage").removeAttr("target rel");

        picZ += 1;

        if (picZ < 3) {

            dqSlt("body").first().prepend("<div id='JqMA-inner-pic'>");

            dqSlt("#JqMA-btn-picwh").removeClass("JqMA-css-hide");

            picwh = 50;

            var imgArr = [],
                preImgArr = [];

            dqSlt("#JqMA-btn-picwh").html(picwh);

            dqSlt("#JqMA-btn-pic").css("color", "green").html(picZ);

            interFn();

            var picNum = 0;

            widthZ = setInterval(function() {

                var newPicNum = dqSlt("*").length;

                if (picNum < newPicNum) {

                    picNum = newPicNum;

                    interFn();
                }
            }, 2 * 1000);

        } else {

            dqSlt("#JqMA-btn-picwh").addClass("JqMA-css-hide");

            dqSlt("#JqMA-btn-pic").css("color", "white").html("P");

            picZ = 0;
        }
    }

    var Dxy = 0;
    var pageX;
    var pageY;
    var timeHu;

    dqSlt("html").on('click', '#JqMA-btn-down', function() {

        Dxy += 1;

        clearTimeout(timeHu);

        if (Dxy % 2 == 1) {

            pageX = getScrollLeft();

            pageY = getScrollTop();

            if (Dtransform % 2 != 0) {
                dqSlt("#JqMA-btn-transform").trigger("click");
                setTimeout(function() {
                    dqSlt("#JqMA-btn-transform").trigger("click");
                }, 100);
            }

            var toH_2 = -(xMove == 1 ? winWidth : winHeight);

            var toH = toH_2;

            if (scrollPH % 2 == 0) {

                dqSlt("body > *").each(function() {
                    toH += $(this).outerHeight();
                });

                var _wrapHeight = toH_2 + dqSlt("body").height();

                if (_wrapHeight < toH && _wrapHeight > toH - 2 * winHeight) {
                    toH = _wrapHeight;
                }
            } else {
                toH = 1000 * winHeight;
            }

            if (toH < toH_2 + 2 * winHeight) {
                toH = 1000 * winHeight;
            }

            autoScrollTo(toH);

            dqSlt("#JqMA-btn-down").html("=");
            dqSlt("#JqMA-btn-up").html("=");

            timeHu = setTimeout(function() {
                Dxy += 1;
                dqSlt("#JqMA-btn-up").html("△");
                dqSlt("#JqMA-btn-down").html("▽");

            }, scrollPH % 2 == 0 ? 15 * 1000 : 0);

        } else {
            autoScrollTo(xMove == 1 ? pageX : pageY);

            setTimeout(function() {

                if (picZ > 0) {
                    dqSlt(".JqMA-mark-imgSelected").removeClass("JqMA-mark-imgSelected");
                }
            }, 200);

            dqSlt("#JqMA-btn-up").html("△");
            dqSlt("#JqMA-btn-down").html("▽");

        }
    });

    var timeout_6;
    dqSlt("html").on('touchstart', '#JqMA-btn-down,#JqMA-btn-up', function() {
        timeout_6 = setTimeout(function() {

            if (Dxy % 2 == 1) {
                Dxy = 0;
                dqSlt("#JqMA-btn-up").html("△");
                dqSlt("#JqMA-btn-down").html("▽");
            }

        }, 600);
    }).on('touchend', '#JqMA-btn-down,#JqMA-btn-up', function() {
        clearTimeout(timeout_6);
    });

    dqSlt("html").on('click', '#JqMA-btn-up', function() {

        Dxy += 1;

        clearTimeout(timeHu);

        if (Dxy % 2 == 1) {

            pageX = getScrollLeft();

            pageY = getScrollTop();

            if (Dtransform % 2 != 0) {

                autoScrollTo(1.5 * winHeight);
            } else {
                autoScrollTo(0);
            }
            dqSlt("#JqMA-btn-down").html("=");
            dqSlt("#JqMA-btn-up").html("=");

            timeHu = setTimeout(function() {
                Dxy += 1;
                dqSlt("#JqMA-btn-up").html("△");
                dqSlt("#JqMA-btn-down").html("▽");

            }, scrollPH % 2 == 0 ? 15 * 1000 : 0);

        } else {
            autoScrollTo(xMove == 1 ? pageX : pageY);

            dqSlt("#JqMA-btn-up").html("△");
            dqSlt("#JqMA-btn-down").html("▽");

        }
    });

    dqSlt("#JqMA-btn-del").addClass("JqMA-btn-show");

    function delHide() {

        dqSlt(".JqMA-btn-all").hide();

        dqSlt(".JqMA-btn-show").show().css({
            "opacity": "0.3"
        });

        Dhide = 1;
    }

    var Dhide = 0;

    dqSlt("html").on('click', '#JqMA-btn-del', function() {

        if (Dhide % 2 == 0) {

            delHide();
        } else {

            Dhide = 0;

            dqSlt(".JqMA-btn-all").show().css({
                "opacity": "0.6"
            });
        }
    });

    var timeout_2;
    dqSlt("html").on('touchstart mousedown', '#JqMA-btn-del', function() {
        timeout_2 = setTimeout(function() {

            dqSlt(".JqMA-btn-all").hide();
            Dhide = 1;

        }, 800);
    }).on('touchend touchmove mouseup', '#JqMA-btn-del', function() {
        clearTimeout(timeout_2);
    });

    var timeout_3;
    dqSlt("html").on('touchstart mousedown', function(event) {

        if ($(event.target).is(".JqMA-btn-all")) {
            return false;
        }

        timeout_3 = setTimeout(function() {

            dqSlt(".JqMA-btn-show").show();
        }, 500);
    }).on('touchend touchmove mouseup', function() {
        clearTimeout(timeout_3);
    });

    dqSlt("html").on('click', '#JqMA-btn-jia', function() {

        scrollJu += 1;

        dqSlt("#JqMA-btn-Ju").html(scrollJu);
    });

    dqSlt("html").on('click', '#JqMA-btn-jian', function() {

        scrollJu -= 1;

        dqSlt("#JqMA-btn-Ju").html(scrollJu);
    });

    var timeout_5;

    dqSlt("html").on('touchstart', '#JqMA-btn-Ju', function() {
        timeout_5 = setTimeout(function() {

            scrollJu = 4;

            dqSlt("#JqMA-btn-Ju").html(scrollJu);

        }, 500);
    }).on('touchend', '#JqMA-btn-Ju', function() {
        clearTimeout(timeout_5);
    });

    var Dscroll = 0;
    var timeDown;

    dqSlt("html").on('click', '#JqMA-btn-Ju', function() {

        Dscroll += 1;
        clearInterval(timeDown);

        if (Dscroll % 2 != 0) {

            dqSlt("#JqMA-btn-Ju").css("color", "green");

            autoScrollBy(scrollJu * scrollNum, animateTime);

            timeDown = setInterval(function() {

                autoScrollBy(scrollJu * scrollNum, animateTime);

            }, animateTime + 10);

        } else {
            dqSlt("html,body").stop();

            visibleDiv().stop();

            dqSlt("#JqMA-btn-Ju").css("color", "white");
        }
    });

    // Your code here...
})(this.jQuery);