WK Smaller Lessons And Reviews Buttons

try to take over the world!

目前为 2020-03-10 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WK Smaller Lessons And Reviews Buttons
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description try to take over the world!
  6. // @author You
  7. // @icon https://i.pinimg.com/236x/5f/68/68/5f6868d18acbc1221de49387a3c07833--batman-poster-batman-batman.jpg
  8. // @match https://www.wanikani.com/
  9. // @match https://www.wanikani.com/dashboard
  10. // @require https://greasyfork.org/scripts/369353-jigen-s-other-stuff/code/Jigen's%20other%20stuff.js?version=604095
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. // Your code here...
  17. debugger;
  18. if($('.lessonAndReviewButtons').length == 0){
  19. $($('.sitemap')).before(
  20. `<ul class="lessonAndReviewButtons">
  21. <li class="lessons" data-count="` + $('.lessons-and-reviews__lessons-button span').text() + `">
  22. <a href="/lesson">
  23. <span>` + $('.lessons-and-reviews__lessons-button span').text() + `</span> Lessons
  24. </a> </li>
  25. <li class="reviews" data-count="` + $('.lessons-and-reviews__reviews-button span').text() + `">
  26. <a href="/review">
  27. <span>` + $('.lessons-and-reviews__reviews-button span').text() + `</span> Reviews
  28. </a> </li>
  29. </ul>`);
  30. $('.lessons-and-reviews').remove();
  31. $('.dashboard-progress').css('grid-row','1 / 3');
  32. jigen.addStyle(`
  33. .lessonAndReviewButtons {
  34. display: flex;
  35. flex: 0 1 auto;
  36. list-style: none;
  37. margin: 0;
  38. padding: 0;
  39. width: auto;
  40. }
  41. .lessonAndReviewButtons .lessons, .lessonAndReviewButtons .reviews {
  42. flex: 0 1 auto;
  43. margin-left: 8px;
  44. width: auto;
  45. }
  46. .lessonAndReviewButtons .lessons{
  47. margin-left: 0;
  48. }
  49. .lessonAndReviewButtons li {
  50. display: block;
  51. margin-left: 20px;
  52. width: calc(50% - 10px);
  53. line-height: 20px;
  54. }
  55. .lessonAndReviewButtons li a {
  56. align-items: center;
  57. background: transparent;
  58. border-radius: 4px;
  59. border: 2px solid rgba(0,0,0,0.1);
  60. box-sizing: border-box;
  61. color: #333;
  62. display: flex;
  63. flex-direction: row;
  64. flex-wrap: nowrap;
  65. font-size: 0.875rem;
  66. font-weight: 300;
  67. justify-content: flex-start;
  68. line-height: 28px;
  69. margin: 0;
  70. padding: 0 14px 0 0;
  71. text-decoration: none;
  72. text-shadow: 0 1px 0 #fff;
  73. transition: border-color 0.2s, background 0.2s;
  74. font-weight: normal;
  75. }
  76. .lessonAndReviewButtons li a span{
  77. background: #a0f;
  78. border-radius: 4px 0 0 4px;
  79. color: #fff;
  80. display: block;
  81. float: left;
  82. font-size: 0.75rem;
  83. font-weight: bold;
  84. line-height: 32px;
  85. margin: -2px 12px -2px -2px;
  86. min-width: 16px;
  87. padding: 0 8px;
  88. text-align: center;
  89. text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
  90. vertical-align: middle;
  91. font-size: 0.75rem;
  92. }
  93. .lessonAndReviewButtons li[data-count="0"] span {
  94. background: #aaa;
  95. }
  96. @media (min-width: 768px){
  97. .dashboard .progress-and-forecast .forecast {
  98. grid-row: 1 / 3;
  99. }
  100. }
  101. .navigation-shortcuts {
  102. display: none;
  103. }
  104. `);
  105. }
  106. })();