Bloqueador Navideño XP

Bloqueador de anuncios estilo Windows XP con efectos navideños

  1. // ==UserScript==
  2. // @name Bloqueador Navideño XP
  3. // @namespace Violentmonkey Scripts
  4. // @match https://wormax.io/
  5. // @grant none
  6. // @version 1.0
  7. // @author -
  8. // @description Bloqueador de anuncios estilo Windows XP con efectos navideños
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Insertar estilos CSS
  15. const styles = `
  16. .xp-button {
  17. position: fixed;
  18. top: 10px;
  19. left: 10px;
  20. padding: 5px 10px;
  21. background: linear-gradient(to bottom, #2580c6 0%, #1958a3 45%, #1856a3 50%, #195ca7 95%, #1958a3 100%);
  22. border: 1px solid #4a0c85;
  23. border-radius: 4px;
  24. color: white;
  25. font-size: 12px;
  26. cursor: pointer;
  27. box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  28. display: flex;
  29. align-items: center;
  30. gap: 5px;
  31. z-index: 999999;
  32. }
  33.  
  34. .xp-panel {
  35. position: fixed;
  36. top: 45px;
  37. left: 10px;
  38. width: 300px;
  39. background: #ECE9D8;
  40. border: 1px solid #0f3d7c;
  41. border-radius: 3px;
  42. box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
  43. display: none;
  44. padding: 10px;
  45. z-index: 999999;
  46. }
  47.  
  48. .xp-panel.active {
  49. display: block;
  50. }
  51.  
  52. .snow-container {
  53. position: fixed;
  54. top: 0;
  55. left: 0;
  56. width: 100vw;
  57. height: 100vh;
  58. pointer-events: none;
  59. z-index: 999998;
  60. }
  61.  
  62. .snowman {
  63. position: absolute;
  64. font-size: 40px;
  65. animation: waddle 20s linear infinite;
  66. z-index: 999998;
  67. }
  68.  
  69. @keyframes waddle {
  70. 0% {
  71. transform: translateX(-50px) rotate(-5deg);
  72. }
  73. 25% {
  74. transform: translateX(calc(50vw - 25px)) rotate(5deg);
  75. }
  76. 50% {
  77. transform: translateX(calc(100vw + 50px)) rotate(-5deg);
  78. }
  79. 51% {
  80. transform: translateX(calc(100vw + 50px)) rotate(-5deg) scaleX(-1);
  81. }
  82. 75% {
  83. transform: translateX(calc(50vw - 25px)) rotate(5deg) scaleX(-1);
  84. }
  85. 100% {
  86. transform: translateX(-50px) rotate(-5deg) scaleX(-1);
  87. }
  88. }
  89.  
  90. .snowflake {
  91. color: #fff;
  92. font-size: 1em;
  93. position: absolute;
  94. top: -10px;
  95. animation: fall linear forwards;
  96. text-shadow: 0 0 3px rgba(0,0,0,0.3);
  97. }
  98.  
  99. @keyframes fall {
  100. to {
  101. transform: translateY(100vh);
  102. }
  103. }
  104.  
  105. .xp-header {
  106. background: linear-gradient(to right, #0058b3 0%, #2680eb 100%);
  107. color: white;
  108. padding: 5px;
  109. margin: -10px -10px 10px -10px;
  110. font-weight: bold;
  111. display: flex;
  112. justify-content: space-between;
  113. align-items: center;
  114. }
  115.  
  116. .option-button {
  117. width: 100%;
  118. padding: 8px;
  119. margin: 5px 0;
  120. background: linear-gradient(to bottom, #ffffff 0%, #e1e1e1 100%);
  121. border: 1px solid #999;
  122. border-radius: 3px;
  123. cursor: pointer;
  124. display: flex;
  125. align-items: center;
  126. gap: 10px;
  127. }
  128.  
  129. .status {
  130. font-size: 11px;
  131. color: #666;
  132. margin-top: 10px;
  133. padding: 5px;
  134. background: #fff;
  135. border: 1px solid #ccc;
  136. }
  137.  
  138. .close-button {
  139. background: none;
  140. border: none;
  141. color: white;
  142. cursor: pointer;
  143. font-size: 16px;
  144. }
  145. `;
  146.  
  147. // Insertar HTML
  148. const html = `
  149. <button class="xp-button">
  150. <span>🖥️ Menu XP Come1</span>
  151. </button>
  152.  
  153. <div class="xp-panel">
  154. <div class="xp-header">
  155. <span>Bloqueador Navideño</span>
  156. <button class="close-button">×</button>
  157. </div>
  158. <button class="option-button" id="toggle-blocker">
  159. <span>🎅 Activar/Desactivar Bloqueador</span>
  160. </button>
  161. <button class="option-button" id="toggle-snow">
  162. <span>❄️ Activar/Desactivar Nieve</span>
  163. </button>
  164. <button class="option-button" id="toggle-snowmen">
  165. <span>⛄ Activar/Desactivar Muñecos</span>
  166. </button>
  167. <div class="status">Estado: Desactivado ⭐</div>
  168. </div>
  169.  
  170. <div class="snow-container"></div>
  171. `;
  172.  
  173. // Agregar estilos y HTML al documento
  174. const styleSheet = document.createElement("style");
  175. styleSheet.textContent = styles;
  176. document.head.appendChild(styleSheet);
  177.  
  178. const container = document.createElement("div");
  179. container.innerHTML = html;
  180. document.body.appendChild(container);
  181.  
  182. // Clase del bloqueador
  183. class ChristmasAdBlocker {
  184. constructor() {
  185. this.adSelectors = [
  186. '.advertisement',
  187. '.ad-container',
  188. '.banner-ads',
  189. '.google-ads',
  190. '[id*="google_ads"]',
  191. '[id*="banner-ad"]',
  192. '[class*="adsbox"]',
  193. '[class*="ad-box"]'
  194. ];
  195. this.isEnabled = false;
  196. this.snowEnabled = false;
  197. this.snowmenEnabled = false;
  198. }
  199.  
  200. enable() {
  201. if (!this.isEnabled) {
  202. this.isEnabled = true;
  203. this.hideAds();
  204. this.startObserver();
  205. document.querySelector('.status').textContent = 'Estado: Activado 🎄';
  206. }
  207. }
  208.  
  209. disable() {
  210. if (this.isEnabled) {
  211. this.isEnabled = false;
  212. this.showAds();
  213. if (this.observer) {
  214. this.observer.disconnect();
  215. }
  216. document.querySelector('.status').textContent = 'Estado: Desactivado ⭐';
  217. }
  218. }
  219.  
  220. hideAds() {
  221. const selector = this.adSelectors.join(', ');
  222. const ads = document.querySelectorAll(selector);
  223. ads.forEach(ad => ad.style.display = 'none');
  224. }
  225.  
  226. showAds() {
  227. const selector = this.adSelectors.join(', ');
  228. const ads = document.querySelectorAll(selector);
  229. ads.forEach(ad => ad.style.display = '');
  230. }
  231.  
  232. startObserver() {
  233. this.observer = new MutationObserver(() => {
  234. if (this.isEnabled) {
  235. this.hideAds();
  236. }
  237. });
  238.  
  239. this.observer.observe(document.body, {
  240. childList: true,
  241. subtree: true
  242. });
  243. }
  244. }
  245.  
  246. // Funciones para efectos visuales
  247. function createSnowflake() {
  248. const snowflake = document.createElement('div');
  249. snowflake.classList.add('snowflake');
  250. snowflake.innerHTML = '❄';
  251. snowflake.style.left = Math.random() * 100 + 'vw';
  252. snowflake.style.animationDuration = Math.random() * 3 + 2 + 's';
  253. snowflake.style.opacity = Math.random();
  254. snowflake.style.fontSize = Math.random() * 10 + 10 + 'px';
  255.  
  256. document.querySelector('.snow-container').appendChild(snowflake);
  257.  
  258. snowflake.addEventListener('animationend', () => {
  259. snowflake.remove();
  260. });
  261. }
  262.  
  263. function createSnowman() {
  264. const snowman = document.createElement('div');
  265. snowman.classList.add('snowman');
  266. snowman.innerHTML = '⛄';
  267. snowman.style.bottom = Math.random() * 20 + 10 + 'px';
  268. snowman.style.animationDelay = -Math.random() * 20 + 's';
  269.  
  270. document.querySelector('.snow-container').appendChild(snowman);
  271. }
  272.  
  273. // Inicializar
  274. const adBlocker = new ChristmasAdBlocker();
  275. let snowInterval;
  276. let snowmenInterval;
  277.  
  278. // Event listeners
  279. document.querySelector('.xp-button').addEventListener('click', () => {
  280. document.querySelector('.xp-panel').classList.toggle('active');
  281. });
  282.  
  283. document.querySelector('.close-button').addEventListener('click', () => {
  284. document.querySelector('.xp-panel').classList.remove('active');
  285. });
  286.  
  287. document.getElementById('toggle-blocker').addEventListener('click', () => {
  288. if (adBlocker.isEnabled) {
  289. adBlocker.disable();
  290. } else {
  291. adBlocker.enable();
  292. }
  293. });
  294.  
  295. document.getElementById('toggle-snow').addEventListener('click', () => {
  296. if (adBlocker.snowEnabled) {
  297. clearInterval(snowInterval);
  298. document.querySelectorAll('.snowflake').forEach(el => el.remove());
  299. adBlocker.snowEnabled = false;
  300. } else {
  301. snowInterval = setInterval(createSnowflake, 100);
  302. adBlocker.snowEnabled = true;
  303. }
  304. });
  305.  
  306. document.getElementById('toggle-snowmen').addEventListener('click', () => {
  307. if (adBlocker.snowmenEnabled) {
  308. clearInterval(snowmenInterval);
  309. document.querySelectorAll('.snowman').forEach(el => el.remove());
  310. adBlocker.snowmenEnabled = false;
  311. } else {
  312. // Crear 5 muñecos de nieve iniciales
  313. for (let i = 0; i < 5; i++) {
  314. createSnowman();
  315. }
  316. // Agregar nuevo muñeco cada 30 segundos hasta un máximo de 8
  317. snowmenInterval = setInterval(() => {
  318. if (document.querySelectorAll('.snowman').length < 8) {
  319. createSnowman();
  320. }
  321. }, 30000);
  322. adBlocker.snowmenEnabled = true;
  323. }
  324. });
  325. })();