ShadowGenius

Dark mode for Genius

  1. // ==UserScript==
  2. // @name ShadowGenius
  3. // @namespace https://thrasher.fun
  4. // @version 1.0.0
  5. // @description Dark mode for Genius
  6. // @author thrasher
  7. // @match https://*.genius.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15.  
  16. const darkModeStyles = `
  17. body { background-color: #292929; color: #BAB7BA; }
  18. .header { background-color: #1f1f1f; }
  19. .jAzSMw { background-color: #333333!important; color: #BAB7BA; }
  20. .cNCMgo { background-color: #333333!important; color: #BAB7BA; }
  21. .cNXXxk { color: #BAB7BA; }
  22. .dddWnX { color: #BAB7BA; }
  23. .hwdUNy { fill: #BAB7BA!important; }
  24. `;
  25.  
  26.  
  27. const styleElement = document.createElement('style');
  28. styleElement.textContent = darkModeStyles;
  29. document.head.appendChild(styleElement);
  30.  
  31.  
  32. const observer = new MutationObserver(mutations => {
  33. for (const mutation of mutations) {
  34. if (mutation.type === 'childList') {
  35. for (const node of mutation.addedNodes) {
  36. if (node.nodeType === Node.ELEMENT_NODE) {
  37. applyDarkMode(node);
  38. }
  39. }
  40. }
  41. }
  42. });
  43.  
  44. function applyDarkMode(element) {
  45. element.querySelectorAll('*').forEach(el => {
  46. if (el.classList.contains('lyrics')) {
  47. el.style.backgroundColor = '#333333';
  48. el.style.color = '#BAB7BA';
  49. }
  50. });
  51. }
  52.  
  53. observer.observe(document.body, { childList: true, subtree: true });
  54. })();

QingJ © 2025

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