All images minimized, restored on hover

Minimize the size of all images on a web page and restore them when the mouse hovers over them

  1. // ==UserScript==
  2. // @name All images minimized, restored on hover
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Minimize the size of all images on a web page and restore them when the mouse hovers over them
  6. // @author Yearly
  7. // @match http://*/*
  8. // @match https://*/*
  9. // @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3OC41ODIiIGhlaWdodD0iNzguNTgyIiB2aWV3Qm94PSIwIDAgNzguNTgyIDc4LjU4MiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTIzLjU4MiAyMy4wMDloNTV2NTVoLTU1eiIvPjxwYXRoIGQ9Ik00Ny40MTYgMTIuMzQxaC0zNnYzNmg4LjU1M1YyMC44NDJoMjcuNDQ3eiIvPjxwYXRoIGQ9Ik0zNiAuNTczSDB2MzZoOC41NTFWOS4wNzRIMzZ6Ii8+PC9zdmc+
  10. // @license AGPL-v3.0
  11. // @grant GM_addStyle
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. let size = "200px";
  18.  
  19. GM_addStyle(`
  20. img {
  21. transition: max-width 0.4s ease-in-out, max-height 0.4s ease-in-out;
  22. max-width : ${size};
  23. max-height : ${size};
  24. object-fit: contain;
  25. }
  26. img:hover{
  27. max-width : 100%;
  28. max-height : 100%;
  29. }
  30. `)
  31.  
  32. })();

QingJ © 2025

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