Greasy Fork 支持简体中文。

CSS: meteoblue.com

Corrections to UI of meteoblue.com

目前為 2022-08-29 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name CSS: meteoblue.com
  3. // @description Corrections to UI of meteoblue.com
  4. // @author MK
  5. // @namespace max44
  6. // @homepage https://greasyfork.org/en/users/309172-max44
  7. // @match *://www.meteoblue.com/*
  8. // @icon https://www.meteoblue.com/favicon.ico
  9. // @version 1.3.7
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. //CSS for any mode
  15. var cssUniversal = `
  16. /*Position of cloud icons*/
  17. .picto .weekday.alt {
  18. line-height: unset !important;
  19. }
  20.  
  21. /*Font size of temperature*/
  22. .tab-content .tab-temp-max, .tab-content .tab-temp-min {
  23. line-height: 24.5px !important;
  24. font-size: 17.5px !important;
  25. }
  26.  
  27. /*Position and background of meteo condition icons in hourly forecast table*/
  28. .hourly-forecast .hourlywind .pictoicon {
  29. top: 0px !important;
  30. position: relative !important;
  31. width: unset !important;
  32. }
  33. tr.pictos-1h .picon {
  34. border-radius: 0px !important;
  35. }
  36. tr.pictos-1h > td > div > div[class$='_day'] {
  37. background-color: #88b7df !important;
  38. }
  39. tr.pictos-1h > td > div > div[class$='_night'] {
  40. background-color: #193f57 !important;
  41. }
  42.  
  43. /*Position of precipitation data in hourly forecast table*/
  44. .hourly-forecast .hourlywind .precip td span {
  45. position: unset !important;
  46. }
  47. .glyph.rain1h {
  48. margin-top: -49px !important;
  49. }
  50. .hourly-forecast .hourlywind .precip th span:not(.glyph.rain1h)/*:not([style^='margin-top'])*/ {
  51. position: unset !important;
  52. }
  53.  
  54. /*Dividers between cloud icons on 3 hours table*/
  55. .hourly-forecast .hourlywind tr.pictos_3h td {
  56. padding: 0 !important;
  57. border-right-color: gray !important;
  58. border-right-style: solid !important;
  59. border-right-width: thin !important;
  60. }
  61.  
  62. /*Headers*/
  63. h2, h3 {
  64. font-size: 150% !important;
  65. }
  66.  
  67. /*Adblock warning*/
  68. /*div[filter] {
  69. filter: none !important;
  70. }*/
  71. .page-header, .wrapper-main, .wrapper-sda, .navigation-scroll-container, .footer, .footer-quick {
  72. filter: none !important;
  73. }
  74. .unblock-div {
  75. display: none !important;
  76. }
  77. body.unblock {
  78. overflow: visible !important;
  79. margin-right: 0px !important;
  80. }
  81. `;
  82.  
  83. //CSS for light mode only
  84. var cssLight = `
  85. /*Active tab colour*/
  86. .tab.active {
  87. background: #fffeefff !important;
  88. /*background: #ffffff !important;*/
  89. }
  90. /*Tab colour*/
  91. .tab {
  92. background: #e7ecf0 !important;
  93. /*background: #eaeaea !important;*/
  94. }
  95. /*Predictability meter background*/
  96. .tab_content .tab_predictability .meter_outer {
  97. background-color: hsl(0, 0%, 96.9%) !important;
  98. }
  99.  
  100. /*Font color of precipitation probability in hourly forecast table*/
  101. tr.precip-prop > td > span {
  102. color: rgb(0, 64, 128) !important;
  103. }
  104. /*Font color of precipitation data in hourly forecast table*/
  105. .hourly-forecast .hourlywind .precip td span {
  106. color: rgb(0, 64, 128) !important;
  107. }
  108. `;
  109.  
  110. //Change body class to remove adblock warning
  111. const body = document.querySelector("body.unblock");
  112. if (body != null) {
  113. body.setAttribute("class", " ");
  114. }
  115.  
  116. const bodyMode = document.querySelector("body.dark");
  117. var css;
  118. if (bodyMode != null) {
  119. css = cssUniversal;
  120. } else {
  121. css = cssUniversal + cssLight;
  122. }
  123.  
  124. if (typeof GM_addStyle != 'undefined') {
  125. GM_addStyle(css);
  126. } else if (typeof PRO_addStyle != 'undefined') {
  127. PRO_addStyle(css);
  128. } else if (typeof addStyle != 'undefined') {
  129. addStyle(css);
  130. } else {
  131. var node = document.createElement('style');
  132. node.type = 'text/css';
  133. node.appendChild(document.createTextNode(css));
  134. document.documentElement.appendChild(node);
  135. }
  136. })();