AutoScroll Plus

AutoScroll avec contrôle de vitesse et navigation rapide

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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");
})();