Drawaria Jumpscare Mod

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

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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);
    });

})();