Greasy Fork

来自缓存

Greasy Fork is available in English.

竖版看图

旋转90度看图,自动滚动

当前为 2023-07-24 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         竖版看图
// @namespace    http://tampermonkey.net/
// @version      0.52
// @description  旋转90度看图,自动滚动
// @author       You
// @match        *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pixabay.com
// @grant        none
// @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    var Dscroll = 0;

    var Dxy = 0;
    var timeDown;

    var scrollJu = 90;

    var bottom = 200;

    var left = -43;

    var left2 = -103;

    var jianG = 40;

    var degZ = 90

    var scaleZ = 0.56

    var sameCss = "font-size: 14px !important;line-height:12px!important;z-index: 2147483647;border:1px solid white;height:25px;background-color:black;color:white;position:fixed;width:40px;left:34.5%;margin-left:" + left
    var sameCss2 = "font-size: 14px !important;line-height:12px!important;z-index: 2147483647;border:1px solid white;height:25px;background-color:black;color:white;position:fixed;width:40px;left:34.5%;margin-left:" + left2

    $("body").append("<input type='button' id='Jscroll-jian' value='-' style='"+sameCss+ "px;bottom:" + (bottom+3*jianG) + "px'>")

        .append("<input type='button' id='Jscroll-jia' value='+' style='"+sameCss+ "px;bottom:" + (bottom + 2*jianG) + "px'>")
        .append("<input type='button' id='Jscroll-Ju' value='" + scrollJu + "' style='"+sameCss+ "px;bottom:" + (bottom + jianG) + "px'>")

        .append("<input type='button' id='Jscroll-xy' value='▽' style='"+sameCss2+ "px;bottom:" + (bottom + 3*jianG) + "px'>")

        .append("<input type='button' id='Jscroll-deg' value='" + degZ + "°' style='"+sameCss2+ "px;bottom:" + (bottom + 2*jianG) + "px'>")
        .append("<input type='button' id='Jscroll-scale' value='" + scaleZ + "' style='"+sameCss2+ "px;bottom:" + (bottom + jianG) + "px'>")
        .append("<input type='button' id='Jscroll-del' value='X' style='"+sameCss+ "px;bottom:" + (bottom) + "px'>");

    $.fn.longPress = function(fn) {

        var timeout = undefined;

        var $this = this;

        for(var i = 0; i < $this.length; i++) {

            (function(target) {

                var timeout;

                target.addEventListener('touchstart', function(event) {

                    timeout = setTimeout(function() {

                        //fn.apply(target);

                        fn(event);

                    }, 500);

                }, false);

                target.addEventListener('touchend', function(event) {

                    clearTimeout(timeout);

                }, false);

            })($this[i]);

        }

    }

    $("#Jscroll-jia").click(function () {

        scrollJu += 45;
        $("#Jscroll-Ju").val(scrollJu);

    });
    $("#Jscroll-deg").click(function () {
        degZ += 90;
        degZ = degZ % 360;
        $("#Jscroll-deg").val(degZ + "°");
        $("img").css("-webkit-transform","rotate("+degZ+"deg) scale("+scaleZ+")");


    });

    $("#Jscroll-scale").longPress(function () {
        scaleZ=0.56;
        $("#Jscroll-scale").val(scaleZ.toFixed (2));
        $("img").css("-webkit-transform","rotate("+degZ+"deg) scale("+scaleZ+")");

    });
    $("#Jscroll-scale").click(function () {
        if(scaleZ > 0.9 && scaleZ < 1.1){
            scaleZ += 0.01
        }
        if(scaleZ > 0.6){
            scaleZ -= 0.11
        }

        scaleZ -= 0.04;

        if(scaleZ < 0.38){
            scaleZ = 1.15
        }

        $("#Jscroll-scale").val(scaleZ.toFixed (2));
        $("img").css("-webkit-transform","rotate("+degZ+"deg) scale("+scaleZ+")");

    });

    $("#Jscroll-xy").click(function () {

        Dxy += 1;
        if (Dxy % 2 != 0) {
            var h = $(document).height();
            window.scrollTo(0,h);
            $("#Jscroll-xy").val("△");
        }else{
            window.scrollTo(0,0)
            $("#Jscroll-xy").val("▽");
        }
    });

    $("body").longPress(function () {
        $("#Jscroll-jia").show();

        $("#Jscroll-jian").show();

        $("#Jscroll-Ju").show();

        $("#Jscroll-deg").show();

        $("#Jscroll-scale").show();

        $("#Jscroll-xy").show();

        $("#Jscroll-del").show();
    });

    $("#Jscroll-del").click(function () {

        $("#Jscroll-jia").hide();

        $("#Jscroll-jian").hide();

        $("#Jscroll-Ju").hide();

        $("#Jscroll-deg").hide();
        $("#Jscroll-scale").hide();
        $("#Jscroll-xy").hide();

        $("#Jscroll-del").hide();


    });

    $("#Jscroll-jian").click(function () {

        scrollJu -= 45;

        $("#Jscroll-Ju").val(scrollJu);

    });

    $("#Jscroll-Ju").click(function () {

        Dscroll += 1;

        if (Dscroll % 2 != 0) {
            $("#Jscroll-Ju").css("color","green");

            if (scrollJu < 140) {
                $("img").css("-webkit-transform","rotate("+degZ+"deg) scale("+scaleZ+")");
            }

            timeDown = setInterval(function () {

                window.scrollBy(0, scrollJu)

            }, 4000)

        } else {
            $("#Jscroll-Ju").css("color","white");

            clearInterval(timeDown)

            if (scrollJu < 140) {
                $("img").css("-webkit-transform","rotate(0deg) scale(1)");
            }

        }

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