noPIC 一键隐藏/显示全页面图片(摸鱼必备)

隐藏图片和标题

目前为 2024-05-27 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name noPIC 一键隐藏/显示全页面图片(摸鱼必备)
  3. // @version 1.4
  4. // @description 隐藏图片和标题
  5. // @author fxalll
  6. // @match *://*/*
  7. // @grant none
  8. // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
  9. // @license MIT
  10. // @namespace https://gf.qytechs.cn/users/1043548
  11. // ==/UserScript==
  12.  
  13.  
  14.  
  15. (function () {
  16. window.imgHidenSet = null;
  17. window.imgShownSet = null;
  18. let imgHiden = function() {
  19. $(".RichContent-cover-inner").each(function(){
  20. $(this).hide();
  21. });
  22. $(".ZVideoRecommendationItem-thumbnailImage").each(function(){
  23. $(this).hide();
  24. });
  25. $(".QuestionHeader-title").each(function(){
  26. $(this).hide();
  27. });
  28. $("iframee").each(function(){
  29. $(this).hide();
  30. });
  31. $("img").each(function(){
  32. $(this).hide();
  33. });
  34. };
  35.  
  36.  
  37. let imgShown = function() {
  38. $(".RichContent-cover-inner").each(function(){
  39. $(this).show();
  40. });
  41. $(".ZVideoRecommendationItem-thumbnailImage").each(function(){
  42. $(this).show();
  43. });
  44. $(".QuestionHeader-title").each(function(){
  45. $(this).show();
  46. });
  47. $("iframee").each(function(){
  48. $(this).show();
  49. });
  50. $("img").each(function(){
  51. $(this).show();
  52. });
  53. };
  54.  
  55.  
  56.  
  57. let handleButtonClick = function(){
  58. if (window.imgHidenSet === null) {
  59. clearInterval(window.imgShownSet);
  60. window.imgShownSet = null;
  61. imgHiden()
  62. window.imgHidenSet = setInterval(function(){
  63. imgHiden();
  64. }, 300)
  65.  
  66. } else {
  67. clearInterval(window.imgHidenSet);
  68. window.imgHidenSet = null;
  69. imgShown()
  70. window.imgShownSet = setInterval(function(){
  71. imgShown();
  72. }, 300)
  73. }
  74. }
  75.  
  76. // 自动隐藏图片
  77. //imgHiden();
  78. //window.imgHidenSet = setInterval(function(){
  79. //imgHiden();
  80. //}, 300)
  81.  
  82. let button = document.createElement('div')
  83. button.innerText = "图片显隐"
  84. button.setAttribute("id", "myButton");
  85. button.style.color = "#ffffff40"
  86. button.style.padding = "10px 20px"
  87. button.style.position = "fixed"
  88. button.style.bottom = "20px"
  89. button.style.right = "3px"
  90. button.style.textAlign = "center"
  91. button.style.alignContent = "center"
  92. button.style.background = "#7d7d7d33"
  93. button.style.borderRadius = "15px"
  94. button.style.cursor = "pointer"
  95. button.style.transform = "translateX(82px)"
  96. button.style.transition = "0.3s"
  97.  
  98. button.style.zIndex = "99999999999999999999999999999"
  99. button.addEventListener("click", handleButtonClick);
  100. // 添加鼠标悬停效果
  101. button.addEventListener('mouseover', function() {
  102. // 当鼠标悬停在元素上时,改变元素的样式
  103. button.style.boxShadow = "0 0 10px rgba(0, 0, 0, 0.5)"; /* 鼠标悬停时的阴影效果 */;
  104. button.style.background = "#4760e1bf"
  105. button.style.color = "#ffffff"
  106. button.style.transform = "translateX(0px)"
  107. });
  108.  
  109. button.addEventListener('mouseout', function() {
  110. // 当鼠标离开元素时,恢复元素的样式
  111. button.style.boxShadow = '';
  112. button.style.background = "#7d7d7d33"
  113. button.style.color = "#ffffff40"
  114. button.style.transform = "translateX(82px)"
  115. });
  116.  
  117. document.body.appendChild(button);
  118. })()

QingJ © 2025

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