readable Quora

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

当前为 2022-08-22 提交的版本,查看 最新版本

  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. // @require https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js
  7. // @version 5.3.0
  8. // @run-at document-idle
  9. // @license MIT License
  10. // @namespace https://greasyfork.org/users/861664
  11. // @compatible edge
  12. // @compatible chrome
  13. // ==/UserScript==
  14.  
  15.  
  16. var color_time = 2;
  17. var move_time = 2;
  18. var zoom_time = 0.8;
  19.  
  20. function anima(){
  21.  
  22. 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";
  23. $(top_banner).css({
  24. "width": parseInt(window.innerWidth -30) +"px",
  25.  
  26. "transform":"translateX("+ (10- $(top_banner).position().left) +"px)",
  27. "transition-timing-function": "ease",
  28. "transition": move_time + 's',
  29. "transition-delay": color_time + 's',
  30. });
  31.  
  32. $(".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({
  33. "transform":"scale(0.8) translateX("+ (14) +"px)",
  34. "transition-timing-function": "ease-out",
  35. "transition": zoom_time + 's',
  36. "transition-delay": (color_time + move_time) + 's',
  37. });
  38. }
  39. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  40.  
  41. $(document).ready(function(){
  42. $($(".qu-px--small")[0]).hide();
  43. $(".qu-bg--red").css({
  44. "background-image": "linear-gradient(to right, #e3622f, #ff7b00 , #ffc65a , violet 83%, rgb(185, 043, 039) 100% )", // "#9a68af"
  45. });
  46. $(".ioqSAj div.q-box").css({
  47. "margin-left": 10 + "px",
  48. "margin-right":0
  49. });
  50. $(".ioqSAj div.q-box").find("div").css({"margin-left":0, "margin-right":0});
  51.  
  52. if( window.location.href == "https://www.quora.com/" || window.location.href.indexOf("/search?q=") >=0 ){
  53. $(".qu-pb--large.qu-flexDirection--row").css({
  54. "position" : "relative",
  55. "left" : (window.innerWidth* -0.045) +"px",
  56. });
  57.  
  58. $(".ioqSAj").css({"width": (window.innerWidth * 2) + "px",});
  59.  
  60. $("#mainContent").css({"width": parseInt(
  61. window.innerWidth * (window.location.href.indexOf("/search?q=")<0 ? 0.655 : 0.84)
  62. )+"px",});
  63.  
  64. $(".q-box.qu-mx--n_medium.PageContentsLayout___StyledBox-d2uxks-0").css({
  65. "width" : (window.innerWidth*0.1) +"px",
  66. });
  67.  
  68. }else{
  69.  
  70. $(".qu-pb--large.qu-flexDirection--row").css({
  71. "width" : (window.innerWidth * 0.98) +"px",
  72. });
  73. $(".ioqSAj").css({"width": (window.innerWidth) + "px",});
  74. $("#mainContent").css({
  75. "width": parseInt(window.innerWidth * 2.2)+"px",
  76. "font-family":"'Yu Gothic', Gadugi, copperplate, Calibri, Helvetica, Verdana, YouYuan,'Source Han Sans', Arial, Verdana, Sans-serif",
  77. "-webkit-font-smoothing": "antialiased",
  78.  
  79. "font-size": "20px",
  80. "line-height": "24px",
  81.  
  82. "transition-timing-function": "ease-out",
  83. "transition": color_time/10 + 's',
  84. });
  85.  
  86. $(".q-box.qu-overflowY--auto.qu-overflowX--hidden.qu-pb--medium.PageContentsLayout___StyledBox-d2uxks-0").css({
  87. "width": (window.innerWidth*0.15) +"px",
  88. "position":"relative",
  89. "left": -15 +"px",
  90.  
  91. "font-size":"14px",
  92. "line-height": "15px",
  93. "font-family":" 'Trebuchet MS', Geneva, Tahoma, Gadugi, copperplate, Calibri, Helvetica, Verdana, YouYuan,'Source Han Sans', Arial, Verdana, Sans-serif",
  94. "-webkit-font-smoothing": "none",
  95. });
  96. }
  97.  
  98. go_green();
  99. function go_green(){
  100. $(".qu-bg--raised").css({
  101. "-webkit-font-smoothing": "antialiased",
  102. "background":"#deecc2", //dbeec6
  103. "transition-timing-function": "ease",
  104. "transition": color_time + 's',
  105. })
  106. }
  107. setInterval(function(){go_green();}, (color_time)*1000);
  108.  
  109. $("#root").css({
  110. "width": (window.innerWidth - 10) + "px",
  111. "overflow":"hidden",
  112.  
  113. "background": "#d4ebc7",//"#EBF4BD",//"#CCE8CF",
  114. "transition-timing-function": "ease",
  115. "transition": color_time + 's',
  116. });
  117.  
  118. window.onload = anima();
  119. });