Greasy Fork 支持简体中文。

CSS: ventusky.com

Corrections to UI of ventusky.com

  1. // ==UserScript==
  2. // @name CSS: ventusky.com
  3. // @description Corrections to UI of ventusky.com
  4. // @author MK
  5. // @namespace max44
  6. // @homepage https://greasyfork.org/en/users/309172-max44
  7. // @match *://www.ventusky.com/*
  8. // @icon https://www.ventusky.com/images/favicon.ico
  9. // @version 1.3.3
  10. // @license MIT
  11. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  12. // @run-at document-idle
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. //Workaround: This document requires 'TrustedHTML' assignment
  19. if (window.trustedTypes && trustedTypes.createPolicy) {
  20. if (!trustedTypes.defaultPolicy) {
  21. const passThroughFn = (x) => x;
  22. trustedTypes.createPolicy('default', {
  23. createHTML: passThroughFn,
  24. createScriptURL: passThroughFn,
  25. createScript: passThroughFn,
  26. });
  27. }
  28. }
  29.  
  30. var css = `
  31. /*Remove App button*/
  32. li#menu-app {
  33. display: none !important;
  34. }
  35.  
  36. /*Remove Download App button (Android)*/
  37. a[href^="https://play.google.com"] {
  38. display: none !important;
  39. }
  40.  
  41. /*Remove Download App button (iOS)*/
  42. a[href^="https://itunes.apple.com"] {
  43. display: none !important;
  44. }
  45.  
  46. /*Remove Premium button*/
  47. li #menu-premium {
  48. display: none !important;
  49. }
  50.  
  51. /*Smaller header*/
  52. form#header {
  53. height: unset !important;
  54. padding: unset !important;
  55. background: unset !important;
  56. background-size: unset !important;
  57. width: 50% !important;
  58. }
  59. form#header::after {
  60. background: unset !important;
  61. }
  62.  
  63. /*Smaller menu button*/
  64. /*menu::before {
  65. padding-left: unset !important;
  66. line-height: 3em !important;
  67. border-radius: 2em !important;
  68. }*/
  69.  
  70. /*Position and size of Find my position button*/
  71. #header .r {
  72. top: .3em !important;
  73. width: 2.0em !important;
  74. height: 2.0em !important;
  75. }
  76.  
  77. /*New settings button for mobile version*/
  78. menu2 a {
  79. right: 1em !important;
  80. text-align: center !important;
  81. border-radius: 2em !important;
  82. box-shadow: 0 1.5px 3px rgba(0,0,0,.25) !important;
  83. background: #fff !important;
  84. line-height: 2.125em !important;
  85. height: 2.125em !important;
  86. width: 5em !important;
  87. color: #12507f !important;
  88. display: block !important;
  89. position: absolute !important;
  90. }
  91. `;
  92.  
  93. if (typeof GM_addStyle != 'undefined') {
  94. GM_addStyle(css);
  95. } else if (typeof PRO_addStyle != 'undefined') {
  96. PRO_addStyle(css);
  97. } else if (typeof addStyle != 'undefined') {
  98. addStyle(css);
  99. } else {
  100. var node = document.createElement('style');
  101. node.type = 'text/css';
  102. node.appendChild(document.createTextNode(css));
  103. document.documentElement.appendChild(node);
  104. }
  105.  
  106. //Change Menu button to Settings button on mobile version
  107. let waitForMenu = setInterval(function() { //Check page content constantly
  108. var menuLi = document.querySelector("menu li");
  109. if (menuLi != null) {
  110. if (getComputedStyle(menuLi).float === "none") { //If menu item is for mobile browser
  111. var menu2 = document.querySelector("#menu2");
  112. if (menu2 == null) $("body").append('<menu2 id="menu2"></menu2>');
  113. menu2 = document.querySelector("#menu2");
  114. if (menu2 != null) {
  115. $("li#menu-settings").appendTo("#menu2");
  116. $("body > menu").hide();//remove();
  117. clearInterval(waitForMenu);
  118. }
  119. } else clearInterval(waitForMenu); //Stop waiting, because it is not mobile browser
  120. }
  121. }, 100); //Interval to check page content
  122.  
  123. })();