YouTube Live Borderless

Make YouTube Live Borderless

目前为 2023-07-12 提交的版本。查看 最新版本

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