// ==UserScript== // @name 🎄 Drawaria.online Christmas Effects Mod Menu 🎅 // @namespace http://tampermonkey.net/ // @version 1.9 // @description Añade efectos de nieve, música y decoraciones navideñas a Drawaria.online con un menú de mod. // @author YouTubeDrawaria // @include https://drawaria.online/* // @include https://*.drawaria.online/* // @require https://update.greasyfork.icu/scripts/554529/1688219/Torn%20Radial%20UI%20Components%20Library.js // @grant GM_addStyle // @grant GM_registerMenuCommand // @connect images.unsplash.com // @connect ibb.co // @connect myinstants.com // @connect picsum.photos // @run-at document-start // @icon https://www.google.com/s2/favicons?sz=64&domain=drawaria.online // @license MIT // @downloadURL none // ==/UserScript== /* global TornRadialUI */ (function() { 'use strict'; // ==================== CONFIGURACIÓN Y UTILIDADES ==================== const STORAGE_KEY = 'drawaria-christmas-mod-settings'; const DEFAULT_SETTINGS = { snowfallEnabled: false, christmasBgEnabled: false, christmasColorsEnabled: false, musicEnabled: false }; let settings = loadSettings(); let audioElement = null; /** * Carga la configuración desde localStorage. * @returns {object} La configuración actual o la predeterminada. */ function loadSettings() { try { const stored = localStorage.getItem(STORAGE_KEY); return stored ? { ...DEFAULT_SETTINGS, ...JSON.parse(stored) } : DEFAULT_SETTINGS; } catch (e) { console.error('Drawaria Christmas Mod: Error al cargar la configuración.', e); return DEFAULT_SETTINGS; } } /** * Guarda la configuración en localStorage. */ function saveSettings() { try { localStorage.setItem(STORAGE_KEY, JSON.stringify(settings)); } catch (e) { console.error('Drawaria Christmas Mod: Error al guardar la configuración.', e); } } // ==================== APLICACIÓN DE EFECTOS ==================== /** * Aplica o remueve las clases y elementos de efectos navideños según la configuración. */ function applyChristmasEffects() { const body = document.body; // 1. Nieve let snowContainer = document.getElementById('drawaria-christmas-snow'); if (settings.snowfallEnabled) { if (!snowContainer) { snowContainer = document.createElement('div'); snowContainer.id = 'drawaria-christmas-snow'; body.appendChild(snowContainer); // Generar los copos de nieve (CSS-only solution for performance) for (let i = 0; i < 50; i++) { const flake = document.createElement('div'); flake.className = 'snow-flake'; flake.style.left = `${Math.random() * 100}%`; flake.style.animationDuration = `${(Math.random() * 10) + 5}s`; // 5 to 15 seconds flake.style.animationDelay = `-${Math.random() * 15}s`; // Start at random phase flake.style.opacity = `${(Math.random() * 0.5) + 0.5}`; // 0.5 to 1.0 flake.style.fontSize = `${(Math.random() * 10) + 10}px`; // 10px to 20px snowContainer.appendChild(flake); } } snowContainer.style.display = 'block'; } else { if (snowContainer) { snowContainer.style.display = 'none'; } } // 2. Fondo (Background) if (settings.christmasBgEnabled) { body.classList.add('christmas-bg'); } else { body.classList.remove('christmas-bg'); } // 3. Colores de la Interfaz (Red/Green) if (settings.christmasColorsEnabled) { body.classList.add('christmas-ui-colors'); } else { body.classList.remove('christmas-ui-colors'); } // 4. Música if (settings.musicEnabled) { if (!audioElement) { audioElement = new Audio('https://www.myinstants.com/media/sounds/jingle-bells-8bit.mp3'); // URL de ejemplo audioElement.loop = true; audioElement.volume = 0.3; } // Intentar reproducir (puede requerir interacción del usuario) audioElement.play().catch(e => { console.log('Drawaria Christmas Mod: Reproducción de audio bloqueada, requiere interacción del usuario.', e); // Se podría añadir un botón de "Play" si el navegador lo bloquea. }); } else { if (audioElement) { audioElement.pause(); audioElement.currentTime = 0; } } } // ==================== CREACIÓN DE LA INTERFAZ (UI) ==================== /** * Genera el modal del Mod Menu usando TornRadialUI.UIComponents. * @returns {HTMLElement} El elemento DOM del modal. */ function createModMenuModal() { if (!window.TornRadialUI || !window.TornRadialUI.UIComponents) { console.error('Torn Radial UI Components Library no está disponible.'); return null; } const UIComponents = window.TornRadialUI.UIComponents; const modal = document.createElement('div'); modal.id = 'drawaria-christmas-mod-menu'; modal.className = 'torn-radial-overlay'; modal.style.display = 'none'; // Se oculta inicialmente modal.innerHTML = `
*La reproducción de música puede requerir que hagas clic en la página primero.
Desarrollado por YouTubeDrawaria | Usando Torn Radial UI Library