Drawaria Jumpscare Mod

A mod q depois d sair de 3 servidor minha foto aparece pra dar jumpscare

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

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

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

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

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

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Drawaria Jumpscare Mod
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  A mod q depois d sair de 3 servidor minha foto aparece pra dar jumpscare
// @author       YouTubeDrawaria
// @match        https://drawaria.online/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=drawaria.online
// @grant        none
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=drawaria.online
// ==/UserScript==

(function() {
    'use strict';

    let leaveCount = 0;
    const IMAGE_URL = 'https://drawaria.online/avatar/cache/67e75060-10d0-11f0-af95-072f6d4ed084.1753059184788.jpg';
    const ALARM_URL = 'https://www.myinstants.com/media/sounds/alarm-sound-effect.mp3';
    const DISPLAY_TIME = 6000; // 6 segundos
    let jumpscared = false;

    function whenHomeButtonExists(fn) {
        const interval = setInterval(() => {
            const btn = document.querySelector('a#homebutton');
            if (btn) {
                clearInterval(interval);
                fn(btn);
            }
        }, 500);
    }

    function showJumpscare() {
        // Overlay oscuro
        const overlay = document.createElement('div');
        overlay.style.position = 'fixed';
        overlay.style.top = 0;
        overlay.style.left = 0;
        overlay.style.width = '100vw';
        overlay.style.height = '100vh';
        overlay.style.background = 'black';
        overlay.style.zIndex = 999999;
        overlay.style.display = 'flex';
        overlay.style.alignItems = 'center';
        overlay.style.justifyContent = 'center';

        // Imagen
        const img = document.createElement('img');
        img.src = IMAGE_URL;
        img.style.maxHeight = '80vh';
        img.style.maxWidth = '80vw';
        img.style.boxShadow = '0 0 80px red';
        overlay.appendChild(img);

        document.body.appendChild(overlay);

        setTimeout(() => {
            const audio = new Audio(ALARM_URL);
            audio.volume = 1.0;
            audio.play();
            audio.onended = () => {
                overlay.remove();
            };
            // En caso el audio no termine bien, quitar overlay a los 8s máximo
            setTimeout(() => {
                overlay.remove();
            }, 8000);
        }, DISPLAY_TIME);
    }

    whenHomeButtonExists(btn => {
        btn.addEventListener('click', () => {
            if (jumpscared) return;
            leaveCount++;
            if (leaveCount >= 3) {
                jumpscared = true;
                showJumpscare();
            }
        }, true);
    });

})();