BetterReading

try to take over the world!

  1. // ==UserScript==
  2. // @name BetterReading
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author greatcl
  7. // @match http://www.laruence.com/*
  8. // @match http://wiki.jikexueyuan.com/*
  9. // @match https://time.geekbang.org/*
  10. // @match http://*.blog.163.com/*
  11. // @require https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. var commonStyle = '<style type="text/css">' +
  18. '#suIcon{background-color: rgba(174, 34, 199, 0.77);display: inline-block;color: white;border-radius: 2px;width: 20px;height: 20px;line-height: 20px;text-align: center;cursor: pointer;position: absolute;top: 120px;left: 20px;padding-top: 2px;}' +
  19. 'body{font-family: Consolas, "Pingfang SC", "Microsoft Yahei";}' +
  20. '</style>';
  21. $('head').append(commonStyle);
  22.  
  23. if (location.host === 'www.laruence.com') {
  24. laruence();
  25. }
  26.  
  27. if (location.host === 'wiki.jikexueyuan.com') {
  28. $('body').css({
  29. 'background-color': '#c8e3f7'
  30. });
  31. $('.detail-nav, .breadcrumb').css({
  32. 'background-color': '#c8e3f7'
  33. });
  34. }
  35.  
  36. if (location.host === 'time.geekbang.org') {
  37. geekTime();
  38. }
  39.  
  40. if (location.host.match(/.*\.blog.163.com/)) {
  41. blog163();
  42. }
  43.  
  44. function blog163() {
  45. $('#blog-163-com-topbar').hide();
  46. }
  47.  
  48. function geekTime() {
  49. $('body').css({
  50. 'background-color': 'rgb(235, 240, 243)',
  51. 'font-family': 'Consolas, "Pingfang SC", "Microsoft Yahei"'
  52. });
  53. $('a').css({
  54. 'text-decoration': 'none'
  55. });
  56. $('.mobile-tips').hide();
  57.  
  58. var style = '<style type="text/css">' +
  59. '.article-item-cover{width: 150px; height: 100px;}' +
  60. 'div.article-content > img:first-of-type{width: 50%;}' +
  61. '.common-content, .article-comments .comment-item, .comment-item .info .bd, .comment-item .info .reply .reply-content{font-size: 0.85rem; line-height: 1.25rem;}' +
  62. '.comment-item {margin-bottom: 0.4rem;}' +
  63. '.comment-item .time, .comment-item .reply-time{display: none;}' +
  64. '.mobile-tips {display: none !important;}' +
  65. '.typo-dl, .typo-form, .typo-hr, .typo-ol, .typo-p, .typo-pre, .typo-table, .typo-ul, .typo dl, .typo form, .typo hr, .typo ol, .typo p, .typo pre, .typo table, .typo ul, blockquote {margin-bottom: 0.7rem;}' +
  66. '</style>';
  67. $('head').append(style);
  68.  
  69. var noDisplayImgList = [
  70. 'https://static001.geekbang.org/resource/image/40/18/40341574317cc135385c6946a17d2818.jpg'
  71. ];
  72.  
  73.  
  74. if (location.pathname.match(/^\/column\/article\/\d+/)) {
  75. setTimeout(function(){
  76. $('title').html($('.article-title').html());
  77.  
  78. $('img').each(function(){
  79. var src = this.src;
  80. for (var i = 0, len = noDisplayImgList.length; i < len; ++i) {
  81. if (src === noDisplayImgList[i]) {
  82. console.log(src);
  83. $(this).hide();
  84. }
  85. }
  86. });
  87.  
  88. $('p a').each(function(){
  89. if (this.text == '戳此获取你的专属海报') {
  90. $(this).hide();
  91. }
  92. });
  93. }, 1000);
  94. }
  95. }
  96.  
  97. function laruence(){
  98. var sidebar = $('.sidebar'),
  99. content = $('.content');
  100. content.css('width', content.width() + sidebar.width());
  101. sidebar.hide();
  102. var style = '<style type="text/css">' +
  103. 'body{background-color: #e7f1f7;font-size: 13px; font-family: Consolas, "Pingfang SC", "Microsoft Yahei";}' +
  104. '.post{color: rgba(20, 4, 56, 0.91);}' +
  105. 'p{font-size: 14px; line-height: 22px; font-family: Consolas, "Pingfang SC", "Microsoft Yahei"; margin: 0 0 8px; text-indent: 2em !important;}' +
  106. '.postmeta{padding-bottom: 10px !important;}' +
  107. '</style>';
  108. $('head').append(style);
  109. $('body').append('<div id="suIcon">原</div>');
  110. //$('p').each(function(){
  111. // $(this).html($.trim($(this).html()));
  112. //});
  113.  
  114. $('#suIcon').on('click', function(){
  115. var me = $(this);
  116. if (me.hasClass('origin')) {
  117. me.removeClass('origin');
  118. me.html('原');
  119. content.css('width', content.width() + sidebar.width());
  120. sidebar.hide();
  121. } else {
  122. me.addClass('origin');
  123. me.html('俗');
  124. sidebar.show();
  125. content.css('width', content.width() - sidebar.width());
  126. }
  127. });
  128. }
  129. })();

QingJ © 2025

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