YouTube Live Borderless

Make YouTube Live Borderless

当前为 2023-05-25 提交的版本,查看 最新版本

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