Daymap TD Transparency

Makes all td elements transparent in Daymap while preserving content

目前為 2025-04-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Daymap TD Transparency
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Makes all td elements transparent in Daymap while preserving content
  6. // @author You
  7. // @match https://lefevrehs.daymap.net/daymap/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Function to apply transparency to all td elements
  15. function applyTdTransparency() {
  16. // Select all td elements
  17. const allTds = document.querySelectorAll('td');
  18.  
  19. // Apply transparency to each td
  20. allTds.forEach(td => {
  21. // Make the td itself transparent
  22. td.style.backgroundColor = 'transparent';
  23. td.style.backgroundImage = 'none';
  24.  
  25. // Ensure the content (like PlanClass) remains visible
  26. const content = td.querySelector('.PlanClass, .ttCell');
  27. if (content) {
  28. content.style.backgroundColor = ''; // Reset to default
  29. content.style.backgroundImage = ''; // Reset to default
  30. }
  31. });
  32. }
  33.  
  34. // Run the function initially
  35. applyTdTransparency();
  36.  
  37. // Also run it periodically in case content loads dynamically
  38. const observer = new MutationObserver(applyTdTransparency);
  39. observer.observe(document.body, {
  40. childList: true,
  41. subtree: true
  42. });
  43.  
  44. // Clean up observer when script is unloaded
  45. window.addEventListener('unload', () => {
  46. observer.disconnect();
  47. });
  48. })();