Make Torn Twerk

I was bored so I made Torn twerk

  1. // ==UserScript==
  2. // @name Make Torn Twerk
  3. // @namespace http://tampermonkey.net/
  4. // @version 69.420
  5. // @description I was bored so I made Torn twerk
  6. // @author Weav3r
  7. // @match https://www.torn.com/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. window.addEventListener('load', function() {
  16. const button = document.createElement('div');
  17. button.innerHTML = '🍑';
  18. button.style.position = 'fixed';
  19. button.style.top = '50%';
  20. button.style.right = '20px';
  21. button.style.width = '50px';
  22. button.style.height = '50px';
  23. button.style.borderRadius = '50%';
  24. button.style.backgroundColor = '#f44336';
  25. button.style.color = 'white';
  26. button.style.fontSize = '24px';
  27. button.style.display = 'flex';
  28. button.style.justifyContent = 'center';
  29. button.style.alignItems = 'center';
  30. button.style.cursor = 'pointer';
  31. button.style.zIndex = '2147483647';
  32. button.style.boxShadow = '0 4px 8px rgba(0,0,0,0.2)';
  33. button.style.transition = 'transform 0.2s';
  34.  
  35. button.addEventListener('mouseover', function() {
  36. this.style.transform = 'scale(1.1)';
  37. });
  38.  
  39. button.addEventListener('mouseout', function() {
  40. this.style.transform = 'scale(1)';
  41. });
  42.  
  43. let twerking = false;
  44. let twerkInterval;
  45. let intensity = 0;
  46. const maxIntensity = 15;
  47. let twerkPhase = 0;
  48.  
  49. function setupTwerkElements() {
  50. const existingTwerkElements = document.querySelectorAll('.twerk-overlay, .twerk-bottom');
  51. existingTwerkElements.forEach(el => el.remove());
  52.  
  53. const mainContent = document.getElementById('mainContainer') || document.body;
  54.  
  55. const overlay = document.createElement('div');
  56. overlay.className = 'twerk-overlay';
  57. overlay.style.position = 'fixed';
  58. overlay.style.top = '0';
  59. overlay.style.left = '0';
  60. overlay.style.width = '100%';
  61. overlay.style.height = '100%';
  62. overlay.style.pointerEvents = 'none';
  63. overlay.style.zIndex = '2147483646';
  64. document.body.appendChild(overlay);
  65.  
  66. const pageHeight = Math.max(
  67. document.body.scrollHeight,
  68. document.body.offsetHeight,
  69. document.documentElement.clientHeight,
  70. document.documentElement.scrollHeight,
  71. document.documentElement.offsetHeight
  72. );
  73.  
  74. const bottomIndicator = document.createElement('div');
  75. bottomIndicator.className = 'twerk-bottom';
  76. bottomIndicator.style.position = 'fixed';
  77. bottomIndicator.style.bottom = '0';
  78. bottomIndicator.style.left = '0';
  79. bottomIndicator.style.width = '100%';
  80. bottomIndicator.style.height = '40%';
  81. bottomIndicator.style.background = 'linear-gradient(to bottom, rgba(244, 67, 54, 0) 0%, rgba(244, 67, 54, 0.05) 100%)';
  82. bottomIndicator.style.pointerEvents = 'none';
  83. bottomIndicator.style.zIndex = '2147483645';
  84. bottomIndicator.style.display = 'none';
  85. document.body.appendChild(bottomIndicator);
  86.  
  87. return { overlay, bottomIndicator };
  88. }
  89.  
  90. function twerkPage() {
  91. const bottomIndicator = document.querySelector('.twerk-bottom');
  92.  
  93. if (bottomIndicator) {
  94. bottomIndicator.style.display = 'block';
  95. }
  96.  
  97. const bounce = Math.sin(twerkPhase * 2) * (intensity * 0.8);
  98. const popOut = Math.max(0, Math.sin(twerkPhase * 2)) * (intensity * 0.5);
  99.  
  100. if (bottomIndicator) {
  101. bottomIndicator.style.transform = `translateZ(0) translateY(${bounce}px) scaleX(${1 + popOut * 0.02}) scaleY(${1 + popOut * 0.05})`;
  102. bottomIndicator.style.transformOrigin = 'center bottom';
  103. }
  104.  
  105. document.body.style.perspective = '1000px';
  106.  
  107. const tilt = Math.sin(twerkPhase) * (intensity * 0.4);
  108. document.body.style.transform = `perspective(1000px) rotateX(${tilt}deg)`;
  109. document.body.style.transformOrigin = 'center 70%';
  110.  
  111. const allElements = document.querySelectorAll('div, p, span, img, table, a');
  112.  
  113. const viewportHeight = window.innerHeight;
  114. const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
  115.  
  116. allElements.forEach(element => {
  117. if (element === button) return;
  118.  
  119. const rect = element.getBoundingClientRect();
  120.  
  121. if (rect.top > viewportHeight * 0.6) {
  122. const bottomRatio = (rect.top - (viewportHeight * 0.6)) / (viewportHeight * 0.4);
  123.  
  124. const elementBounce = bounce * bottomRatio * 1.5;
  125. const elementPopOut = popOut * bottomRatio * 1.5;
  126.  
  127. element.style.transform = `translateY(${elementBounce}px) scale(${1 + elementPopOut * 0.01})`;
  128. element.style.transformOrigin = 'center bottom';
  129. }
  130. });
  131.  
  132. twerkPhase += 0.2;
  133. }
  134.  
  135. function resetPage() {
  136. document.body.style.transform = 'none';
  137. document.body.style.perspective = 'none';
  138.  
  139. const allElements = document.querySelectorAll('div, p, span, img, table, a');
  140. allElements.forEach(element => {
  141. if (element === button) return;
  142. element.style.transform = '';
  143. });
  144.  
  145. const bottomIndicator = document.querySelector('.twerk-bottom');
  146. if (bottomIndicator) {
  147. bottomIndicator.style.display = 'none';
  148. }
  149.  
  150. twerkPhase = 0;
  151. }
  152.  
  153. button.addEventListener('click', function() {
  154. if (twerking) {
  155. clearInterval(twerkInterval);
  156. resetPage();
  157. twerking = false;
  158. intensity = 0;
  159. button.innerHTML = '🍑';
  160.  
  161. const twerkElements = document.querySelectorAll('.twerk-overlay, .twerk-bottom');
  162. twerkElements.forEach(el => el.remove());
  163.  
  164. } else {
  165. twerking = true;
  166. button.innerHTML = '🛑';
  167. intensity = 8;
  168.  
  169. setupTwerkElements();
  170.  
  171. twerkInterval = setInterval(function() {
  172. twerkPage();
  173. }, 30);
  174. }
  175. });
  176.  
  177. button.addEventListener('mousedown', function() {
  178. if (twerking) {
  179. const intensityInterval = setInterval(function() {
  180. if (intensity < maxIntensity) {
  181. intensity += 0.5;
  182. }
  183. }, 100);
  184.  
  185. document.addEventListener('mouseup', function clearIntensity() {
  186. clearInterval(intensityInterval);
  187. document.removeEventListener('mouseup', clearIntensity);
  188. });
  189. }
  190. });
  191.  
  192. document.body.appendChild(button);
  193. });
  194. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址