Clean Twitter

Make Twitter Experience Even Better

当前为 2021-11-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Clean Twitter
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Make Twitter Experience Even Better
  6. // @author Cactus
  7. // @match https://twitter.com/home
  8. // @icon https://www.google.com/s2/favicons?domain=twitter.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. function addGlobalStyle(css) {
  13. var head, style;
  14. head = document.getElementsByTagName('head')[0];
  15. if (!head) {
  16. return;
  17. }
  18. style = document.createElement('style');
  19. style.type = 'text/css';
  20. style.innerHTML = css;
  21. head.appendChild(style);
  22. }
  23.  
  24. (function () {
  25. 'use strict';
  26. var css = `
  27. /* Remove Logo */
  28. [aria-label="Twitter"] {
  29. display: none;
  30. }
  31.  
  32.  
  33. /*
  34. * LEFT COLUMN
  35. */
  36.  
  37. /* Remove nav I don't use */
  38. /* [aria-label="Search and explore"],
  39. [aria-label="Bookmarks"],
  40. [aria-label="Lists"]
  41. {
  42. display: none;
  43. } */
  44.  
  45.  
  46. [aria-label="Lists"],
  47. [aria-label="Search and explore"]
  48. /*[aria-label="Notifications"]*/
  49.  
  50. {display: none;}
  51.  
  52.  
  53. /* Less visual weight for nav options */
  54. [aria-label="Primary"] [dir="auto"] {
  55. font-size: 1rem;
  56. font-weight: 400;
  57. }
  58.  
  59. /* Tigher grouping */
  60. [aria-label="Primary"] a {
  61. padding: 0;
  62. }
  63.  
  64. /* Hide distracting profile toggle */
  65.  
  66. /*
  67. [data-testid="SideNav_AccountSwitcher_Button"] {
  68. display: none;
  69. }
  70. */
  71.  
  72. /*
  73. * TWEET BUTTON
  74. */
  75.  
  76. /* Make button flatter, less loud */
  77. [aria-label="Tweet"] {
  78. border: none;
  79. box-shadow: none;
  80. background-color: #7856FF;
  81. }
  82.  
  83. /* Style to look like other UI */
  84. [aria-label="Tweet"] div {
  85. color: #f4f8fa;
  86. }
  87.  
  88. [aria-label="Tweet"]:hover {
  89. filter: none;
  90. }
  91.  
  92. [aria-label="Tweet"]:hover {
  93. background-color: #f4f8fa;
  94. }
  95.  
  96. [aria-label="Tweet"]:hover div {
  97. color: #7856FF;
  98. }
  99.  
  100.  
  101.  
  102.  
  103. /*
  104. * RIGHT COLUMN
  105. */
  106.  
  107. /* See ya later, racism aggregator */
  108. [aria-label="Timeline: Trending now"] {
  109. display: none;
  110. }
  111.  
  112. /* Less visual weight for who to follow */
  113. [aria-label="Who to follow"] [aria-level="2"][role="heading"] .r-1qd0xha {
  114. font-size: 1rem;
  115. }
  116.  
  117. /* Tone down unfollow */
  118. [data-testid="16515870-unfollow"] {
  119. filter: grayscale(1);
  120. opacity: 0.5;
  121. }
  122.  
  123. /* Remove the background color from Who to Follow */
  124. [data-testid="sidebarColumn"] .r-1u4rsef {
  125. background-color: transparent !important;
  126. }
  127.  
  128.  
  129. /*
  130. * DM DRAWER
  131. */
  132.  
  133. [data-testid="DMDrawer"] {
  134. display: none;
  135. }
  136.  
  137. nav.css-1dbjc4n.r-18u37iz.r-1w6e6rj.r-ymttw5 {
  138. display: none;
  139.  
  140. }
  141.  
  142. /* Hide browser scrollbar */
  143. ::-webkit-scrollbar {
  144. display:none;
  145.  
  146. }
  147.  
  148. div.css-1dbjc4n.r-1wtj0ep.r-ymttw5.r-1f1sjgu {
  149. display: none;
  150.  
  151. }
  152.  
  153.  
  154.  
  155. div.css-1dbjc4n.r-1uaug3w.r-1uhd6vh.r-1867qdf.r-1phboty.r-rs99b7.r-1ifxtd0.r-1bro5k0.r-1udh08x {
  156. display: none;
  157. }
  158.  
  159. div.css-1dbjc4n.r-1uaug3w.r-1uhd6vh.r-1867qdf.r-1phboty.r-rs99b7.r-1ifxtd0.r-1udh08x {
  160. display: none;
  161. }
  162.  
  163. div.css-1dbjc4n.r-yfoy6g.r-18bvks7.r-1867qdf.r-1phboty.r-rs99b7.r-1ifxtd0.r-1udh08x {
  164. display: none;
  165.  
  166. }
  167.  
  168. div.css-1dbjc4n.r-1awozwy.r-aqfbo4.r-yfoy6g.r-18u37iz.r-1h3ijdo.r-6gpygo.r-15ysp7h.r-1xcajam.r-ipm5af.r-1hycxz.r-136ojw6 {
  169. padding-top: 110px;
  170. }
  171.  
  172. div.css-1dbjc4n.r-1awozwy.r-1m3jxhj.r-xnswec.r-18u37iz.r-1d7fvdj.r-d9fdf6.r-tvv088.r-13qz1uu {
  173. display: none;
  174.  
  175. }
  176. `;
  177. addGlobalStyle(css);
  178. })();