CSS: marinetraffic.com

Corrections to UI of marinetraffic.com

目前为 2021-01-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CSS: marinetraffic.com
  3. // @description Corrections to UI of marinetraffic.com
  4. // @author MK
  5. // @homepage https://greasyfork.org/en/scripts/419350
  6. // @namespace https://greasyfork.org/users/309172
  7. // @include https://www.marinetraffic.com/*
  8. // @include http://www.marinetraffic.com/*
  9. // @version 1.1
  10. // @note v1.1 2021-01-01 - code is rewritten to add CSS to the end of the document instead of <HEAD> tag in order to overcome possible server side CSS with !important rule
  11. // @note v1.0 2020-12-29 - initial release
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. var css = `
  16. .under-map-wrapper {
  17. height: 0px !important;
  18. }
  19. /*Make the 2nd div (space under the map) in d-flex invisible*/
  20. .d-flex.flex-column.flex-1-1-auto.align-self-stretch > div:nth-of-type(2) {
  21. margin-top: 0px !important;
  22. margin-bottom: 0px !important;
  23. height: 0px !important;
  24. }
  25.  
  26. /*Make right panel invisible*/
  27. .d-flex.flexcol.align-items-start.justify-content-start.flex-wrap.flex-0-0-auto {
  28. margin-top: 0px !important;
  29. margin-bottom: 0px !important;
  30. height: 0px !important;
  31. width: 0px !important;
  32. }
  33.  
  34. .underMapAdMobile {
  35. margin-top: 0px !important;
  36. margin-bottom: 0px !important;
  37. height: 0px !important;
  38. width: 0px !important;
  39. }
  40. `;
  41.  
  42. if (typeof GM_addStyle != 'undefined') {
  43. GM_addStyle(css);
  44. } else if (typeof PRO_addStyle != 'undefined') {
  45. PRO_addStyle(css);
  46. } else if (typeof addStyle != 'undefined') {
  47. addStyle(css);
  48. } else {
  49. var node = document.createElement('style');
  50. node.type = 'text/css';
  51. node.appendChild(document.createTextNode(css));
  52. document.documentElement.appendChild(node);
  53. }
  54. })();