Linux do Theme

Linux Do主题插件

  1. // ==UserScript==
  2. // @name Linux do Theme
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-06-08
  5. // @description Linux Do主题插件
  6. // @author C碳化钨
  7. // @match https://linux.do/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant GM_addStyle
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. let css = `
  17. .topic-map {
  18. border-radius: 16px !important;
  19. padding: 8px !important;
  20. background: rgba(255, 255, 255, 0.6) !important;
  21. -webkit-backdrop-filter: blur(10px) !important;
  22. backdrop-filter: blur(10px) !important;
  23.  
  24. }
  25.  
  26. .d-header {
  27. background: rgba(255, 255, 255, 0.8) !important;
  28. -webkit-backdrop-filter: blur(10px) !important;
  29. backdrop-filter: blur(10px) !important;
  30. }
  31.  
  32. #main-outlet-wrapper {
  33. margin-top: 30px !important;
  34. border-radius: 20px !important;
  35. background-color: rgba(255, 255, 255, 0.8) !important;
  36. }
  37.  
  38. .sidebar-wrapper {
  39. border-radius: 20px !important;
  40. background: rgba(255, 255, 255, 0.7) !important;
  41. -webkit-backdrop-filter: blur(10px) !important;
  42. backdrop-filter: blur(10px) !important;
  43. height: calc(var(--composer-vh, var(--1dvh))*100 - var(--header-offset, 0px) - 30px) !important;
  44. }
  45.  
  46. .chat-channel {
  47. height: calc(var(--chat-vh, 1vh)*100 - var(--header-offset, 0px) - var(--composer-height, 0px) - 1px - var(--chat-header-offset, 0px) - 70px) !important;
  48. }
  49.  
  50. .timeline-handle {
  51. background-color: var(--tertiary) !important
  52. }
  53.  
  54. #main-outlet {
  55. padding: 20px !important;
  56. border-radius: 20px !important;
  57. box-shadow: none !important;
  58. }
  59.  
  60. .cooked,
  61. .about .details,
  62. .user-content {
  63. padding: 20px !important;
  64. }
  65.  
  66. .fk-d-menu__inner-content,
  67. .select-kit-body,
  68. .chat-drawer-container,
  69. .search-header,
  70. .cooked,
  71. .about .details,
  72. .user-content,
  73. #reply-control,
  74. .chat-channel,
  75. .badge-card {
  76. background: rgba(255, 255, 255, 0.6) !important;
  77. -webkit-backdrop-filter: blur(8px) !important;
  78. backdrop-filter: blur(8px) !important;
  79. }
  80.  
  81. .fk-d-menu__inner-content,
  82. .fk-d-menu__inner-content .user-card,
  83. .no-bg,
  84. .fk-d-menu__inner-content .card-content,
  85. .search-header,
  86. .cooked,
  87. .about .details,
  88. .user-content {
  89. border-radius: 16px !important;
  90. }
  91.  
  92. #reply-control,
  93. .embedded-posts,
  94. .select-kit-body{
  95. border-radius: 8px !important;
  96. }
  97.  
  98. .no-bg .card-content,
  99. .no-bg,
  100. .search-header div {
  101. background: transparent !important;
  102. border: none !important;
  103. }
  104.  
  105. .alert.alert-info {
  106. border-radius: 8px !important;
  107. background: rgb(200, 225, 235) !important;
  108. }
  109.  
  110. .chat-drawer-container,
  111. .chat-channel {
  112. overflow: hidden !important;
  113. border-radius: 8px !important;
  114. }
  115.  
  116. .menu-panel {
  117. border-radius: 20px !important;
  118. background: rgba(255, 255, 255, 0.8) !important;
  119. -webkit-backdrop-filter: blur(10px) !important;
  120. backdrop-filter: blur(10px) !important;
  121. }
  122.  
  123. .search-menu-panel{
  124. backdrop-filter: none !important;
  125. }
  126.  
  127. .discourse-tag.box{
  128. border-radius: 5px !important;
  129. color: var(--secondary) !important;
  130. background: rgba(102, 204, 255, 0.6) !important;
  131. }
  132.  
  133.  
  134. .notification {
  135. margin: 2px 0px !important;
  136. border-radius: 8px !important;
  137. }
  138.  
  139. body{
  140. background-image: url("https://pixiv.re/119236407.png");
  141. background-repeat: no-repeat;
  142. background-size: cover;
  143. background-attachment: fixed
  144. }
  145. `
  146.  
  147.  
  148.  
  149.  
  150. function listenerChange(selector, fn) {
  151. const element = document.querySelector(selector);
  152. if (element) {
  153. new MutationObserver(() => fn()).observe(element, { subtree: true, characterData: true, childList: true, attributes: true });
  154. } else {
  155. console.warn(`元素 ${selector} 不存在`);
  156. }
  157. }
  158.  
  159. function addGoTopButton(){
  160.  
  161. if (!document.querySelector("#go_top_buton")){
  162. let btn = $('<button id="go_top_buton" class="btn btn-small" style="background-color:var(--tertiary);color:#FFFFFF">回到顶部</button>');
  163.  
  164. btn.on('click', function() {
  165. $('html, body').animate({
  166. scrollTop: 0
  167. }, 500);
  168. });
  169.  
  170. // 添加按钮到页面的某个元素
  171. $('.timeline-footer-controls').append(btn);
  172. }
  173. }
  174.  
  175. listenerChange('title', () => addGoTopButton());
  176.  
  177. GM_addStyle(css);
  178.  
  179. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址