Greasy Fork is available in English.

Mouse Click Buttons for sploop.io

Adds left and right mouse click buttons to the top left corner of the sploop.io webpage.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Mouse Click Buttons for sploop.io
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Adds left and right mouse click buttons to the top left corner of the sploop.io webpage.
// @author       hayden422
// @match        https://sploop.io/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Create a container div
    const container = document.createElement('div');
    container.style.position = 'fixed';
    container.style.top = '0';
    container.style.left = '0';
    container.style.padding = '10px';
    document.body.appendChild(container);

    // Create left mouse click button
    const leftClickButton = document.createElement('button');
    leftClickButton.textContent = 'LMB';
    leftClickButton.style.padding = '10px 25px';
    leftClickButton.style.backgroundColor = '#007bff';
    leftClickButton.style.color = '#fff';
    leftClickButton.style.border = 'none';
    leftClickButton.style.cursor = 'pointer';
    container.appendChild(leftClickButton);

    // Create right mouse click button
    const rightClickButton = document.createElement('button');
    rightClickButton.textContent = 'RMB';
    rightClickButton.style.padding = '10px 25px';
    rightClickButton.style.backgroundColor = '#dc3545';
    rightClickButton.style.color = '#fff';
    rightClickButton.style.border = 'none';
    rightClickButton.style.cursor = 'pointer';
    container.appendChild(rightClickButton);

    // Function to toggle button color
    function toggleButtonColor(button) {
        const originalColor = button.dataset.originalColor || '';
        const currentColor = button.style.backgroundColor || '';

        if (originalColor && currentColor) {
            button.style.backgroundColor = currentColor === originalColor ? '#f0f0f0' : originalColor;
        } else {
            button.dataset.originalColor = currentColor;
            button.style.backgroundColor = '#f0f0f0';
        }
    }

    // Add mousedown event listeners to toggle button colors
    document.addEventListener('mousedown', (event) => {
        if (event.button === 0) { // Left mouse button (LMB)
            toggleButtonColor(leftClickButton);
        } else if (event.button === 2) { // Right mouse button (RMB)
            toggleButtonColor(rightClickButton);
        }
    });

    // Add mouseup event listeners to reset button colors
    document.addEventListener('mouseup', () => {
        leftClickButton.style.backgroundColor = '#007bff';
        rightClickButton.style.backgroundColor = '#dc3545';
    });
})();