Javdb评分筛选

突出显示好评番号,淡化评价的的

  1. // ==UserScript==
  2. // @name Javdb评分筛选
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 突出显示好评番号,淡化评价的的
  6. // @author Uka
  7. // @match https://javdb.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=javdb.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. let items = document.getElementsByClassName("item");
  16. for(let i=0; i < items.length; i++) {
  17. let scores = items[i].getElementsByClassName("value")[0].textContent.match(/\d+(.\d+)?/g);
  18. if (scores.length == 2) {
  19. if (parseFloat(scores[0]) < 4.0 || (parseFloat(scores[0]) <= 4.3 && parseInt(scores[1]) < 50)) {
  20. items[i].setAttribute("style", "opacity:30%");
  21. }
  22. if (parseFloat(scores[0]) > 4.0 && parseInt(scores[1]) > 300) {
  23. items[i].setAttribute("style", "border-width: 5px;border-style:solid;border-color:red;");
  24. }
  25. if (parseFloat(scores[0]) > 4.2 && parseInt(scores[1]) > 1000) {
  26. items[i].children[0].setAttribute("style", "background:linear-gradient(orange 70%, yellow 85%, green 100%)");
  27. }
  28. }
  29. }
  30. })();