Censored redgif

This script censors redgifs.com.

Από την 25/12/2023. Δείτε την τελευταία έκδοση.

  1. // ==UserScript==
  2. // @name Censored redgif
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.1
  5. // @description This script censors redgifs.com.
  6. // @author whtb
  7. // @match https://www.redgifs.com/*
  8. // @icon https://static.vecteezy.com/system/resources/previews/006/736/319/non_2x/censored-pixel-sign-flat-style-design-illustration-concept-isolated-on-white-background-vector.jpg
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. var n=0;
  14. var imgs;
  15. var i=0;
  16. const links = [
  17. "https://iili.io/Jz944WP.png",
  18. "https://iili.io/JzFuRcJ.png",
  19. "https://iili.io/JzFTrTN.png",
  20. "https://iili.io/Jz96kBt.png",
  21. "https://iili.io/JxQb8p2.png",
  22. "https://iili.io/JxgKbYQ.png"
  23. ];
  24.  
  25. var mousePosition;
  26. var offset = [0,0];
  27. var div, scroller;
  28. var isDown = false;
  29. var ScrollerFokusCheck= false;
  30. var opacity=0.9;
  31. var blure= '10px';
  32.  
  33. function newstyle(){
  34. var newst = document.createElement('style');
  35. newst.innerHTML = `
  36. .Player-BackdropWrap{
  37. opacity: ${opacity};
  38. }
  39. video {
  40. filter: blur(${blure});
  41. }
  42. `;
  43. return newst;
  44. }
  45.  
  46. var style = document.createElement('style');
  47. style.innerHTML = `
  48. .divmenu {
  49. z-index: 20;
  50. width: 150px;
  51. height: 150px;
  52. top: 200px;
  53. left: 400px;
  54. background-color: #4533E9;
  55. color: #96F3F6;
  56. border-radius: 10px;
  57. box-shadow: 0px 9px 30px 0px rgba(255,149,5,0.3);
  58. }
  59.  
  60. .pmenu{
  61. margin-bottom: 8px;
  62. margin-top: 8px;
  63. font-size: 18px;
  64. }
  65.  
  66. li {
  67. margin-left: 10px;
  68. list-style-type: none;
  69. padding: .1em;
  70. }
  71. ul {
  72. list-style-type: none;
  73. }
  74.  
  75.  
  76. .Player-MetaInfo, .Player-SideBarWrap{
  77. z-index: 10;
  78. }
  79.  
  80. .Player-BackdropWrap{
  81. z-index: 9;
  82. object-fit: cover;
  83. }
  84.  
  85. .thumbnail.lazyLoad.visible, .ImageGif-Thumbnail, .Video-Poster, .ready{
  86. filter: blur(8px);
  87. z-index: auto;
  88. }
  89.  
  90. video {
  91. background: #000;
  92. color: #FFF;
  93. z-index: 1;
  94. }
  95.  
  96. div.Player-BackdropWrap img{
  97. opacity: 1;
  98. -webkit-filter: blur(0px);
  99. filter: blur(0px);
  100. }
  101.  
  102. `;
  103.  
  104. document.head.appendChild(style);
  105.  
  106.  
  107. div = document.createElement("div");
  108. div.style.position = "fixed";
  109. div.classList.add("divmenu");
  110.  
  111.  
  112.  
  113. div.innerHTML = `<ul class="set_boxes">
  114. <li><p class="pmenu">Opacity</p>
  115. <input id="inputOpacity" type="range" step="0.05" min="0" defaultValue="0.9" max="1" style="width: 120px;" ></li>
  116. <li><p class="pmenu">Blure</p>
  117. <input id="inputBlure" type="range" step="0.1" min="3" max="30" style="width: 120px;"></li>
  118. </ul>`;
  119.  
  120. const scrollerOp = div.querySelector("#inputOpacity");
  121. const scrollerBl = div.querySelector("#inputBlure");
  122. document.body.insertAdjacentElement("beforeend", div);
  123.  
  124. function scroller_in_fokus(){ScrollerFokusCheck= true;}
  125. function scroller_in_blure(){ScrollerFokusCheck= false;}
  126.  
  127. div.addEventListener('mousedown', function(e) {
  128. if (!ScrollerFokusCheck){
  129. isDown = true;
  130. offset = [
  131. div.offsetLeft - e.clientX,
  132. div.offsetTop - e.clientY
  133. ];
  134. }
  135. }, true);
  136.  
  137. document.addEventListener('mouseup', function() {
  138. if (!ScrollerFokusCheck){isDown = false;}
  139. }, true);
  140.  
  141. document.addEventListener('mousemove', function(event) {
  142. if (!ScrollerFokusCheck){
  143. event.preventDefault();
  144. if (isDown) {
  145. mousePosition = {
  146.  
  147. x : event.clientX,
  148. y : event.clientY
  149.  
  150. };
  151. div.style.left = (mousePosition.x + offset[0]) + 'px';
  152. div.style.top = (mousePosition.y + offset[1]) + 'px';
  153. }
  154. }
  155. }, true);
  156.  
  157. scrollerOp.addEventListener('input', function() {opacity = this.value; document.head.appendChild(newstyle()); console.log(newstyle());}, false);
  158. scrollerBl.addEventListener('input', function() {blure = this.value + 'px'; document.head.appendChild(newstyle()); }, false);
  159.  
  160. scrollerOp.addEventListener("mouseenter", scroller_in_fokus);
  161. scrollerOp.addEventListener("mouseleave", scroller_in_blure);
  162. scrollerBl.addEventListener("mouseenter", scroller_in_fokus);
  163. scrollerBl.addEventListener("mouseleave", scroller_in_blure);
  164.  
  165.  
  166. function myFunction(){
  167.  
  168. imgs = document.querySelectorAll("div.Player-BackdropWrap > img[src^='https://thumbs44.redgifs.com/']");
  169.  
  170. if (imgs.length != n){
  171. i+=1;
  172. n = imgs.length;
  173. imgs[imgs.length-1].src = links[i%links.length];
  174. document.head.appendChild(style);
  175. document.head.appendChild(newstyle());
  176. }
  177. }
  178.  
  179.  
  180. var timer = setInterval( myFunction, 10);
  181.  
  182. window.addEventListener('load', function() {
  183. document.head.appendChild(style);
  184. myFunction();
  185. });
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.