YouTube Live Borderless

Make YouTube Live Borderless

当前为 2023-10-08 提交的版本,查看 最新版本

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