Youtube New UI Fix

Fixes the new UI to one that resembles old one

当前为 2015-08-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Youtube New UI Fix
  3. // @namespace YtNewUIFix
  4. // @description Fixes the new UI to one that resembles old one
  5. // @author Roy Scheerens
  6. // @include https://www.youtube.com/*
  7. // @version 1.3.3
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. //mouse over the controls to update them (this seems to also work with 2000ms instead of 1000ms)
  13. var evObj = document.createEvent('Events');
  14. evObj.initEvent("mousemove", true, false);
  15. var moviePlayer = document.getElementById("movie_player");
  16. setInterval(function() { moviePlayer.dispatchEvent(evObj); }, 1000);
  17. //the css:
  18. var css = document.createElement('style');
  19. css.type = "text/css";
  20. css.textContent = [
  21. /* fixing the colors */
  22. " .ytp-chrome-bottom { background-color: #1B1B1B!important; }",
  23. " .ytp-svg-fill { fill: #8E8E8E!important; }",
  24. " #movie_player { height: calc(100% + 35px)!important; }",
  25. " .html5-video-content { background-color: black!important; }",
  26. " .ytp-panelpopup { background: rgb(28, 28, 28) none repeat scroll 0% 0%!important; } ",
  27.  
  28. /* moving the content below down */
  29. " #watch7-content, div.watch-stage-mode #watch7-sidebar { transform: translateY(35px)!important; }",
  30.  
  31. /* controls always visible */
  32. " .ytp-chrome-bottom { opacity: 1!important; }",
  33.  
  34. /* move controls to the right place */
  35. " #movie_player { height: calc(100% + 35px)!important; }",
  36. " .ytp-gradient-bottom, .ytp-gradient-top, .ytp-chrome-top { display: none!important; }",
  37. " .ytp-chrome-controls { width: calc(100% + 24px)!important; transform: translateX(-12px)!important; }",
  38.  
  39. /* Fix the theater black bars */
  40. " .watch-stage-mode #theater-background::after { content: ''; height: 35px; bottom: -35px; left: 0px; position: absolute; background-color: black; width: 100%; }",
  41.  
  42. /* scale down the controls */
  43. " .ytp-chrome-bottom { transform: translateY(5px)!important; }",
  44. " .ytp-chrome-bottom::before {content: ''; bottom: 0px; top: -1px; left: -12px; right: -12px; position: absolute; background-color: #1B1B1B; z-index: -1000; }",
  45. " .ytp-chrome-controls { height: 31px!important; line-height: 31px!important; font-size: 11px!important; }",
  46. " .ytp-chrome-controls .ytp-button:not(.ytp-play-button) { width: 32px!important; }",
  47. " .ytp-play-button { width: 41px!important; }",
  48. " .ytp-progress-bar-container { height: 5px!important; }",
  49.  
  50. /* scale down the controls big mode */
  51. " .ytp-big-mode .ytp-chrome-bottom { transform: translateY(24px)!important; }",
  52. " .html5-video-container { height: 100%!important; }",
  53. " .html5-main-video { max-height: calc(100% - 35px)!important; }",
  54. " .ytp-big-mode .ytp-progress-bar-container { transform: translateY(-1px)!important; }",
  55.  
  56. /* Fix the quality badge (red HD rectangle) */
  57. " .ytp-settings-button.ytp-hd-quality-badge::after,.ytp-settings-button.ytp-4k-quality-badge::after,.ytp-settings-button.ytp-5k-quality-badge::after,.ytp-settings-button.ytp-8k-quality-badge::after",
  58. " {",
  59. " content:''!important;",
  60. " position:absolute!important;",
  61. " top:6px!important;",
  62. " right:4px!important;",
  63. " height:9px!important;",
  64. " width:13px!important;",
  65. " background-color:#f12b24!important;",
  66. " border-radius:1px!important;",
  67. " line-height:normal!important;",
  68. " background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTMgOSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4NCiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsLW9wYWNpdHk9IjAuNjQ3MSIgZmlsbD0iIzAwMDAwMCIgZD0iTTUsNyBMNiw3IEw2LDggTDUsOCBMNSw3IFogTTEwLDMgTDEwLDQgTDgsNCBMOCwzIEwxMCwzIFogTTMsNiBMMyw1IEw1LDUgTDUsNiBMMyw2IFogTTIsNyBMMyw3IEwzLDggTDIsOCBMMiw3IFogTTcsNyBMMTAsNyBMMTAsOCBMNyw4IEw3LDcgWiBNMTAsNiBMMTEsNiBMMTEsNyBMMTAsNyBMMTAsNiBaIj48L3BhdGg+DQogIDxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI0ZGRkZGRiIgZD0iTTUsNyBMNSw2IEw1LDUgTDMsNSBMMyw2IEwzLDcgTDIsNyBMMiwyIEwzLDIgTDMsNCBMNSw0IEw1LDIgTDYsMiBMNiw3IEw1LDcgWiBNMTEsNiBMMTAsNiBMMTAsNyBMNyw3IEw3LDIgTDEwLDIgTDEwLDMgTDExLDMgTDExLDYgWiBNMTAsNCBMMTAsMyBMOCwzIEw4LDQgTDgsNiBMMTAsNiBMMTAsNCBaIj48L3BhdGg+DQo8L3N2Zz4NCg==')!important;",
  69. " padding: 0!important;",
  70. " }",
  71.  
  72. /* Makes sure the captions/subtitles are at the correct height and don't move up and down */
  73. " .ytp-player-content, .ytp-subtitles-player-content { bottom: 49px!important; } "
  74. ].join("\n");
  75. document.head.appendChild(css);
  76. })();