YouTube Live Borderless

Make YouTube Live Borderless

Install as user style?
Skaperens foreslåtte skript

Du vil kanskje også like YouTube Video Resize Fix.

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