readable Quora

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

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

  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 http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  7. // @version 5.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 = 4;
  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. $(".q-box.qu-display--inline-flex.qu-mr--large.Link___StyledBox-t2xg9c-0.KlcoI.SiteHeader___StyledLink-us2uvv-1.ZMeFq.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. $(".ioqSAj").css({"width": (window.innerWidth * 2) + "px",});
  54.  
  55. $("#mainContent").css({"width": parseInt(
  56. window.innerWidth * (window.location.href.indexOf("/search?q=")<0 ? 0.655 : 0.84)
  57. )+"px",});
  58.  
  59. }else{
  60. $(".ioqSAj").css({"width": (window.innerWidth -42) + "px",});
  61. $("#mainContent").css({
  62. "width": parseInt(window.innerWidth * 1.8)+"px",
  63. "font-size": "21px",
  64. "line-height": "27px",
  65. "font-family":" Gadugi, copperplate, Calibri, Helvetica, Verdana, YouYuan,'Source Han Sans', Arial, Verdana, Sans-serif",
  66. "-webkit-font-smoothing": "antialiased",
  67. });
  68.  
  69. $(".qu-mb--large div div.q-box").css({
  70. "font-size":"14px",
  71. "font-family":" 'Trebuchet MS', Geneva, Tahoma, Gadugi, copperplate, Calibri, Helvetica, Verdana, YouYuan,'Source Han Sans', Arial, Verdana, Sans-serif",
  72. "-webkit-font-smoothing": "none",
  73. });
  74. }
  75.  
  76. $(".qu-bg--raised").css({
  77. "-webkit-font-smoothing": "antialiased",
  78.  
  79. "background":"#deecc2", //dbeec6
  80. "transition-timing-function": "ease",
  81. "transition": color_time + 's',
  82. });
  83. $("#root").css({
  84. "width": (window.innerWidth - 10) + "px",
  85. "overflow":"hidden",
  86.  
  87. "background": "#d4ebc7",//"#EBF4BD",//"#CCE8CF",
  88. "transition-timing-function": "ease",
  89. "transition": color_time + 's',
  90. });
  91.  
  92. window.onload = anima();
  93. });