YouTube Live Borderless

Make YouTube Live Borderless

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

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

QingJ © 2025

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