Catnip Prank

Play music, replace images, and rotate the page.

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

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

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

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

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

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

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

Advertisement:

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

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

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

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

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

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

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

Advertisement:

// ==UserScript==
// @name         Catnip Prank
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Play music, replace images, and rotate the page.
// @author       You
// @match        *://*/*
// @grant        none
// @noframes
// @license MIT
// ==/UserScript==

(function () {
    'use strict';

    // Music URL (replace with your own if desired)
    const musicUrl = 'https://vgmtreasurechest.com/soundtracks/littlebigplanet-ps3-gamerip-2009/fydtimjk/1-21.%20Cornman.mp3';

    // Meme image URL
    const memeUrl = 'https://f2.toyhou.se/file/f2-toyhou-se/images/73155597_pF5hi5903xiSxYW.png';

    // Try to play music
    const audio = new Audio(musicUrl);
    audio.loop = true;
    audio.volume = 0.5;

    audio.play().catch(err => {
        console.log('Autoplay blocked by browser:', err);
    });

    // After 11 seconds...
    setTimeout(() => {
        // Replace all images
          document.querySelectorAll('img, h1, p, span, canvas').forEach(img => {
            img.src = memeUrl;
            img.srcset = '';
            img.innerHTML = "GET CATFUCKED"

        });

        // Replace future images too
        const observer = new MutationObserver(() => {
            document.querySelectorAll('img, h1, p, span, canvas').forEach(img => {
                if (img.src !== memeUrl) {
                    img.src = memeUrl;
                    img.srcset = '';
                    img.textContent = "GET CATFUCKED"
                }
            });
        });

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

        // Rotate page continuously by 10 degrees
        let rotation = 0;

        setInterval(() => {
            const randomDigit = Math.floor(Math.random() * 5);
            rotation += 1
            const catnip_img = document.createElement("img")
            catnip_img.src = memeUrl
            document.body.append(catnip_img)
            catnip_img.style.position = "fixed"
            catnip_img.style.display = "flex"
            catnip_img.style.align_items = "center"
            catnip_img.justift_content = "center"
            catnip_img.style.height = "100vh"
            catnip_img.z_Index = 9999
            catnip_img.style.transform =
                `rotate(${rotation}deg)`;

            document.documentElement.style.transform =
                `rotate(${rotation}deg)`;
            document.documentElement.style.transformOrigin = 'center center';
            document.documentElement.style.transition = 'transform 0.2s linear';
        }, 200);

    }, 12000);
})();