Ryf ES6 Helper & Styler

RT.

  1. // ==UserScript==
  2. // @name Ryf ES6 Helper & Styler
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description RT.
  6. // @author Maniacata
  7. // @match https://es6.ruanyifeng.com/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12.  
  13. //document.body.style.filter = "invert(1)";
  14. //document.body.style.background = "#333";
  15.  
  16. document.getElementById("content").style.width = "60vw";
  17.  
  18. let hSidebar = document.getElementById("sidebar");
  19. hSidebar.style.opacity = ".1";
  20. hSidebar.style.transition = "all .5s ease-in-out";
  21.  
  22.  
  23.  
  24. hSidebar.addEventListener("mouseover", () => {
  25. hSidebar.style.opacity = "1";
  26. });
  27. hSidebar.addEventListener("mouseout", () => {
  28. hSidebar.style.opacity = ".1";
  29. });
  30.  
  31. document.body.addEventListener("keydown", (event) => {
  32. var hash = getHash().nav;
  33. for (var i = 0; i < menu.length; i++) {
  34. if (hash === '') break;
  35. if (menu[i] === '#' + hash) break;
  36. }
  37.  
  38. if (event.key === "ArrowLeft") {
  39. location.hash = menu[i - 1];
  40. }
  41. if (event.key === "ArrowRight") {
  42. location.hash = menu[i + 1];
  43. }
  44. });
  45.  
  46. })();

QingJ © 2025

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