Roblox Green Play Button

Replace The blue color of the play button by the old color.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Roblox Green Play Button
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Replace The blue color of the play button by the old color.
// @author       aividedghost
// @match        https://www.roblox.com/games/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    function applyStyleToPlayButton() {
        const playButton = document.querySelector('button[data-testid="play-button"]');
        if (playButton && !playButton.dataset.modified) {
            playButton.style.backgroundColor = '#00b06b'; //
            playButton.style.color = 'white';
            playButton.style.border = 'none';
            playButton.style.borderRadius = '8px';
            playButton.style.fontWeight = 'bold';
            playButton.style.transition = 'background-color 0.2s ease';
            playButton.style.boxShadow = '0 2px 6px rgba(0,0,0,0.3)';
            playButton.dataset.modified = 'true';

            playButton.addEventListener('mouseover', () => {
                playButton.style.backgroundColor = '#009a5a';
            });

            playButton.addEventListener('mouseout', () => {
                playButton.style.backgroundColor = '#00b06b';
            });
        }
    }

    //
    applyStyleToPlayButton();

    // 
    const observer = new MutationObserver(() => {
        applyStyleToPlayButton();
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();