YouTube Live Borderless

Make YouTube Live Borderless

当前为 2022-12-30 提交的版本,查看 最新版本

  1. /* ==UserStyle==
  2. @name YouTube Live Borderless
  3. @version 0.1.13
  4. @namespace github.com/cyfung1031
  5. @license MIT
  6. @description Make YouTube Live Borderless
  7. @author CY Fung
  8. @supportURL https://github.com/cyfung1031/YouTube-Live-Borderless/
  9. @preprocessor stylus
  10. @var checkbox apply-to-live-chat-only "Apply to Live Chat Only" 1
  11. @var checkbox no-masthead "Hide Top Masthead Bar" 0
  12. @var range masthead-hoverable-height "Height of Invisible MastHead Bar" [0, 0, 12, 2, "px"]
  13. @var range chrome-bottom-bar-margin "Chrome Bottom Bar Margin" [12, 6, 48, 6, "px"]
  14. @var range primary-content-margin "Primary Content Margin" [24, 6, 48, 6, "px"]
  15. @var checkbox no-bottom-row "Hide Primary MetaInfo Bottom Row" 0
  16. @var range video-title-size "Video Title Size" [2.0, 1.0, 3.0, 0.2, "rem"]
  17. @var number side-panel-width "Side Panel Width" [440, 320, 640, 20, "px"]
  18. @var checkbox no-round-border "No Round Border" 1
  19. ==/UserStyle== */
  20.  
  21. @-moz-document url-prefix("https://www.youtube.com/watch?v=")
  22. contentf(){
  23. &:not([tabview-loaded]){
  24. #primary-inner.ytd-watch-flexy ytd-comments#comments.ytd-watch-flexy,
  25. #secondary-inner.ytd-watch-flexy > #related.ytd-watch-flexy {
  26. display:none !important;
  27. }
  28.  
  29. #player-theater-container{
  30. max-height: calc(100vh - 100px) !important;
  31. }
  32. #cinematics{
  33. // contain: layout;
  34. contain: layout size style;
  35. user-select: none;
  36. touch-action: none;
  37. pointer-events: none;
  38. }
  39. }
  40. if no-masthead {
  41. &,
  42. ytd-app,
  43. ytd-page-manager[class].style-scope,
  44. ytd-watch-flexy[class].style-scope {
  45. /* 0px not 0 */
  46. --ytd-masthead-height: 0px;
  47. --ytd-toolbar-height: 0px;
  48. --ytd-watch-flexy-masthead-height: 0px;
  49. }
  50. #masthead-container {
  51. opacity: 0 !important;
  52. transition: opacity 300ms;
  53. min-height: masthead-hoverable-height;
  54. }
  55. #masthead-container:not(:hover) > ytd-masthead {
  56. display: none !important;
  57. }
  58. if masthead-hoverable-height > 0 {
  59.  
  60. #masthead-container:hover {
  61. opacity: 1 !important;
  62. }
  63.  
  64. #masthead-container::after {
  65. content: '';
  66. display: flex;
  67. width: 100%;
  68. height: masthead-hoverable-height;
  69. top: 0;
  70. z-index: 99999;
  71. }
  72. }
  73. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]):not([theater]) {
  74.  
  75. #columns.style-scope.ytd-watch-flexy,
  76. #primary.style-scope.ytd-watch-flexy,
  77. #primary-inner.style-scope.ytd-watch-flexy,
  78. #secondary.style-scope.ytd-watch-flexy,
  79. #secondary-inner.style-scope.ytd-watch-flexy {
  80. height: 100vh;
  81. max-height: 100%;
  82. }
  83. }
  84.  
  85. ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) {
  86.  
  87. height:100vh;
  88. #player-theater-container.ytd-watch-flexy {
  89. flex: 77;
  90. max-height: unset;
  91. }
  92. #player-theater-container.ytd-watch-flexy ~ #columns.style-scope.ytd-watch-flexy {
  93. overflow: visible;
  94. }
  95. }
  96. }
  97.  
  98. if no-bottom-row {
  99. #bottom-row.ytd-watch-metadata {
  100. display: none !important;
  101. }
  102. }
  103.  
  104. h1.ytd-watch-metadata {
  105. font-size: video-title-size;
  106. --font-size: video-title-size;
  107. line-height: calc(var(--font-size) * 1.4);
  108. }
  109.  
  110. ytd-watch-flexy.style-scope:not([fullscreen]) {
  111.  
  112. & {
  113. --ytd-margin-2y: var(--ytd-margin-2x);
  114. --ytd-margin-4y: var(--ytd-margin-4x);
  115. --ytd-margin-6y: var(--ytd-margin-6x);
  116. --ytd-margin-8y: var(--ytd-margin-8x);
  117. }
  118. #columns.style-scope.ytd-watch-flexy {
  119. --ytd-margin-2x: 0;
  120. --ytd-margin-4x: 0;
  121. --ytd-margin-6x: 0;
  122. --ytd-margin-8x: 0;
  123. }
  124. .style-scope.ytd-watch-flexy > :not(.ytd-watch-flexy) {
  125. --ytd-margin-2x: var(--ytd-margin-2y);
  126. --ytd-margin-4x: var(--ytd-margin-4y);
  127. --ytd-margin-6x: var(--ytd-margin-6y);
  128. --ytd-margin-8x: var(--ytd-margin-8y);
  129. }
  130. #secondary-inner.style-scope.ytd-watch-flexy {
  131. display: flex;
  132. flex-direction: column;
  133. height: 100%;
  134. }
  135. #movie_player {
  136. position: relative;
  137.  
  138. > .html5-video-container:has(video) {
  139.  
  140. top: 0;
  141. bottom: 0;
  142. left: 0;
  143. right: 0;
  144. position: absolute;
  145. }
  146. .ytp-chrome-bottom[style*="width"] {
  147. width: unset !important;
  148. left: chrome-bottom-bar-margin !important;
  149. right: chrome-bottom-bar-margin !important;
  150. }
  151. .html5-video-container > video {
  152. width: unset !important;
  153. height: 100% !important;
  154. left: 0 !important;
  155. right: 0 !important;
  156. max-height: 100%;
  157. max-width: 100%;
  158. margin: 0 auto;
  159. }
  160. .ytp-iv-video-content {
  161. width: 100% !important;
  162. height: 100% !important;
  163. }
  164. .ytp-chapter-hover-container[style*="width"] {
  165. width: 100% !important;
  166. }
  167. }
  168. #chat:not([collapsed]) {
  169. flex: 77;
  170. }
  171. #right-tabs {
  172. display: flex;
  173. margin: 0 !important;
  174. flex: 1;
  175. flex-direction: column;
  176.  
  177. #material-tabs,
  178. .tab-content {
  179. outline: 0;
  180. }
  181.  
  182. .tab-content {
  183. flex: 77;
  184. }
  185. }
  186. #primary-inner > *:not(#player) {
  187. padding: 0 primary-content-margin 0;
  188. }
  189. h1.style-scope.ytd-watch-metadata {
  190. display: flex;
  191. flex-direction: row;
  192. flex-wrap: wrap;
  193. align-items: center;
  194. }
  195. #player-container-outer.ytd-watch-flexy {
  196. max-width: unset;
  197. }
  198. }
  199.  
  200. body.lock-scrollbar[style*="overflow"][style*="hidden"]:has(ytd-watch-flexy[is-two-columns_] #columns.ytd-watch-flexy #primary-inner.ytd-watch-flexy #player #movie_player video[src]){
  201. overflow-y: unset !important;
  202. }
  203. #columns.ytd-watch-flexy > #secondary.ytd-watch-flexy {
  204. width: side-panel-width;
  205. }
  206. if no-round-border {
  207.  
  208. ytd-live-chat-frame[rounded-container],
  209. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame,
  210. ytd-live-chat-frame[rounded-container] iframe.ytd-live-chat-frame,
  211. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame button.yt-spec-button-shape-next,
  212. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame button.yt-spec-button-shape-next:hover {
  213. border-radius: unset;
  214. }
  215.  
  216. }
  217. }
  218. if apply-to-live-chat-only
  219. html:has(iframe#chatframe)
  220. contentf()
  221. else
  222. html
  223. contentf()

QingJ © 2025

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