readable Quora

宽屏显示 + 护眼色 + 回答页大字号 + 页面动画美化。 Wide screen, big font-size, eye-protecting background color, animation effect.

  1. // ==UserScript==
  2. // @name readable Quora
  3. // @author qianjunlang
  4. // @description 宽屏显示 + 护眼色 + 回答页大字号 + 页面动画美化。 Wide screen, big font-size, eye-protecting background color, animation effect.
  5. // @match *.quora.com/*
  6. // @icon https://qsf.cf2.quoracdn.net/-4-images.favicon-new.ico-26-07ecf7cd341b6919.ico
  7. // @require https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js
  8. // @version 5.3.3
  9. // @run-at document-idle
  10. // @license MIT License
  11. // @namespace https://greasyfork.org/users/861664
  12. // @compatible edge
  13. // @compatible chrome
  14. // ==/UserScript==
  15.  
  16.  
  17. var color_time = 5;
  18. var move_time = 3;
  19. var zoom_time = 0.8;
  20.  
  21. function anima(){
  22.  
  23. var top_banner = "div.q-box:last-child > div.q-fixed.qu-fullX.qu-zIndex--header.qu-bg--raised.qu-borderBottom.qu-boxShadow--medium.qu-borderColor--raised:nth-child(2) > div.q-box > div.q-flex.qu-alignItems--center";
  24. $(top_banner).css({
  25. "width": parseInt(window.innerWidth -30) +"px",
  26.  
  27. "transform":"translateX("+ (10- $(top_banner).position().left) +"px)",
  28. "transition-timing-function": "ease",
  29. "transition": move_time + 's',
  30. "transition-delay": color_time + 's',
  31. });
  32.  
  33. $(".qu-display--inline-flex.qu-mr--large.Link___StyledBox-t2xg9c-0.dxHfBI.SiteHeader___StyledLink-us2uvv-1.inlymo.qu-cursor--pointer.qu-hover--textDecoration--underline").css({
  34. "transform":"scale(0.8) translateX("+ (14) +"px)",
  35. "transition-timing-function": "ease-out",
  36. "transition": zoom_time + 's',
  37. "transition-delay": (color_time + move_time) + 's',
  38. });
  39. }
  40. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  41.  
  42. $(document).ready(function(){
  43. $($(".qu-px--small")[0]).hide();
  44. $(".qu-bg--red").css({
  45. "background-image": "linear-gradient(to right, #e3622f, #ff7b00 , #ffc65a , violet 83%, rgb(185, 043, 039) 100% )", // "#9a68af"
  46. });
  47. $(".ioqSAj div.q-box").css({
  48. "margin-left": 10 + "px",
  49. "margin-right":0
  50. });
  51. $(".ioqSAj div.q-box").find("div").css({"margin-left":0, "margin-right":0});
  52.  
  53. if( window.location.href == "https://www.quora.com/" || window.location.href.indexOf("/search?q=") >=0 ){
  54. $(".qu-pb--large.qu-flexDirection--row").css({
  55. "position" : "relative",
  56. "left" : (window.innerWidth* -0.045) +"px",
  57. });
  58.  
  59. $(".ioqSAj").css({"width": (window.innerWidth * 2) + "px",});
  60.  
  61. $("#mainContent").css({"width": parseInt(
  62. window.innerWidth * (window.location.href.indexOf("/search?q=")<0 ? 0.655 : 0.84)
  63. )+"px",});
  64.  
  65. $(".q-box.qu-mx--n_medium.PageContentsLayout___StyledBox-d2uxks-0").css({
  66. "width" : (window.innerWidth*0.1) +"px",
  67. });
  68.  
  69. }else{
  70.  
  71. $(".qu-pb--large.qu-flexDirection--row").css({
  72. "width" : (window.innerWidth * 0.98) +"px",
  73. });
  74. $(".ioqSAj").css({"width": (window.innerWidth) + "px",});
  75. $("#mainContent").css({
  76. "width": parseInt(window.innerWidth * 2.2)+"px",
  77. "font-family":"'Yu Gothic', Gadugi, copperplate, Calibri, Helvetica, Verdana, YouYuan,'Source Han Sans', Arial, Verdana, Sans-serif",
  78. "-webkit-font-smoothing": "antialiased",
  79.  
  80. "font-size": "20px",
  81. "line-height": "24px",
  82.  
  83. "transition-timing-function": "ease-out",
  84. "transition": 0.1 + 's',
  85. });
  86.  
  87. $(".q-box.qu-overflowY--auto.qu-overflowX--hidden.qu-pb--medium.PageContentsLayout___StyledBox-d2uxks-0").css({
  88. "width": (window.innerWidth*0.15) +"px",
  89. "position":"relative",
  90. "left": -15 +"px",
  91.  
  92. "font-size":"14px",
  93. "line-height": "15px",
  94. "font-family":" 'Trebuchet MS', Geneva, Tahoma, Gadugi, copperplate, Calibri, Helvetica, Verdana, YouYuan,'Source Han Sans', Arial, Verdana, Sans-serif",
  95. "-webkit-font-smoothing": "none",
  96. });
  97. }
  98.  
  99. go_green();
  100. function go_green(){
  101. $(".qu-bg--raised").css({
  102. "-webkit-font-smoothing": "antialiased",
  103. "background":"#deecc2", //dbeec6
  104. "transition-timing-function": "ease",
  105. "transition": color_time + 's',
  106. })
  107. }
  108. setInterval(function(){go_green();}, 500);
  109.  
  110. $("#root").css({
  111. "width": (window.innerWidth - 10) + "px",
  112. "overflow":"hidden",
  113.  
  114. "background": "#d4ebc7",//"#EBF4BD",//"#CCE8CF",
  115. "transition-timing-function": "ease",
  116. "transition": color_time + 's',
  117. });
  118.  
  119. window.onload = anima();
  120. });