Greasy Fork is available in English.

YT 簡化-控制項+按鈕

YT簡化-控制項+按鈕+進度條自定義修改youtube Simplify - control items + buttons + progress bar customize

Från och med 2024-07-18. Se den senaste versionen.

  1. /* ==UserStyle==
  2. @name YT 簡化-控制項+按鈕
  3. @description YT簡化-控制項+按鈕+進度條自定義修改youtube Simplify - control items + buttons + progress bar customize
  4. @namespace https://greasyfork.org/zh-TW/users/4839
  5. @author leadra
  6. @preprocessor stylus
  7. @version 1.9.4
  8. @license MIT
  9. @var checkbox ctrl_thin "控制項簡化" 1
  10. @var checkbox hide_btn "隱藏自動播放" 1
  11. @var checkbox hide_btn1 "隱藏子母+迷你播放器" 1
  12. @var checkbox hide_btn2 "隱藏劇院+全螢幕" 1
  13. @var checkbox hide_btn3 "隱藏按鈕下載+超級感謝" 1
  14. @var checkbox hide_section "隱藏頻道音樂遊戲資訊" 0
  15. @var checkbox hide_right "隱藏右+下欄位" 0
  16. @var checkbox info_hide "隱藏影片右下資訊卡" 1
  17. @var checkbox hide_endcard "隱藏結束卡-移入才顯示" 1
  18. @var checkbox hide_ctrl "隱藏控制列-移入才顯示" 1
  19. @var checkbox hide_ico "隱藏標題右按鈕文字" 1
  20. @var checkbox btn_text "縮短會員+訂閱按鈕文字" 1
  21. @var color sub_background "未訂閱背景色" rgba(255, 0, 0, .5)
  22. @var checkbox title_h "縮短標題列間距" 1
  23. @var number title_top ">標題上間距" [0, -50, 50, 5, "px"]
  24. @var number title_line ">標題行距" [1, 0, 2, 0.1, "em"]
  25. @var checkbox hide_ad "影片列表-廣告隱藏" 1
  26. @var checkbox ad_resume "影片列表-看過影片變暗" 0
  27. @var checkbox noround_livechat "圓角去除-聊天室+影片" 0
  28. @var checkbox noround_btn "圓角去除-按鈕" 0
  29. @var checkbox progress_bar "進度條自定義" 1
  30. @var number progress_bar_size "進度條圖片大小" [50, 0, 200, 10, "px"]
  31. @var text progress_url "進度條URL" ""https://raw.githubusercontent.com/leadra/pic/main/kurara.gif""
  32. @var checkbox no_tab "--------*腳本Tabview----->按鈕極小化" 1
  33. @var checkbox scroll_hide ">卷軸Y隱藏" 1
  34. @var checkbox scroll_thin ">Tab卷軸thin" 1
  35. @var checkbox times_watched ">觀看次數位置上移" 0
  36. @var checkbox comment_width ">評論寬度" 1
  37. @var number ytliveclock "*擴充YouTubeLiveClock>控制列下移間距修正" [40, 0, 50, 5, "px"]
  38. ==/UserStyle== */
  39.  
  40. /*
  41. 搭配腳本用:
  42. ----------Tabview(腳本)---------按鈕極小化
  43. https://greasyfork.org/zh-TW/scripts/428651
  44. >>>觀看次數位置上移(搭配Tabview服用,以免標題列變窄)
  45. >>>卷軸Y隱藏
  46.  
  47. YT Speed Buttons(L改)
  48. https://greasyfork.org/zh-TW/scripts/484535
  49. >>>按鈕位置修改+大小
  50. */
  51.  
  52. /*引用感謝[CSS]
  53. YT隱藏控制項(滑鼠移入才會顯示https://greasyfork.org/zh-TW/scripts/446045
  54. YT隱藏進度條(滑鼠移入才會顯示https://greasyfork.org/zh-TW/scripts/437994
  55. YT播放器簡化https://greasyfork.org/zh-TW/scripts/445999
  56. YT網頁版面調整https://github.com/sapondanaisriwan/AdashimaaTube
  57. YT進度條突出顯示https://greasyfork.org/zh-TW/scripts/402635
  58. YT主題:皮卡丘介面https://userstyles.org/styles/194352/poketube
  59. YT電影廣告消除https://greasyfork.org/zh-TW/scripts/468212
  60. YT所有頁面:看過影片變暗https://greasyfork.org/zh-TW/scripts/419722
  61. YT隱藏「下載、剪輯和感謝(包括推廣)」按鈕https://greasyfork.org/zh-TW/scripts/447614
  62. YT隱藏結束卡https://greasyfork.org/zh-TW/scripts/408725
  63. YT會員訂閱按鈕https://github.com/sapondanaisriwan/AdashimaaTube/blob/master/userstyles/features/red-subscribe-button.user.css
  64. */
  65. @-moz-document url-prefix("https://www.youtube.com/watch?v="), url-prefix("https://www.youtube.com/shorts/"), url-prefix("https://www.youtube.com/live/") {
  66. /*顯示隱藏即時通訊鈕-高度調整//@var checkbox hide_chat_head "即時通訊鈕緊縮" 0
  67. if hide_chat_head{
  68. #show-hide-button > .ytd-live-chat-frame.style-scope{padding:0px!important;margin: -0px 0px -0px 0px!important;}
  69. //文字部分.yt-spec-button-shape-next--mono.yt-spec-button-shape-next--text{padding:0px!important;margin: -0px 0px -0px 0px!important;line-height:1em;height:1em;opacity:0.5;}
  70. //tabview聊天室新開視窗按鈕位置修正ytd-watch-flexy[flexy][is-two-columns_] #chat.tyt-chat-frame-ready:not([collapse]) tyt-iframe-popup-btn.tyt-btn-enabled {padding: 0px !important;margin: 0px 30px -0px 0px!important;width:2em;height:2em;bottom:auto;}}*/
  71.  
  72. //訂閱提醒框隱藏反黑
  73. yt-notification-action-renderer[darker-dark-theme] tp-yt-paper-toast.yt-notification-action-renderer{background-color: rgb(39, 39, 39);display:none !important;}
  74.  
  75. //去除圓角-聊天室+影片
  76. if noround_livechat {
  77. ytd-live-chat-frame#chat.ytd-watch-flexy{
  78. border-radius: 0px;
  79. }
  80. ytd-watch-flexy[rounded-player-large]:not([fullscreen]):not([theater]) #ytd-player.ytd-watch-flexy {
  81. border-radius: 0px !important;
  82. }}
  83. //去除圓角-按鈕
  84. if noround_btn {
  85. html .yt-spec-button-shape-next--size-m,
  86. html .yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--segmented-start,
  87. html .yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--icon-button.yt-spec-button-shape-next--segmented-end{
  88. border-radius:0;
  89. }}
  90. //控制項簡化:保留音量提示
  91. if ctrl_thin{
  92. .ytp-bezel,//中間LOGO
  93. .ytp-doubletap-ui-legacy,//左右側前進、後退
  94. .ytp-doubletap-ui,//去除縮略圖上的播放提示
  95. .ytp-gradient-top,//上邊漸進黑
  96. //.ytp-gradient-bottom,//下邊漸進黑
  97. .ytp-chrome-top,//全螢幕上方標題
  98. .ytp-pause-overlay,//暫停
  99. //.annotation//註解
  100. //.ytp-pip-button.ytp-button,//子母畫面(舊版)
  101. //.ytp-size-button.ytp-button,//劇院模式
  102. //.ytp-miniplayer-button.ytp-button,//迷你
  103. //.ytp-autonav-toggle-button,//自動播放(背景元素無法去除)
  104. //.c4-player-container.c4-flexible-player-container,
  105. ytd-thumbnail-overlay-loading-preview-renderer{
  106. display:none !important;
  107. }
  108.  
  109. }
  110. /*隱藏控制列-移入顯示+控制列黑底*/
  111. if hide_ctrl{
  112. .ytp-gradient-bottom,.ytp-chrome-bottom {opacity:0;}
  113. .ytp-chrome-bottom:hover {opacity:1;background:rgba(0, 0, 0, .4);}
  114. }
  115.  
  116. /*隱藏按鈕>自動播放;子母畫面(新版)+迷你;劇院+全螢幕*/
  117. if hide_btn{[data-tooltip-target-id="ytp-autonav-toggle-button"],{display:none !important;}}
  118. if hide_btn1{#movie_player div.ytp-chrome-controls button.ytp-pip-button.ytp-button,.ytp-miniplayer-button{display:none !important;}}
  119. if hide_btn2{.ytp-size-button,.ytp-fullscreen-button{display:none !important;}}//.ytp-multicam-button,.ytp-remote-button,.ytp-settings-button
  120.  
  121. /*隱藏按鈕>下載+超級感謝*/
  122. if hide_btn3{ytd-download-button-renderer ,#flexible-item-buttons [aria-label="Thanks"],#flexible-item-buttons [aria-label="超級感謝"] {display: none !important;}}
  123. //yt-button-view-model:has([aria-label="超級感謝"]) {display: none !important;}
  124.  
  125. /*影片列表-電影購買+廣告隱藏*/
  126. if hide_ad{
  127. //影片列表-電影購買[https://greasyfork.org/zh-TW/scripts/468212]
  128. ytd-watch-next-secondary-results-renderer.ytd-watch-flexy ytd-compact-movie-renderer.style-scope.ytd-item-section-renderer ,#offer-module.ytd-watch-next-secondary-results-renderer{display: none;}
  129. //影片列表-廣告
  130. td-promoted-sparkles-web-renderer,ytd-ad-slot-renderer{display: none;}
  131. }
  132. /*影片列表-看過影片變暗[腳本全網域https://greasyfork.org/zh-TW/scripts/419722]*/
  133. if ad_resume{
  134. //#progress.ytd-thumbnail-overlay-resume-playback-renderer {bottom: 0px; position: absolute;z-index:1;background: rgba(0, 0, 0, .5);min-height: 95px;}
  135. ytd-thumbnail-overlay-resume-playback-renderer::after {
  136. background: rgba(0, 0, 0, .5);
  137. content: "看過"; //text-align:center;
  138. font-size:20px;
  139. display: block;
  140. bottom: 0;
  141. height: 95px;
  142. width: 100%;
  143. position: absolute;
  144. z-index: 10;
  145. }}
  146. //隱藏資訊卡
  147. if info_hide {#columns #player .ytp-iv-player-content, ytd-watch-flexy .ytp-iv-player-content{display: none;}}
  148.  
  149. //縮短標題列間距
  150. if title_h{
  151. //Enhancer for YouTube™修正
  152. html[tyt-deferred][sxmq8="1"] ytd-watch-flexy:not([hidden]) ytd-watch-metadata.style-scope.ytd-watch-flexy{margin: 0px 0px -0px 0px!important;padding:0 !important;}
  153. //Tabview
  154. body ytd-watch-flexy[cinematics-enabled] #below.ytd-watch-flexy{margin: 0px 0px 0px 0px!important;}
  155. //無Tabview
  156. ytd-watch-metadata.ytd-watch-flexy,[rounded-info-panel] #clarify-box.ytd-watch-flexy{margin: 0px 0px 0px 0px!important;}
  157. //標題上間距
  158. #below h1.ytd-watch-metadata ,yt-formatted-string[data-title-details]{line-height:title_line;margin: title_top 0px -0px 0px!important;}
  159. //頻道名稱上下方空白
  160. .style-scope.ytd-watch-metadata{margin: -0px 0px -0px 0px!important;}
  161. #top-row.ytd-watch-metadata{margin: -0px 0px -0px 0px!important;}
  162. //會員專屬標題
  163. .badge-style-type-members-only.ytd-badge-supported-renderer {margin:-0px 0px -60px 140px; position:relative; z-index: 1; background: rgba(0, 0, 0, .5);}
  164. //頻道名稱
  165. .style-scope.ytd-video-owner-renderer{
  166. padding:0px 0px;
  167. margin: 0px 0px 0px -0px!important;
  168. //max-width: 350px!important;
  169. line-height:1em!important;
  170. }
  171. //.ytd-channel-name{padding:0px 0px 0px 0px;margin: 0px 0px 0px -0px;}
  172. //#upload-info.ytd-video-owner-renderer{padding:0;margin: -0px 0px -0px -0px!important;}
  173. //頻道訂閱數
  174. #owner-sub-count.ytd-video-owner-renderer{
  175. font-size: 16px;
  176. line-height:1em!important;
  177. }
  178. //觀看次數文字
  179. #info-container.ytd-watch-info-text{
  180. margin: 0px 0px 0px 10px!important;
  181. padding:0px!important;
  182. font-size:18px!important;
  183. }
  184. //標題列右側按鈕
  185. #actions-inner.ytd-watch-metadata{max-width: 80%;}
  186. .yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--icon-leading-trailing .yt-spec-button-shape-next__secondary-icon{margin:0px;}
  187. .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal {padding:0px 5px;}
  188. //.yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--icon-leading-trailing .yt-spec-button-shape-next__icon{margin: 0px;}
  189. //.yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--icon-leading .yt-spec-button-shape-next__icon {margin: 0px;}
  190. .yt-spec-button-shape-next__icon{margin: 0px!important;}
  191. }
  192.  
  193. //縮短會員+訂閱按鈕文字
  194. if btn_text{
  195. //標題列加入會員按鈕#owner
  196. ytd-button-renderer .yt-spec-button-shape-next__button-text-content{
  197. //max-width:3em;
  198. font-weight:bold;
  199. font-size: 1.6em;
  200. margin: -0px -0px -0px -0px!important;
  201. padding: 0px!important;
  202. }
  203. /*會員訂閱按鈕*/
  204. #notification-preference-button > ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button {
  205. //小鈴鐺已訂閱&.yt-spec-button-shape-next.yt-spec-button-shape-next--tonal {background-color:sub_background !important;}
  206. /*下拉箭頭*/
  207. > div {&.yt-spec-button-shape-next__secondary-icon {display: none !important;}}
  208. }
  209. //已加會員按鈕
  210. yt-button-shape:not(:hover) {
  211. .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--filled {
  212. color: var(--yt-spec-static-brand-white) !important;
  213. background-color: rgba(255, 255, 255, .3) !important;//var(--yt-spec-badge-chip-background)
  214. border-style:double;
  215. padding: 0px 10px !important;
  216. }
  217. }
  218. //未訂閱(含Shorts)
  219. yt-button-shape.ytd-subscribe-button-renderer:not([hidden]) {
  220. .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--filled ,
  221. .yt-spec-button-shape-next--overlay.yt-spec-button-shape-next--filled {
  222. color: var(--yt-spec-static-brand-white) !important;
  223. background-color: sub_background !important;//var(--yt-spec-badge-chip-background)
  224. padding: 0px 10px !important;
  225. }
  226. }
  227. //標題列訂閱按鈕
  228. #subscribe-button-shape .yt-spec-button-shape-next__button-text-content{
  229. max-width:1em;
  230. font-weight:bold;
  231. font-size: 1.5em;
  232. margin: -0px -0px -0px -0px!important;
  233. padding: 0px!important;
  234. }
  235. ytd-subscribe-button-renderer .yt-spec-button-shape-next__button-text-content{max-width:0em;}
  236. ytd-video-owner-renderer .yt-spec-button-shape-next__button-text-content{max-width:1em;}
  237. //span.yt-core-attributed-string.yt-core-attributed-string--white-space-no-wrap {display: none;}
  238. }
  239.  
  240. //隱藏標題列右側按鈕文字
  241. if hide_ico {
  242. yt-button-view-model .yt-spec-button-shape-next__button-text-content,
  243. ytd-download-button-renderer .yt-spec-button-shape-next__button-text-content ,
  244. yt-touch-feedback-shape .yt-spec-button-shape-next__button-text-content,
  245. {display: none !important;}
  246. }
  247.  
  248. //隱藏頻道音樂遊戲資訊🎵🎮
  249. if hide_section{ytd-video-description-infocards-section-renderer , ytd-horizontal-card-list-renderer.style-scope.ytd-structured-description-content-renderer , #contents.ytd-rich-metadata-row-renderer {display: none ;}}
  250. //隱藏右+下欄位
  251. if hide_right{ytd-watch-flexy[cinematics-enabled] #secondary.ytd-watch-flexy {display: none ;}//{position: fixed ; z-index: 1;left:0;opacity:0.7}
  252. ytd-watch-metadata.watch-active-metadata.style-scope.ytd-watch-flexy{display: none ;}
  253. }
  254.  
  255. //隱藏結束連結卡
  256. if hide_endcard {
  257. div[class*="video-player"]:not(:hover) div[class^="ytp-ce"],
  258. div[class*="ytp-autohide"] div[class^="ytp-ce"] {
  259. display: none !important;
  260. }}
  261.  
  262. /*炒飯進度條*/
  263. if progress_bar{
  264. .ytp-scrubber-button,.ytp-play-progress {
  265. background: #ffe100a6;
  266. transform: rotate(0deg);
  267. filter: drop-shadow(0 0 1px gold) drop-shadow(0 0 2px gold) drop-shadow(0 0 3px gold);
  268. }
  269. /*控制項高亮*/
  270. .ytp-volume-panel:hover,
  271. .ytp-chrome-controls a:hover svg,
  272. .ytp-chrome-controls button:hover svg {
  273. filter: drop-shadow(0 0 1px black) drop-shadow(0 0 2px gold) drop-shadow(0 0 5px gold) !important;
  274. }
  275. //進度條調整
  276. .ytp-scrubber-pull-indicator {
  277. background-color: #fff0;
  278. height: progress_bar_size;
  279. width: progress_bar_size;
  280. background-image: url(progress_url);
  281. background-repeat: no-repeat;
  282. background-position: center;
  283. background-size: progress_bar_size;
  284. bottom: 0px;
  285. left: progress_bar_size *-(6.5/10) ;
  286. transform: rotate(0deg);
  287. transform: scale(1.1);
  288. border-radius: 0px
  289. }}
  290.  
  291. /*
  292. @var checkbox chat_height "聊天室延伸(tabview衝突)" 0
  293. @var number chat_width "聊天室欄寬" [400, 300, 800, 10, "px"]
  294. // 聊天室延伸(tabview腳本衝突) チャット欄を画面一番下まで伸ばす
  295. if chat_height { ytd-live-chat-frame#chat {height: calc(100vh *0.92) !important; //height: calc(100vh - 100px)}
  296. // chat欄位無邊界+影片上方空白消除+chat聊天室欄寬
  297. #columns {margin: -0px 0px 0px 0px !important; max-width: 100% !important;
  298. & > #primary,& > #secondary{padding-top: 0!important;}
  299. & > #secondary {width: chat_width;}}}
  300. */
  301. //Tabview(腳本)按鈕極小化
  302. if no_tab {
  303. ytd-watch-flexy #right-tabs .tab-btn[tyt-tab-content]{
  304. padding:0;
  305. font-size:18px;
  306. line-height:1em;
  307. }
  308. }
  309. //卷軸Y隱藏
  310. if scroll_hide{
  311. html {
  312. scrollbar-color: none !important;
  313. scrollbar-width: none !important;
  314. }
  315. ::-webkit-scrollbar {
  316. display:none!important;
  317. }
  318. }
  319. //Tab卷軸none #tab-comments #tab-videos #tab-info
  320. ytd-watch-flexy #right-tabs .tab-content-cld{
  321. scrollbar-width: none !important;
  322. }
  323. //Tab卷軸thin
  324. if scroll_thin{
  325. ytd-watch-flexy #right-tabs .tab-content-cld{
  326. scrollbar-width: thin !important;
  327. }
  328. }
  329.  
  330. //觀看次數上移
  331. if times_watched {
  332. //觀看次數區
  333. #bottom-row.ytd-watch-metadata{
  334. font-size:13em!important;
  335. margin: 0px!important;
  336. max-width: 25%!important;
  337. position: fixed;
  338. z-index:-10;
  339. left:25%;
  340. bottom:0%;
  341. }
  342. }
  343. //評論寬度+文字大小
  344. if comment_width {
  345. #content-text.ytd-comment-view-model{
  346. font-size:comment_size;
  347. }
  348. ytd-watch-flexy .tab-content-cld#tab-comments{
  349. padding:0px 0px !important;
  350. margin:0px 0px 0px 0px !important;
  351. overflow-x:hidden;
  352. //position:relative;
  353. }
  354. #body.ytd-comment-view-model{
  355. margin:0px 0px 0px 0px !important;
  356. ytd-expander>*{
  357. padding:0px !important;
  358. margin:0px 10px 0px 0px !important;
  359. width: 110%!important;
  360. }
  361. }
  362. .ytd-comment-view-model{
  363. padding:0px !important;
  364. margin:0px 0px 0px 0px !important;
  365. }
  366. .ytd-comment-view-model #author-thumbnail{
  367. padding:0px !important;
  368. margin:0px 5px 0px 0px !important;
  369. }
  370. }
  371. //資訊文字大小@var number comment_size ">評論資訊文字大小" [17, 10, 30, 1, "px"]
  372. /*
  373. #description.ytd-video-secondary-info-renderer{
  374. font-size:comment_size;
  375. }*/
  376.  
  377. //擴充YouTubeLiveClock控制列間距修正
  378. html:has(style#ytlc-style-for-native-control) ytd-watch-flexy[flexy][is-two-columns_][theater] #columns.ytd-watch-flexy,
  379. html:has(style#ytlc-style-for-native-control) #columns.ytd-watch-flexy #player::after {
  380. margin: ytliveclock 0px 0px 0px!important;
  381. padding:0px!important;
  382. }
  383. }