Catnip Prank

Play music, replace images, and rotate the page.

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

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

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

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

您需要先安装一款用户脚本管理器扩展,例如 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);
})();