YouTube Live Borderless

Make YouTube Live Borderless

当前为 2023-07-12 提交的版本,查看 最新版本

  1. /* ==UserStyle==
  2. @name YouTube Live Borderless
  3. @version 0.5.10
  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. if no-masthead-w>=1 {
  269.  
  270.  
  271. if youtube-wpr {
  272.  
  273.  
  274. &[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')} {
  275. padding-top: 0px;
  276. }
  277. &[youtube-wpr*="h2"] ytd-watch-flexy[tyt-tab^="#tab-"]:not([is-two-columns_]) #primary-inner.ytd-watch-flexy {
  278. padding-bottom: 0px;
  279. }
  280.  
  281.  
  282.  
  283. } else {
  284.  
  285.  
  286. &: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')} {
  287. padding-top: 0px;
  288. }
  289. &:has(#chat:not([collapsed])) ytd-watch-flexy[tyt-tab^="#tab-"]:not([is-two-columns_]) #primary-inner.ytd-watch-flexy {
  290. padding-bottom: 0px;
  291. }
  292.  
  293. }
  294.  
  295. }
  296.  
  297. #chat:not([collapsed]) {
  298. --ytd-margin-2x: 0;
  299. --ytd-margin-4x: 0;
  300. --ytd-margin-6x: 0;
  301. --ytd-margin-8x: 0;
  302.  
  303. height: 100% !important;
  304. min-height: unset !important;
  305. max-height: 100vh !important;
  306.  
  307. // position:relative;
  308. // top:auto;
  309. // bottom:0;
  310.  
  311. iframe#chatframe{
  312.  
  313.  
  314. min-height: 0px;
  315.  
  316. }
  317.  
  318.  
  319.  
  320. if chat-zoom-for-mobile-enable {
  321.  
  322.  
  323. iframe-transform = 'scale(%s)' % chat-zoom-for-mobile
  324. iframe-ratio = 100% / chat-zoom-for-mobile
  325.  
  326. iframe#chatframe {
  327. position:absolute;
  328.  
  329. transform: iframe-transform;
  330. height: s('calc((100% - %s) / %s) !important', chat-btn-height, chat-zoom-for-mobile);
  331. max-height: unset !important;
  332. min-height: unset !important;
  333. transform-origin: 0 0;
  334. width: iframe-ratio !important;
  335. margin-top: chat-btn-height;
  336.  
  337.  
  338. }
  339.  
  340.  
  341. }
  342.  
  343.  
  344. }
  345.  
  346.  
  347. m = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  348.  
  349. &{selector(m)} {
  350. // html:has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen])):has(#chat:not([collapsed]))
  351.  
  352. #contentContainer.tp-yt-app-drawer[swipe-open].tp-yt-app-drawer::after {
  353.  
  354. content: unset;
  355.  
  356. }
  357.  
  358.  
  359. if t33 == 0 {
  360.  
  361. #primary-inner.ytd-watch-flexy ytd-comments#comments.ytd-watch-flexy,
  362. #below.ytd-watch-flexy > .ytd-watch-flexy{buildL4('is', '#related', 'ytd-watch-metadata')} {
  363. /* display:none !important; */
  364. position: fixed !important;
  365. transform: scale(0.01) !important;
  366. transform-origin: 0 0 !important;
  367. left: -100vw !important;
  368. top: -100vh !important;
  369. visibility: collaspe !important;
  370. pointer-events: none !important;
  371. user-select: none !important;
  372. touch-action: none !important;
  373. }
  374.  
  375. }
  376.  
  377. #secondary.ytd-watch-flexy {
  378. display:none !important;
  379. }
  380.  
  381.  
  382.  
  383.  
  384. .efyt-control-bar {
  385. position: relative;
  386. display: inline-flex;
  387. top: auto;
  388. left: auto;
  389. z-index: 99999;
  390. opacity: 0.8;
  391. transform: translate(calc(-100% + 32px), 0) !important;
  392. }
  393.  
  394. .efyt-control-bar:hover {
  395. opacity: 1.0;
  396. background: var(--yt-spec-general-background-a);
  397. transform: translate(0px, 0) !important;
  398. }
  399.  
  400. #player {
  401. margin-bottom: 0;
  402. }
  403.  
  404.  
  405.  
  406. {buildL4('is', '#columns', '#primary')} {
  407. padding: 0;
  408. }
  409.  
  410. --ylb-min-below-area: chat-min-height;
  411.  
  412.  
  413.  
  414.  
  415. {buildL4('is', '#player', '#player-theater-container', '#player-container-outer', '#player-container-inner', '#player-container', '#movie_player', '#movie_player video')} {
  416. object-fit: contain;
  417. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  418.  
  419. }
  420.  
  421.  
  422. if t33 == 0 {
  423.  
  424. #primary-inner.ytd-watch-flexy > :not(.style-scope) {
  425. display: none !important;
  426. }
  427.  
  428. #below > *:not(#chat) {
  429. /* display:none !important; */
  430. position: fixed !important;
  431. transform: scale(0.01) !important;
  432. transform-origin: 0 0 !important;
  433. left: -100vw !important;
  434. top: -100vh !important;
  435. visibility: collaspe !important;
  436. pointer-events: none !important;
  437. user-select: none !important;
  438. touch-action: none !important;
  439.  
  440. }
  441. }
  442.  
  443. #below:not(:has(#chat)) {
  444. display: none;
  445. }
  446.  
  447.  
  448.  
  449. {buildL4('is', 'ytd-watch-flexy', '#columns.ytd-watch-flexy', '#primary.ytd-watch-flexy', '#primary-inner.ytd-watch-flexy')} {
  450. display: flex;
  451. flex-direction: column;
  452. margin: 0;
  453. flex: 1;
  454. }
  455.  
  456. #below {
  457. flex: 1;
  458. }
  459.  
  460. ytd-watch-flexy {
  461. height: 100vh !important;
  462. max-height: 100vh !important;
  463. }
  464.  
  465. ytd-watch-flexy{buildL4('is', '[theater]', '[fullscreen]')} #player-theater-container.ytd-watch-flexy {
  466.  
  467. min-height: unset !important;
  468. }
  469. }
  470.  
  471.  
  472. }
  473.  
  474. content2c() {
  475.  
  476. if t33 == 0 {
  477. if chat-zoom-for-right-col >1 or chat-zoom-for-right-col < 1 {
  478.  
  479. ytd-watch-flexy[is-two-columns_]:not([fullscreen]) iframe#chatframe {
  480.  
  481. position:absolute;
  482. margin-top:chat-btn-height;
  483.  
  484. transform: 'scale(%s)' % chat-zoom-for-right-col;
  485. transform-origin: 0 0;
  486. width: '%s !important' % (100% / chat-zoom-for-right-col);
  487. max-width: unset !important;
  488. height: s('calc( (100% - %s) / %s ) !important', chat-btn-height, chat-zoom-for-right-col);
  489. z-index: 1; /* for normal youtube */
  490.  
  491. }
  492.  
  493. }
  494.  
  495.  
  496. if no-masthead-w==0 {
  497.  
  498. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) {
  499.  
  500. .style-scope.ytd-watch-flexy{buildL4('is', '#secondary', '#secondary-inner')} {
  501. height: calc(100vh - var(--ytd-toolbar-height));
  502. max-height: 100%;
  503. }
  504. }
  505. }
  506.  
  507.  
  508. ytd-watch-flexy[is-two-columns_]:not([fullscreen]) #movie_player {
  509.  
  510. .ytp-chrome-bottom[style*="width"] {
  511. width: unset !important;
  512. left: chrome-bottom-bar-margin !important;
  513. right: chrome-bottom-bar-margin !important;
  514. }
  515.  
  516. }
  517.  
  518.  
  519. /*
  520.  
  521. // originally this is to avoid sizing issue; however, as userscript "YouTube Video Resize Fix" is a must, this is no longer required.
  522. // this css rule not compatible with YouTubeLiveClock
  523.  
  524. ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]) #movie_player {
  525.  
  526. .ytp-chrome-bottom[style*="width"] {
  527. left: 50% !important;
  528. transform: translateX(-50%);
  529. }
  530.  
  531. }
  532.  
  533. */
  534.  
  535.  
  536. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) ytd-live-chat-frame#chat:not([collapsed]) {
  537. min-height: unset;
  538. }
  539.  
  540.  
  541.  
  542. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]) #primary-inner.ytd-watch-flexy > *:not(#player) {
  543. padding: 0 primary-content-margin 0;
  544. }
  545.  
  546.  
  547. 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')}{
  548.  
  549. // layout outside
  550. // no effect
  551. // layout inside
  552. max-height: calc(100vh - var(--ytd-toolbar-height, 0px) - var(--ylb-min-below-area, 0px)); // for very wide screen
  553. }
  554.  
  555. ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) #player-theater-container.ytd-watch-flexy {
  556. max-height: calc(100vh - var(--ytd-toolbar-height, 0px) - var(--ylb-min-below-area, 0px)); // for 4:3 video
  557.  
  558. }
  559.  
  560.  
  561. body.lock-scrollbar {
  562. overflow-y: auto;
  563. }
  564. /*
  565. body.lock-scrollbar[style*="overflow"][style*="hidden"]:has(ytd-watch-flexy[is-two-columns_]:not([hidden])):has(#movie_player) {
  566. overflow-y: unset !important;
  567. }
  568. */
  569.  
  570.  
  571. ytd-watch-flexy.style-scope[is-two-columns_] #columns.ytd-watch-flexy > #secondary.ytd-watch-flexy {
  572. width: side-panel-width;
  573. }
  574.  
  575. }
  576.  
  577.  
  578. }
  579.  
  580. contentf() {
  581. // html
  582. if t33 == 0 {
  583.  
  584. if (video-padding-left-right + video-padding-top-bottom) > 0 {
  585.  
  586. #player-container-outer.ytd-watch-flexy {
  587. padding-left: video-padding-left-right;
  588. padding-right: video-padding-left-right;
  589. padding-top: video-padding-top-bottom;
  590. padding-bottom: video-padding-top-bottom;
  591. }
  592.  
  593. }
  594.  
  595.  
  596. body ytd-watch-flexy[flexy] #player-container-outer.ytd-watch-flexy {
  597. max-width: unset; // override var(--ytd-watch-flexy-max-player-width);
  598. }
  599.  
  600. &:not([tabview-loaded]) {
  601.  
  602. 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 {
  603.  
  604. max-width: unset; // override var(--ytd-watch-flexy-max-player-width);
  605.  
  606. }
  607.  
  608.  
  609. ytd-watch-flexy:not([fullscreen]) #player-theater-container {
  610. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  611. }
  612.  
  613.  
  614. ytd-watch-flexy[is-two-columns_]:not([theater]):not([fullscreen]) {buildL4('is', '#columns', '#primary', '#primary-inner', '#secondary', '#secondary-inner')} {
  615. height: calc(100vh - var(--ytd-toolbar-height));
  616. }
  617.  
  618. }
  619.  
  620. if video-enlarging > 0 {
  621.  
  622. ytd-watch-flexy:not([theater]):not([fullscreen]) #movie_player video[src] {
  623. transform: 'scale(%s)' % (video-enlarging / 1000 + 1) ;
  624. transform-origin: 50% 50%;
  625. }
  626.  
  627. }
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635. ytd-watch-flexy[flexy][is-two-columns_][theater]:not([fullscreen]) {
  636.  
  637. --ylb-min-below-area: min-below-area-for-theater;
  638.  
  639.  
  640. {buildL4('is', '#player', '#player-theater-container', '#player-container-outer', '#player-container-inner', '#player-container', '#movie_player', '#movie_player video')} {
  641. object-fit: contain;
  642. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  643. }
  644. }
  645.  
  646.  
  647.  
  648. if no-bottom-row {
  649.  
  650. #bottom-row.ytd-watch-metadata {
  651. display: none !important;
  652. }
  653. }
  654.  
  655. h1.ytd-watch-metadata {
  656. font-size: video-title-size;
  657. --font-size: video-title-size;
  658. line-height: 140%;
  659. margin-bottom: -2px;
  660. }
  661.  
  662. chat-selector = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  663.  
  664. &{selector(chat-selector)} {
  665. ytd-watch-flexy.style-scope:not([fullscreen]) {
  666. .style-scope{buildL4('is', '#chat', '#chat-container')}{
  667. flex: 77;
  668. }
  669. }
  670. }
  671.  
  672. ytd-watch-flexy.style-scope:not([fullscreen]) {
  673.  
  674. & {
  675. --ytd-margin-2y: var(--ytd-margin-2x);
  676. --ytd-margin-4y: var(--ytd-margin-4x);
  677. --ytd-margin-6y: var(--ytd-margin-6x);
  678. --ytd-margin-8y: var(--ytd-margin-8x);
  679. }
  680.  
  681. #columns.style-scope.ytd-watch-flexy {
  682. --ytd-margin-2x: 0;
  683. --ytd-margin-4x: 0;
  684. --ytd-margin-6x: 0;
  685. --ytd-margin-8x: 0;
  686. }
  687.  
  688. .style-scope.ytd-watch-flexy > :not(.ytd-watch-flexy),
  689. #below,
  690. #player {
  691. --ytd-margin-2x: var(--ytd-margin-2y);
  692. --ytd-margin-4x: var(--ytd-margin-4y);
  693. --ytd-margin-6x: var(--ytd-margin-6y);
  694. --ytd-margin-8x: var(--ytd-margin-8y);
  695. }
  696.  
  697. #secondary-inner.style-scope.ytd-watch-flexy {
  698. display: flex;
  699. flex-direction: column;
  700. height: 100%;
  701. }
  702.  
  703. #secondary-inner.style-scope.ytd-watch-flexy > * {
  704. flex-shrink: 0;
  705. }
  706.  
  707. #movie_player {
  708. position: relative;
  709. > .html5-video-container:has(video) {
  710. top: 0;
  711. bottom: 0;
  712. left: 0;
  713. right: 0;
  714. position: absolute;
  715. }
  716.  
  717. .html5-video-container > video {
  718. width: unset !important;
  719. height: 100% !important;
  720. left: 0 !important;
  721. right: 0 !important;
  722. max-height: 100%;
  723. max-width: 100%;
  724. margin: 0 auto;
  725. }
  726.  
  727. /*
  728. .ytp-iv-video-content {
  729. width: 100% !important;
  730. height: 100% !important;
  731. }
  732. */
  733.  
  734. /*
  735. // this is buggy; eg multiple chapter hover container; can be fixed by YouTube Video Resize Fix Only
  736. .ytp-chapter-hover-container[style*="width"] {
  737. width: 100% !important;
  738. }
  739. */
  740.  
  741. .html5-video-container > video[style*="top:"]:not(video[style*="top: -"]):not(video[style*="top:-"]) {
  742. top: 0 !important;
  743. }
  744.  
  745. }
  746.  
  747. #chat-container {
  748. display: flex;
  749. flex-direction: column;
  750. }
  751.  
  752. #right-tabs {
  753. display: flex;
  754. margin: 0 !important;
  755. flex: 1;
  756. flex-direction: column;
  757.  
  758. {buildL4('is', '#material-tabs', '.tab-content')} {
  759. outline: 0;
  760. }
  761.  
  762. .tab-content {
  763. flex: 77;
  764. }
  765. }
  766.  
  767. &:not([is-two-columns_]) #primary-inner > *:not(#player) {
  768. padding: 0;
  769. }
  770.  
  771. &:not([is-two-columns_]) #primary-inner #below > *:not(ytd-live-chat-frame#chat) {
  772. padding: 0 primary-content-margin 0;
  773. }
  774.  
  775. /*
  776. #player-container-outer.ytd-watch-flexy {
  777. max-width: unset;
  778. }
  779. */
  780. }
  781.  
  782. }
  783.  
  784.  
  785.  
  786. if no-round-border {
  787.  
  788. ytd-live-chat-frame[rounded-container],
  789. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame,
  790. ytd-live-chat-frame[rounded-container] iframe.ytd-live-chat-frame,
  791. 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,
  792. 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 {
  793. border-radius: unset;
  794. }
  795. }
  796.  
  797.  
  798. if disable-cinematics {
  799. #cinematics.ytd-watch-flexy {
  800. display: none;
  801. }
  802. }
  803. } //
  804. contentg() {
  805.  
  806. content2c() //
  807. selector-g = '' //
  808. if mode-for-single-col=="disabled" { //
  809. selector-g = youtube-wpr ? '[youtube-wpr*="s"]': ":has(ytd-watch-flexy[is-two-columns_])" //
  810. } //
  811. &{s(selector-g)} { //
  812. // html
  813. contentf() //
  814. } //
  815. }
  816. content361() //
  817. selectors-2col = { //
  818. "expanded-panel": join(', ',
  819. "html:not([tabview-loaded]):has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)",
  820. "html[tabview-loaded]:has(ytd-watch-flexy[is-two-columns_]:not([fullscreen]))"
  821. ),
  822. "expanded-live": "html:has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)",
  823. "expandable-live": "html:has(ytd-live-chat-frame#chat):has(iframe#chatframe)",
  824. "always": "html"
  825. } //
  826. if youtube-wpr {
  827. selectors-2col = { //
  828. "expanded-panel": join(', ',
  829. 'html:not([tabview-loaded])[youtube-wpr*="h2"][youtube-wpr*="f"]',
  830. 'html[tabview-loaded][youtube-wpr*="s"][youtube-wpr*="f"]'
  831. ),
  832. "expanded-live": 'html[youtube-wpr*="h2"][youtube-wpr*="f"]',
  833. "expandable-live": 'html:not([youtube-wpr*="h0"])[youtube-wpr*="f"]',
  834. "always": 'html[youtube-wpr*="f"]'
  835. } //
  836. }
  837. selector-2col = selectors-2col[mode-for-two-col]
  838. selectors-k = split(', ', selector-2col)
  839. for selector-k in selectors-k {
  840. {s(selector-k)} {
  841. if no-masthead-w==1 {
  842. contentNoMasthead()
  843. }
  844. contentg() //
  845. }
  846. }
  847.  
  848. if single-col-mobile {
  849. m = youtube-wpr ? '[youtube-wpr*="S"][youtube-wpr*="f"]': ":has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]))"
  850. html{selector(m)} {
  851.  
  852. if no-masthead-w==1 {
  853. contentNoMasthead()
  854. }
  855. if no-masthead-w==2 {
  856. if youtube-wpr {
  857. &[youtube-wpr*="h2"] {
  858. contentNoMasthead()
  859. }
  860. } else {
  861. &:has(#chat:not([collapsed])) {
  862. contentNoMasthead()
  863. }
  864. }
  865. }
  866. contentSingleColMobile()
  867. }
  868. }
  869. @css {
  870.  
  871. @supports not selector(:has(body)) {
  872. html::after {
  873. display: block;
  874. content: 'Your browser does not support "has-selector". Please update to latest version and enable it via configuration.';
  875. width: 60vh;
  876. padding: 12px;
  877. height: auto;
  878. position: fixed;
  879. left: 50%;
  880. top: 50%;
  881. transform: translate(-50%, -50%);
  882. transform-origin: 0 0;
  883. background: #71210f;
  884. color: #d2dadb;
  885. font-size: 14pt;
  886. text-shadow: 1px 1px 2px #605262;
  887. }
  888. }
  889. }
  890.  
  891.  
  892.  
  893. if youtube-wpr {
  894.  
  895.  
  896. @css {
  897. @supports selector(:has(body)) {
  898.  
  899. @keyframes wpr-message-appear {
  900. 0% {
  901. top: -300vh;
  902. }
  903. 1% {
  904. top: 50%;
  905. }
  906. 100% {
  907. top: 50%;
  908. }
  909. }
  910. html:not([youtube-wpr])::after {
  911. display: block;
  912. 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';
  913. width: 60vh;
  914. padding: 12px;
  915. height: auto;
  916. position: fixed;
  917. left: 50%;
  918. top: -300vh;
  919. transform: translate(-50%, -50%);
  920. transform-origin: 0 0;
  921. background: #71210f;
  922. color: #d2dadb;
  923. font-size: 14pt;
  924. text-shadow: 1px 1px 2px #605262;
  925. animation: wpr-message-appear 1ms 2s forwards;
  926. }
  927. }
  928.  
  929. }
  930.  
  931. }
  932. }

QingJ © 2025

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