Greasy Fork

Greasy Fork is available in English.

TikTok Mouse Tekerleği Video Değiştirici

TikTok videolarını tam ekran moddayken mouse tekerleği ile ileri geri değiştirebilmenizi sağlar.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         TikTok Mouse Tekerleği Video Değiştirici
// @namespace    Cybercode
// @version      1.0.3
// @description  TikTok videolarını tam ekran moddayken mouse tekerleği ile ileri geri değiştirebilmenizi sağlar.
// @author       Ali Osman Dinke
// @match        https://www.tiktok.com/*
// @grant        free
// ==/UserScript==

(function() {
    'use strict';

    let isScrolling = false;

    function debounce(func, wait, immediate) {
        let timeout;
        return function() {
            const context = this, args = arguments;
            const later = function() {
                timeout = null;
                if (!immediate) func.apply(context, args);
            };
            const callNow = immediate && !timeout;
            clearTimeout(timeout);
            timeout = setTimeout(later, wait);
            if (callNow) func.apply(context, args);
        };
    }

    function handleMouseWheel(event) {
        if (isScrolling) return;
        isScrolling = true;
        const deltaY = event.deltaY;
        if (deltaY > 0) {
            const nextButton = document.querySelector('.bcp-icon-fullscreen');
            if (nextButton) {
                nextButton.click();
                setTimeout(() => {
                    const nextVideoButton = document.querySelector('.bcp-right-arrow');
                    if (nextVideoButton) nextVideoButton.click();
                }, 500);
            }
        } else if (deltaY < 0) {
            const prevButton = document.querySelector('.bcp-left-arrow');
            if (prevButton) prevButton.click();
        }
        setTimeout(() => {
            isScrolling = false;
        }, 1000); // İsteğe bağlı, kaydırma hızını buradan ayarlayabilirsiniz
    }

    function main() {
        const videoContainer = document.querySelector('.bcp-video');
        if (videoContainer) {
            videoContainer.addEventListener('wheel', debounce(handleMouseWheel, 200));
        }
    }

    main();
})();