YouTube Live Borderless

Make YouTube Live Borderless

当前为 2025-05-19 提交的版本,查看 最新版本

  1. /* ==UserStyle==
  2. @name YouTube Live Borderless
  3. @version 0.5.38
  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. @compatible edge Edge [Blink] >= 105; Stylus (Beta)
  10. @compatible chrome Chrome >= 105; Stylus (Beta); Chrome 101-104 requires "enable-experimental-web-platform-features"
  11. @compatible firefox FireFox >= 103; Stylus; layout.css.has-selector.enabled = true; note: some features might not be very stable!!
  12. @compatible opera Opera >= 91; Stylus (Beta)
  13. @compatible safari Safari >= 15.4; Stylus
  14. @preprocessor stylus
  15. @var checkbox youtube-wpr "YouTube WPR" 0
  16. @var select mode-for-two-col "Mode ##TwoColumns" {
  17. "Expanded Panel Only #Recommended": "expanded-panel",
  18. "Expanded Live Chat Only": "expanded-live",
  19. "Expandable Live Chat Only": "expandable-live",
  20. "Always": "always"
  21. }
  22. @var select mode-for-single-col "Mode ##SingleColumn" {
  23. "YT Mobile #Recommended": "mobile",
  24. "Normal": "normal",
  25. "Disabled": "disabled"
  26. }
  27. @var checkbox no-masthead "Top.MastheadBar ::Hide" 0
  28. @var range masthead-hoverable-height "Top.MastheadBar ::Hoverable" [12, 0, 36, 2, 'px']
  29. @var range masthead-hoverable-delay-in "Top.MastheadBar ::Hoverable.DelayIn" [300, 0, 800, 100, 'ms']
  30. @var checkbox disable-cinematics "CinematicsEffect ::Disable" 0
  31. @var range video-enlarging "Video.Enlarging >>>Video.Border.Fine.Tune" [0, 0, 8, 2]
  32. @var range video-padding-left-right "Video.Padding.LeftRight (Experimental)" [0, 0, 18, 2, 'px']
  33. @var range video-padding-top-bottom "Video.Padding.TopBottom (Experimental)" [0, 0, 18, 2, 'px']
  34. @var range primary-content-margin "PrimaryContent ::Margin" [24, 6, 48, 6, "px"]
  35. @var range video-title-size "VideoTitle ::Size" [2.0, 1.0, 3.0, 0.2, "rem"]
  36. @var checkbox no-bottom-row "Bottom.PrimaryMetaInfoRow ::Hide" 0
  37. @var range min-below-area "BelowArea ::Minimum" [120, 0, 240, 10, 'px']
  38. @var range min-below-area-for-theater "WideTheater.BelowArea ::Minimum" [120, 0, 240, 10, 'px']
  39. @var number side-panel-width "SidePanel ::Width" [440, 320, 640, 20, "px"]
  40. @var checkbox no-round-border "RoundBorder ::Disable" 1
  41. @var number chat-zoom-for-right-col "RightCol.Chat ::Zoom" [1.0, 0.4, 1.2, 0.05]
  42. @var range chat-btn-height "RightCol.Chat ::SpaceAbove@Zoom" [36, 0, 60, 4, 'px']
  43. @var number chat-zoom-for-mobile "YTMobile.Chat ::Zoom" [1.0, 0.4, 1.2, 0.05]
  44. @var range chat-min-height "YTMobile.Chat ::Min.Height" [400, 20, 900, 10, 'px']
  45. @var checkbox unlimit-player-max-width "Unlimit Player Max Width" 1
  46. @var checkbox fix-player-height-overflow-a "Fix Player Height Overflow (v1)" 0
  47. @var checkbox fix-player-height-overflow-b "Fix Player Height Overflow (v2)" 1
  48. @var checkbox video-no-round-angle "Video No Round Angle" 1
  49. @var checkbox compatible-ytlstm "Compatible with ytlstm-theater-mode" 0
  50. @var checkbox fix-for-ytlc "Fix for YouTubeLiveClock" 0
  51. @var checkbox show-comments-region "Show Comments (without Tabview Youtube)" 0
  52. ==/UserStyle== */
  53. /*
  54.  
  55. @var range chrome-bottom-bar-margin "Chrome Bottom Bar Margin" [12, 6, 48, 6, "px"]
  56.  
  57. Chrome Bottom Bar Margin is 12px only due to
  58.  
  59. MU = function(a) {
  60. var b = a.u.ag()
  61. , c = a.G.getVideoData().D
  62. , d = 0;
  63. a.u.ag() && a.u.Me() && (d = (a.G.fb().getPlayerSize().width - a.G.getVideoContentRect().width) / 2);
  64. return 12 * (c ? 0 : b ? 2 : 1) + d
  65. }
  66.  
  67. */
  68. // d
  69. @-moz-document url-prefix("https://www.youtube.com/watch?v="),
  70. url-prefix("https://www.youtube.com/live/") {
  71.  
  72. dummy() {
  73. // dummy
  74. border: 0;
  75. }
  76.  
  77. buildL4(type, args...) {
  78. st1 = join('', ':', type, '(', join('\, ', args), ')')
  79. selector(st1)
  80. }
  81.  
  82. /*
  83. if min-below-area <= 10px {
  84. min-below-area = 0px
  85. }
  86. if min-below-area-for-theater <= 10px {
  87. min-below-area-for-theater = 0px
  88. }
  89. */
  90. chat-btn-height = chat-btn-height + 1px
  91. if chat-btn-height == 0px + 1px {
  92. chat-btn-height = 0px
  93. }
  94.  
  95. // masthead-hoverable-height = (masthead-hoverable-h - 1) * 2px
  96.  
  97. no-masthead-w = no-masthead //
  98. chrome-bottom-bar-margin = 12px // this cannot be changed
  99.  
  100. single-col-mobile = (mode-for-single-col == "mobile" ? 1 : 0) //
  101. if single-col-mobile == 1 and no-masthead-w == 0 {
  102. no-masthead-w = 2 //
  103. }
  104.  
  105. chat-zoom-for-mobile-enable = ((chat-zoom-for-mobile < 1) or (chat-zoom-for-mobile > 1))
  106.  
  107. contentBase() {
  108. html {
  109. --ylb-min-below-area: min-below-area;
  110. }
  111. #microformat.ytd-watch-flexy {
  112. position: fixed;
  113. top:-200vh;
  114. left:-200vw;
  115. }
  116.  
  117. if fix-player-height-overflow-a { // 縦配信
  118. html:not([tabview-loaded]) {
  119. --yt-fix-player-contain: layout;
  120. }
  121. .efyt-mini-player {
  122. --yt-fix-player-contain: initial;
  123. }
  124. #player > #player-container-outer.style-scope.ytd-watch-flexy {
  125. contain: var(--yt-fix-player-contain);
  126. }
  127. }
  128.  
  129. if fix-player-height-overflow-b {
  130. #player.style-scope.ytd-watch-flexy {
  131. contain: layout;
  132. }
  133. }
  134.  
  135. if fix-for-ytlc {
  136.  
  137. @supports (color: var(--compatibile-with-chrome-plugin-youtube-live-clock-20221107)) {
  138.  
  139. /* 2022/11/07 - specific fix for YouTubeLiveClock - chrome only */
  140. html:has(style#ytlctn-style-for-native-control) #columns.ytd-watch-flexy #player::after {
  141. content: "";
  142. background-color: transparent;
  143. border-color: transparent;
  144. color: transparent;
  145. box-sizing: border-box;
  146. border-style: dotted;
  147. display: flex;
  148. height: 0px;
  149. margin: 0;
  150. border: 0;
  151. margin-top: 51px;
  152. width: calc(100% - 4px);
  153. position: relative;
  154. pointer-events: none;
  155. }
  156.  
  157. html:has(style#ytlctn-style-for-native-control) #columns.ytd-watch-flexy #below {
  158. transform: initial;
  159. }
  160.  
  161. html:has(style#ytlctn-style-for-native-control) ytd-watch-flexy[flexy][is-two-columns_][theater] #columns.ytd-watch-flexy {
  162. margin-top: 51px;
  163. }
  164. html:has(style#ytlctn-style-for-native-control) #columns {
  165. overflow: revert;
  166. }
  167. }
  168.  
  169. @supports (color: var(--compatibile-with-chrome-plugin-youtube-live-clock-20240123)) {
  170.  
  171. /* 2024/01/23 - specific fix for YouTubeLiveClock - chrome only */
  172. html:has(style#ytlc-style-for-native-control) #columns.ytd-watch-flexy #player::after {
  173. content: "";
  174. background-color: transparent;
  175. border-color: transparent;
  176. color: transparent;
  177. box-sizing: border-box;
  178. border-style: dotted;
  179. display: flex;
  180. height: 0px;
  181. margin: 0;
  182. border: 0;
  183. margin-top: 51px;
  184. width: calc(100% - 4px);
  185. position: relative;
  186. pointer-events: none;
  187. }
  188.  
  189. html:has(style#ytlc-style-for-native-control) #columns.ytd-watch-flexy #below {
  190. transform: initial;
  191. }
  192.  
  193. html:has(style#ytlc-style-for-native-control) ytd-watch-flexy[flexy][is-two-columns_][theater] #columns.ytd-watch-flexy {
  194. margin-top: 51px;
  195. }
  196. html:has(style#ytlc-style-for-native-control) #columns {
  197. overflow: revert;
  198. }
  199. }
  200.  
  201.  
  202.  
  203. }
  204.  
  205. ytd-watch-flexy[flexy] #player-container-outer.ytd-watch-flexy,
  206. ytd-watch-flexy[flexy] #player-container-inner.ytd-watch-flexy {
  207. pointer-events: none;
  208. }
  209.  
  210. ytd-watch-flexy[flexy] #player-container.ytd-watch-flexy,
  211. ytd-watch-flexy[flexy] #ytd-player.ytd-watch-flexy {
  212. pointer-events: initial;
  213. }
  214.  
  215. // general fix
  216. ytd-watch-flexy[theater] .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  217. min-height: unset;
  218. }
  219. #movie_player .ytp-cued-thumbnail-overlay-image {
  220. /* background-size: contain !important; */
  221. background-size: auto 100% !important;
  222. }
  223. ytd-watch-flexy:not([is-two-columns_]) ytd-watch-metadata {
  224. padding-top: var(--ytd-margin-3x);
  225. }
  226. ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]) #primary.ytd-watch-flexy {
  227. padding-top: 0;
  228. margin-top: 0;
  229. }
  230.  
  231. m = youtube-wpr ? ':not([tabview-loaded])[youtube-wpr*="h2"]' : ':not([tabview-loaded]):has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)'
  232.  
  233. selector-comments-1 = show-comments-region ? '#primary-inner.ytd-watch-flexy ytd-commentsx#commentsx.ytd-watch-flexy' : '#primary-inner.ytd-watch-flexy ytd-comments#comments.ytd-watch-flexy'
  234.  
  235. html{selector(m)} {buildL4('is',
  236. selector-comments-1,
  237. '#secondary-inner.ytd-watch-flexy > #related.ytd-watch-flexy')} {
  238. display: none !important;
  239. }
  240.  
  241.  
  242. html:not([tabview-loaded]) #cinematics {
  243. // contain: layout;
  244. contain: layout size style;
  245. user-select: none;
  246. touch-action: none;
  247. pointer-events: none;
  248. }
  249.  
  250. if video-no-round-angle {
  251. ytd-watch-flexy[rounded-player-large][default-layout] #ytd-player.ytd-watch-flexy.ytd-watch-flexy,
  252. ytd-watch-flexy[rounded-player][default-layout] #ytd-player.ytd-watch-flexy.ytd-watch-flexy {
  253. border-radius: 0;
  254. }
  255. }
  256.  
  257. }
  258.  
  259. //
  260. contentNoMasthead() {
  261.  
  262. // root = html
  263. & {
  264. /* 0px not 0 */
  265. --ytd-masthead-height: 0px;
  266. --ytd-toolbar-height: 0px;
  267. --ytd-watch-flexy-masthead-height: 0px;
  268. }
  269. ytd-app[style] { /* YouTube set the masthead-height in style */
  270. --ytd-masthead-height: 0px !important;
  271. --ytd-toolbar-height: 0px !important;
  272. --ytd-watch-flexy-masthead-height: 0px !important;
  273. }
  274. & .style-scope{buildL4('is', '#page-manager', 'ytd-watch-flexy', 'ytd-page-manager')} {
  275. --ytd-masthead-height: 0px;
  276. --ytd-toolbar-height: 0px;
  277. --ytd-watch-flexy-masthead-height: 0px;
  278. }
  279.  
  280. #masthead-container {
  281. height: 0;
  282. --masthead-opacity: 0;
  283. opacity: var(--masthead-opacity) !important;
  284. transition: opacity 300ms;
  285. min-height: masthead-hoverable-height;
  286. contain: layout size style;
  287. }
  288.  
  289. #masthead-container > ytd-masthead {
  290. transform: translateY(-100%);
  291. transition: transform 300ms;
  292. }
  293.  
  294.  
  295. if masthead-hoverable-height > 0 {
  296.  
  297. ytd-app {
  298. --ut-masthead-background: rgba(15,15,15,0.8);
  299. }
  300. ytd-app[darker-dark-theme] {
  301. --ut-masthead-background: rgba(240,240,240,0.8);
  302. }
  303. ytd-masthead#masthead:hover {
  304. background-color: color(--ut-masthead-background);
  305. z-index: 9999 !important;
  306. }
  307.  
  308. ytd-masthead#masthead {
  309. background-color: rgba(15,15,15,0.8);
  310. z-index: 9999 !important;
  311. }
  312.  
  313. #masthead-container:hover {
  314. --masthead-opacity: 1;
  315. }
  316.  
  317. #masthead-container:hover > ytd-masthead {
  318. transform: translateY(0%);
  319. transition-delay: masthead-hoverable-delay-in;
  320. }
  321.  
  322. #masthead-container::after {
  323. content: '';
  324. display: flex;
  325. width: 100%;
  326. height: masthead-hoverable-height;
  327. top: 0;
  328. z-index: 77;
  329. cursor: default;
  330. user-select: none !important;
  331. touch-action: none !important;
  332. box-sizing: border-box;
  333. padding: 0;
  334. margin: 0;
  335. }
  336. }
  337.  
  338. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]):not([theater]) {
  339.  
  340. #columns.style-scope.ytd-watch-flexy,
  341. #primary.style-scope.ytd-watch-flexy,
  342. #primary-inner.style-scope.ytd-watch-flexy,
  343. #secondary.style-scope.ytd-watch-flexy,
  344. #secondary-inner.style-scope.ytd-watch-flexy {
  345. height: 100vh;
  346. max-height: 100%;
  347. }
  348. }
  349.  
  350. ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) {
  351.  
  352. height: 100vh;
  353. .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  354. flex: 77;
  355. max-height: unset;
  356. }
  357.  
  358.  
  359. }
  360.  
  361.  
  362.  
  363. &:not([tabview-loaded]) ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) {
  364.  
  365. .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} ~ #columns.style-scope.ytd-watch-flexy {
  366. overflow: visible;
  367. }
  368. }
  369.  
  370.  
  371. } //
  372. contentSingleColMobile() {
  373.  
  374. // html:has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]))
  375.  
  376. if no-masthead-w>=1 {
  377.  
  378.  
  379. if youtube-wpr {
  380.  
  381.  
  382. &[youtube-wpr*="h2"] ytd-watch-flexy:not([theater]):not([fullscreen]):not([no-top-margin]):not([reduced-top-margin]) .ytd-watch-flexy{buildL4('is', '#primary', '#secondary')} {
  383. padding-top: 0px;
  384. }
  385. &[youtube-wpr*="h2"] ytd-watch-flexy[tyt-tab^="#tab-"]:not([is-two-columns_]) #primary-inner.ytd-watch-flexy {
  386. padding-bottom: 0px;
  387. }
  388.  
  389.  
  390. } else {
  391.  
  392.  
  393. &:has(#chat:not([collapsed])) ytd-watch-flexy:not([theater]):not([fullscreen]):not([no-top-margin]):not([reduced-top-margin]) .ytd-watch-flexy{buildL4('is', '#primary', '#secondary')} {
  394. padding-top: 0px;
  395. }
  396. &:has(#chat:not([collapsed])) ytd-watch-flexy[tyt-tab^="#tab-"]:not([is-two-columns_]) #primary-inner.ytd-watch-flexy {
  397. padding-bottom: 0px;
  398. }
  399.  
  400. }
  401.  
  402. }
  403.  
  404. #chat:not([collapsed]) {
  405. --ytd-margin-2x: 0;
  406. --ytd-margin-3x: 0;
  407. --ytd-margin-4x: 0;
  408. --ytd-margin-6x: 0;
  409. --ytd-margin-8x: 0;
  410.  
  411. height: 100% !important;
  412. min-height: unset !important;
  413. max-height: 100vh !important;
  414.  
  415. // position:relative;
  416. // top:auto;
  417. // bottom:0;
  418.  
  419. iframe#chatframe{
  420.  
  421. min-height: 0px;
  422.  
  423. }
  424.  
  425.  
  426.  
  427. if chat-zoom-for-mobile-enable {
  428.  
  429.  
  430. iframe-transform = 'scale(%s)' % chat-zoom-for-mobile
  431. iframe-ratio = 100% / chat-zoom-for-mobile
  432.  
  433. iframe#chatframe {
  434. position:absolute;
  435.  
  436. transform: iframe-transform;
  437. height: s('calc((100% - %s) / %s) !important', chat-btn-height, chat-zoom-for-mobile);
  438. max-height: unset !important;
  439. min-height: unset !important;
  440. transform-origin: 0 0;
  441. width: iframe-ratio !important;
  442. margin-top: chat-btn-height;
  443.  
  444.  
  445. }
  446.  
  447.  
  448. }
  449.  
  450.  
  451. }
  452.  
  453.  
  454. m = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  455. selector-comments-2 = show-comments-region ? '#primary-inner.ytd-watch-flexy ytd-commentsx#commentsx.ytd-watch-flexy' : '#primary-inner.ytd-watch-flexy ytd-comments#comments.ytd-watch-flexy'
  456.  
  457. &{selector(m)} {
  458. // html:has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen])):has(#chat:not([collapsed]))
  459.  
  460. --ylb-min-below-area: chat-min-height;
  461.  
  462. #contentContainer.tp-yt-app-drawer[swipe-open].tp-yt-app-drawer::after {
  463.  
  464. content: unset;
  465.  
  466. }
  467.  
  468. {selector-comments-2},
  469. #below.ytd-watch-flexy > .ytd-watch-flexy{buildL4('is', '#related', 'ytd-watch-metadata')} {
  470. /* display:none !important; */
  471. position: fixed !important;
  472. transform: scale(0.01) !important;
  473. transform-origin: 0 0 !important;
  474. left: -100vw !important;
  475. top: -100vh !important;
  476. visibility: collaspe !important;
  477. pointer-events: none !important;
  478. user-select: none !important;
  479. touch-action: none !important;
  480. }
  481.  
  482. #secondary.ytd-watch-flexy {
  483. display:none !important;
  484. }
  485.  
  486.  
  487. .efyt-control-bar {
  488. position: relative;
  489. display: inline-flex;
  490. top: auto;
  491. left: auto;
  492. z-index: 99999;
  493. opacity: 0.8;
  494. transform: translate(calc(-100% + 32px), 0) !important;
  495. }
  496.  
  497. .efyt-control-bar:hover {
  498. opacity: 1.0;
  499. background: var(--yt-spec-general-background-a);
  500. transform: translate(0px, 0) !important;
  501. }
  502.  
  503. #player {
  504. margin-bottom: 0;
  505. }
  506.  
  507. {buildL4('is', '#columns', '#primary')} {
  508. padding: 0;
  509. }
  510.  
  511. {buildL4('is', '#player', '#player-theater-container', '#player-container-outer', '#player-container-inner', '#player-container', '#movie_player', '#movie_player video')} {
  512. object-fit: contain;
  513. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  514.  
  515. }
  516.  
  517. #primary-inner.ytd-watch-flexy > :not(.style-scope) {
  518. display: none !important;
  519. }
  520.  
  521. #below {
  522. display: flex;
  523. flex-direction: column;
  524. flex: 1;
  525. }
  526. #below > *:not([id|="chat"]) {
  527. position: fixed !important;
  528. transform: scale(0.01) !important;
  529. transform-origin: 0 0 !important;
  530. left: -100vw !important;
  531. top: -100vh !important;
  532. visibility: collaspe !important;
  533. pointer-events: none !important;
  534. user-select: none !important;
  535. touch-action: none !important;
  536. }
  537. #below ~ [id|="chat"],
  538. #primary-inner.ytd-watch-flexy ~ [id|="chat"],
  539. #primary.ytd-watch-flexy ~ [id|="chat"] {
  540. flex: 1;
  541. }
  542.  
  543. #below:not(:has(#chat)) {
  544. display: none;
  545. }
  546.  
  547. {buildL4('is', 'ytd-watch-flexy', '#columns.ytd-watch-flexy', '#primary.ytd-watch-flexy', '#primary-inner.ytd-watch-flexy')} {
  548. display: flex;
  549. flex-direction: column;
  550. margin: 0;
  551. flex: 1;
  552. }
  553.  
  554. ytd-watch-flexy {
  555. height: 100vh !important;
  556. max-height: 100vh !important;
  557. }
  558.  
  559. ytd-watch-flexy{buildL4('is', '[theater]', '[fullscreen]')} .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  560.  
  561. min-height: unset !important;
  562. }
  563. }
  564. }
  565. content2cHTML() {
  566. // html
  567. body.lock-scrollbar {
  568. overflow-y: auto;
  569. }
  570. }
  571.  
  572. content2cMAIN() {
  573. // body or html
  574.  
  575. if chat-zoom-for-right-col > 1 or chat-zoom-for-right-col < 1 {
  576.  
  577. ytd-watch-flexy[is-two-columns_]:not([fullscreen]) iframe#chatframe {
  578.  
  579. position:absolute;
  580. margin-top:chat-btn-height;
  581.  
  582. transform: 'scale(%s)' % chat-zoom-for-right-col;
  583. transform-origin: 0 0;
  584. width: '%s !important' % (100% / chat-zoom-for-right-col);
  585. max-width: unset !important;
  586. height: s('calc( (100% - %s) / %s ) !important', chat-btn-height, chat-zoom-for-right-col);
  587. z-index: 1; /* for normal youtube */
  588.  
  589. }
  590.  
  591. }
  592.  
  593.  
  594. if no-masthead-w==0 {
  595.  
  596. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) {
  597.  
  598. .style-scope.ytd-watch-flexy{buildL4('is', '#secondary', '#secondary-inner')} {
  599. height: calc(100vh - var(--ytd-toolbar-height));
  600. max-height: 100%;
  601. }
  602. }
  603. }
  604.  
  605.  
  606. ytd-watch-flexy[is-two-columns_]:not([fullscreen]) #movie_player {
  607.  
  608. .ytp-chrome-bottom[style*="width"] {
  609. width: unset !important;
  610. left: chrome-bottom-bar-margin !important;
  611. right: chrome-bottom-bar-margin !important;
  612. }
  613.  
  614. }
  615.  
  616.  
  617. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) ytd-live-chat-frame#chat:not([collapsed]) {
  618. min-height: unset;
  619. }
  620.  
  621.  
  622.  
  623. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]) #primary-inner.ytd-watch-flexy > *:not(#player) {
  624. padding: 0 primary-content-margin 0;
  625. }
  626.  
  627.  
  628. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) #player .ytd-watch-flexy{buildL4('is', '#player-container-outer', '#player-container-inner', '#player-container')}{
  629.  
  630. // layout outside
  631. // no effect
  632. // layout inside
  633. max-height: calc(100vh - var(--ytd-toolbar-height, 0px) - var(--ylb-min-below-area, 0px)); // for very wide screen
  634. }
  635.  
  636. ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  637. max-height: calc(100vh - var(--ytd-toolbar-height, 0px) - var(--ylb-min-below-area, 0px)); // for 4:3 video
  638.  
  639. }
  640.  
  641. ytd-watch-flexy.style-scope[is-two-columns_] #columns.ytd-watch-flexy > #secondary.ytd-watch-flexy {
  642. width: side-panel-width;
  643. }
  644. }
  645. contentfHTML(){
  646. // html
  647.  
  648. body ytd-watch-flexy[flexy] #player-container-outer.ytd-watch-flexy {
  649. max-width: unset; // override var(--ytd-watch-flexy-max-player-width);
  650. }
  651.  
  652. &:not([tabview-loaded]) {
  653.  
  654. body ytd-watch-flexy[flexy][is-two-columns_]{buildL4('is', '[is-extra-wide-video_]', '[is-four-three-to-sixteen-nine-video_]')} #primary.ytd-watch-flexy {
  655.  
  656. max-width: unset; // override var(--ytd-watch-flexy-max-player-width);
  657.  
  658. }
  659. }
  660. chat-selector = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  661.  
  662. &{selector(chat-selector)} {
  663. ytd-watch-flexy.style-scope:not([fullscreen]) {
  664. .style-scope{buildL4('is', '#chat', '#chat-container')}{
  665. flex: 77;
  666. }
  667. }
  668. }
  669. }
  670.  
  671. contentfMAIN() {
  672. // body or html
  673.  
  674. if (video-padding-left-right + video-padding-top-bottom) > 0 {
  675.  
  676. #player-container-outer.ytd-watch-flexy {
  677. padding-left: video-padding-left-right;
  678. padding-right: video-padding-left-right;
  679. padding-top: video-padding-top-bottom;
  680. padding-bottom: video-padding-top-bottom;
  681. }
  682.  
  683. }
  684.  
  685.  
  686. &:not([tabview-loaded]) {
  687.  
  688. ytd-watch-flexy:not([fullscreen]) .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  689. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  690. }
  691.  
  692.  
  693. ytd-watch-flexy[is-two-columns_]:not([theater]):not([fullscreen]) {buildL4('is', '#columns', '#primary', '#primary-inner', '#secondary', '#secondary-inner')} {
  694. height: calc(100vh - var(--ytd-toolbar-height));
  695. }
  696.  
  697. }
  698.  
  699. if video-enlarging > 0 {
  700.  
  701. ytd-watch-flexy:not([theater]):not([fullscreen]) #movie_player video[src] {
  702. transform: 'scale(%s)' % (video-enlarging / 1000 + 1) ;
  703. transform-origin: 50% 50%;
  704. }
  705.  
  706. }
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714. ytd-watch-flexy[flexy][is-two-columns_][theater]:not([fullscreen]) {
  715.  
  716. --ylb-min-below-area: min-below-area-for-theater;
  717.  
  718. {buildL4('is', '#player', '#player-theater-container', '#player-wide-container', '#player-container-outer', '#player-container-inner', '#player-container', '#movie_player', '#movie_player video')} {
  719. object-fit: contain;
  720. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  721. }
  722. }
  723.  
  724.  
  725.  
  726. if no-bottom-row {
  727.  
  728. #bottom-row.ytd-watch-metadata {
  729. display: none !important;
  730. }
  731. }
  732.  
  733. h1.ytd-watch-metadata {
  734. font-size: video-title-size;
  735. --font-size: video-title-size;
  736. line-height: 140%;
  737. margin-bottom: -2px;
  738. }
  739.  
  740. chat-selector = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  741. #secondary-inner.ytd-watch-flexy {
  742. --tabview-slider-right: 0px !important;
  743. }
  744.  
  745. ytd-watch-flexy.style-scope:not([fullscreen]) {
  746.  
  747. & {
  748. --ytd-margin-2y: var(--ytd-margin-2x);
  749. --ytd-margin-3y: var(--ytd-margin-3x);
  750. --ytd-margin-4y: var(--ytd-margin-4x);
  751. --ytd-margin-6y: var(--ytd-margin-6x);
  752. --ytd-margin-8y: var(--ytd-margin-8x);
  753. }
  754.  
  755. #columns.style-scope.ytd-watch-flexy {
  756. --ytd-margin-2x: 0;
  757. --ytd-margin-3x: 0;
  758. --ytd-margin-4x: 0;
  759. --ytd-margin-6x: 0;
  760. --ytd-margin-8x: 0;
  761. }
  762.  
  763. .style-scope.ytd-watch-flexy > :not(.ytd-watch-flexy):not(secondary-wrapper),
  764. .style-scope.ytd-watch-flexy > secondary-wrapper > :not(.ytd-watch-flexy),
  765. #below,
  766. #player {
  767. --ytd-margin-2x: var(--ytd-margin-2y);
  768. --ytd-margin-3x: var(--ytd-margin-3y);
  769. --ytd-margin-4x: var(--ytd-margin-4y);
  770. --ytd-margin-6x: var(--ytd-margin-6y);
  771. --ytd-margin-8x: var(--ytd-margin-8y);
  772. }
  773. if unlimit-player-max-width {
  774. html body ytd-watch-flexy.style-scope[class][flexy]:not([attr1][attr2]) #columns.ytd-watch-flexy.style-scope[class] {
  775. max-width: initial;
  776. }
  777. #columns {
  778. --ytd-watch-flexy-max-player-width: initial;
  779. }
  780. }
  781.  
  782. #secondary-inner.style-scope.ytd-watch-flexy {
  783. display: flex;
  784. flex-direction: column;
  785. height: 100%;
  786. }
  787.  
  788. #secondary-inner.style-scope.ytd-watch-flexy > * {
  789. flex-shrink: 0;
  790. }
  791.  
  792. #movie_player {
  793. position: relative;
  794. > .html5-video-container:has(video) {
  795. top: 0;
  796. bottom: 0;
  797. left: 0;
  798. right: 0;
  799. position: absolute;
  800. }
  801.  
  802. .html5-video-container > video {
  803. width: unset !important;
  804. height: 100% !important;
  805. left: 0 !important;
  806. right: 0 !important;
  807. max-height: 100%;
  808. max-width: 100%;
  809. margin: 0 auto;
  810. }
  811.  
  812. .html5-video-container > video[style*="top:"]:not(video[style*="top: -"]):not(video[style*="top:-"]) {
  813. top: 0 !important;
  814. }
  815.  
  816. }
  817.  
  818. #chat-container {
  819. display: flex;
  820. flex-direction: column;
  821. }
  822.  
  823. #right-tabs {
  824. display: flex;
  825. margin: 0 !important;
  826. flex: 1;
  827. flex-direction: column;
  828.  
  829. {buildL4('is', '#material-tabs', '.tab-content')} {
  830. outline: 0;
  831. }
  832.  
  833. .tab-content {
  834. flex: 77;
  835. }
  836. }
  837.  
  838. &[tyt-tab=""] #right-tabs {
  839. flex: 0;
  840. }
  841.  
  842. &:not([is-two-columns_]) #primary-inner > *:not(#player) {
  843. padding: 0;
  844. }
  845.  
  846. &:not([is-two-columns_]) #primary-inner #below > *:not([id|="chat"]) {
  847. padding: 0 primary-content-margin 0;
  848. }
  849.  
  850. }
  851.  
  852. if no-round-border {
  853.  
  854. ytd-live-chat-frame[rounded-container],
  855. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame,
  856. ytd-live-chat-frame[rounded-container] iframe.ytd-live-chat-frame,
  857. 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,
  858. 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 {
  859. border-radius: unset;
  860. }
  861. }
  862.  
  863.  
  864. if disable-cinematics {
  865. #cinematics.ytd-watch-flexy {
  866. display: none;
  867. }
  868. }
  869. } //
  870. contentgHTML() {
  871. // html
  872.  
  873. content2cHTML() //
  874. selector-g = '' //
  875. if mode-for-single-col=="disabled" { //
  876. selector-g = youtube-wpr ? '[youtube-wpr*="s"]': ":has(ytd-watch-flexy[is-two-columns_])" //
  877. } //
  878. &{s(selector-g)} { //
  879. // html
  880. contentfHTML() //
  881. } //
  882. }
  883. contentgMAIN() {
  884. // body or html
  885.  
  886. content2cMAIN() //
  887. selector-g = '' //
  888. if mode-for-single-col=="disabled" { //
  889. selector-g = youtube-wpr ? '[youtube-wpr*="s"]': ":has(ytd-watch-flexy[is-two-columns_])" //
  890. } //
  891. &{s(selector-g)} { //
  892. // html
  893. contentfMAIN() //
  894. } //
  895. }
  896. contentBase() //
  897. selectors-2col = { //
  898. "expanded-panel": join(', ',
  899. "html:not([tabview-loaded]):has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)",
  900. "html[tabview-loaded]:has(ytd-watch-flexy[is-two-columns_]:not([fullscreen]))"
  901. ),
  902. "expanded-live": "html:has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)",
  903. "expandable-live": "html:has(ytd-live-chat-frame#chat):has(iframe#chatframe)",
  904. "always": "html"
  905. } //
  906. if youtube-wpr {
  907. selectors-2col = { //
  908. "expanded-panel": join(', ',
  909. 'html:not([tabview-loaded])[youtube-wpr*="h2"][youtube-wpr*="f"]',
  910. 'html[tabview-loaded][youtube-wpr*="s"][youtube-wpr*="f"]'
  911. ),
  912. "expanded-live": 'html[youtube-wpr*="h2"][youtube-wpr*="f"]',
  913. "expandable-live": 'html:not([youtube-wpr*="h0"])[youtube-wpr*="f"]',
  914. "always": 'html[youtube-wpr*="f"]'
  915. } //
  916. }
  917. selector-2col = selectors-2col[mode-for-two-col]
  918. selectors-k = split(', ', selector-2col)
  919. for selector-k in selectors-k {
  920. {s(selector-k)} {
  921. if no-masthead-w==1 {
  922. contentNoMasthead()
  923. }
  924. if compatible-ytlstm {
  925. contentgHTML()
  926. body:not([data-ytlstm-theater-mode]) {
  927. contentgMAIN() //
  928. }
  929. } else {
  930. contentgHTML()
  931. contentgMAIN() //
  932. }
  933. }
  934. }
  935.  
  936. if single-col-mobile {
  937. m = youtube-wpr ? '[youtube-wpr*="S"][youtube-wpr*="f"]': ":has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]))"
  938. html{selector(m)} {
  939.  
  940. if no-masthead-w==1 {
  941. contentNoMasthead()
  942. }
  943. if no-masthead-w==2 {
  944. if youtube-wpr {
  945. &[youtube-wpr*="h2"] {
  946. contentNoMasthead()
  947. }
  948. } else {
  949. &:has(#chat:not([collapsed])) {
  950. contentNoMasthead()
  951. }
  952. }
  953. }
  954. contentSingleColMobile()
  955. }
  956. }
  957.  
  958. @css {
  959.  
  960. @supports not selector(:has(body)) {
  961.  
  962.  
  963. html::after {
  964. display: block;
  965. content: 'Your browser does not support "has-selector". Please update to latest version and enable it via configuration.';
  966. width: 60vh;
  967. padding: 12px;
  968. height: auto;
  969. position: fixed;
  970. left: 50%;
  971. top: 50%;
  972. transform: translate(-50%, -50%);
  973. transform-origin: 0 0;
  974. background: #71210f;
  975. color: #d2dadb;
  976. font-size: 14pt;
  977. text-shadow: 1px 1px 2px #605262;
  978. }
  979.  
  980. }
  981. }
  982.  
  983.  
  984. if youtube-wpr {
  985.  
  986. @css {
  987. @supports selector(:has(body)) {
  988.  
  989. @keyframes wpr-message-appear {
  990. 0% {
  991. top: -300vh;
  992. }
  993. 1% {
  994. top: 50%;
  995. }
  996. 100% {
  997. top: 50%;
  998. }
  999. }
  1000. html:not([youtube-wpr]) ytd-watch-flexy::after {
  1001. display: block;
  1002. content: 'YouTube Live Borderless: YouTube WPR is not yet installed. Please install the userscript https://gf.qytechs.cn/scripts/457319 in order to use YouTube WPR';
  1003. width: 60vh;
  1004. padding: 12px;
  1005. height: auto;
  1006. position: fixed;
  1007. left: 50%;
  1008. top: -300vh;
  1009. transform: translate(-50%, -50%);
  1010. transform-origin: 0 0;
  1011. background: #71210f;
  1012. color: #d2dadb;
  1013. font-size: 14pt;
  1014. text-shadow: 1px 1px 2px #605262;
  1015. animation: wpr-message-appear 1ms 2s forwards;
  1016. z-index: 9999;
  1017. }
  1018. }
  1019.  
  1020. }
  1021.  
  1022. }
  1023. }

QingJ © 2025

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