AutoScroll Plus

AutoScroll avec contrôle de vitesse et navigation rapide

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         AutoScroll Plus
// @namespace    https://greatest.deepsurf.us/users/1429467
// @description  AutoScroll avec contrôle de vitesse et navigation rapide
// @include      http*
// @version      1.0
// @author       Lakfu sama
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let scrolling = false;
    let speed = 50; // Temps en ms entre chaque scroll (plus bas = plus rapide)
    let scrollInterval;

    function startScrolling() {
        if (!scrolling) {
            scrolling = true;
            scrollInterval = setInterval(() => {
                window.scrollBy(0, 5); // Ajuste la valeur pour modifier l'incrément du scroll
            }, speed);
        }
    }

    function stopScrolling() {
        scrolling = false;
        clearInterval(scrollInterval);
    }

    function increaseSpeed() {
        if (speed > 10) {
            speed -= 10;
            restartScrolling();
        }
    }

    function decreaseSpeed() {
        speed += 10;
        restartScrolling();
    }

    function restartScrolling() {
        if (scrolling) {
            stopScrolling();
            startScrolling();
        }
    }

    function scrollToTop() {
        window.scrollTo({ top: 0, behavior: 'smooth' });
    }

    function scrollToBottom() {
        window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
    }

    // Raccourcis clavier
    document.addEventListener('keydown', function(event) {
        switch (event.key) {
            case 's': // Démarrer/Pause (toggle)
                scrolling ? stopScrolling() : startScrolling();
                break;
            case '+': // Augmenter la vitesse
                increaseSpeed();
                break;
            case '-': // Diminuer la vitesse
                decreaseSpeed();
                break;
            case 't': // Aller en haut
                scrollToTop();
                break;
            case 'b': // Aller en bas
                scrollToBottom();
                break;
        }
    });

    console.log("AutoScroll Plus chargé :\n[s] Démarrer/Pause | [+] Augmenter vitesse | [-] Diminuer vitesse | [t] Haut | [b] Bas");
})();