Fortunate Son Button Player (works on every website)

Make fortunate son play infinitly when click (theres a stop button)

目前為 2025-09-07 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Fortunate Son Button Player (works on every website)
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  Make fortunate son play infinitly when click (theres a stop button)
// @match        *://*/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // First audio/button (Fortunate Son)
    if (!window.fortunateAudio) {
        let audio1 = document.createElement('audio');
        audio1.src = "https://raw.githubusercontent.com/p00p4nts/p00p/main/sound2.mp3";
        audio1.loop = true;
        document.body.appendChild(audio1);
        window.fortunateAudio = audio1;

        let button1 = document.createElement('button');
        button1.id = "fortunateSonButton";
        button1.innerText = "hey";
        Object.assign(button1.style, {
            position: "fixed",
            bottom: "20px",
            right: "20px",
            zIndex: 2147483647,
            padding: "12px 20px",
            backgroundColor: "#ff4444",
            color: "#fff",
            border: "none",
            borderRadius: "6px",
            cursor: "pointer",
            fontWeight: "bold",
            boxShadow: "0 4px 8px rgba(0,0,0,0.4)"
        });
        document.body.appendChild(button1);

        button1.addEventListener('click', () => {
            if (audio1.paused) {
                audio1.play().catch(() => console.log("Click detected. Starting music..."));
                button1.innerText = "stop";
            } else {
                audio1.pause();
                button1.innerText = "CCR Fortunate Son ";
            }
        });
    }

    // Second smaller audio/button
    if (!window.fortunateAudio2) {
        let audio2 = document.createElement('audio');
        audio2.src = "https://raw.githubusercontent.com/p00p4nts/p00p/main/sound3.mp3";
        audio2.loop = true;
        document.body.appendChild(audio2);
        window.fortunateAudio2 = audio2;

        let button2 = document.createElement('button');
        button2.id = "fortunateSonButton2";
        button2.innerText = "hey2";  // changed label
        Object.assign(button2.style, {
            position: "fixed",
            bottom: "70px", // above the first button
            right: "20px",
            zIndex: 2147483647,
            padding: "6px 12px",
            backgroundColor: "#44ff44",
            color: "#fff",
            border: "none",
            borderRadius: "6px",
            cursor: "pointer",
            fontWeight: "bold",
            fontSize: "14px",
            boxShadow: "0 2px 4px rgba(0,0,0,0.3)"
        });
        document.body.appendChild(button2);

        button2.addEventListener('click', () => {
            if (audio2.paused) {
                audio2.play().catch(() => console.log("Click detected. Starting second music..."));
                button2.innerText = "Stop";
            } else {
                audio2.pause();
                button2.innerText = "rain";
            }
        });
    }

    // Keep both buttons on top
    const observer = new MutationObserver(() => {
        const btn1 = document.getElementById("fortunateSonButton");
        if (btn1 && btn1.style.zIndex != "2147483647") btn1.style.zIndex = "2147483647";

        const btn2 = document.getElementById("fortunateSonButton2");
        if (btn2 && btn2.style.zIndex != "2147483647") btn2.style.zIndex = "2147483647";
    });
    observer.observe(document.body, { childList: true, subtree: true });
})();