Javdb评分筛选

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Javdb评分筛选
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  突出显示好评番号,淡化评价的的
// @author       Uka
// @match        https://javdb.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=javdb.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    let items = document.getElementsByClassName("item");
    for(let i=0; i < items.length; i++) {
        let scores = items[i].getElementsByClassName("value")[0].textContent.match(/\d+(.\d+)?/g);
        if (scores.length == 2) {
            if (parseFloat(scores[0]) < 4.0 || (parseFloat(scores[0]) <= 4.3 && parseInt(scores[1]) < 50)) {
                items[i].setAttribute("style", "opacity:30%");
            }
            if (parseFloat(scores[0]) > 4.0 && parseInt(scores[1]) > 300) {
                items[i].setAttribute("style", "border-width: 5px;border-style:solid;border-color:red;");
            }
            if (parseFloat(scores[0]) > 4.2 && parseInt(scores[1]) > 1000) {
                items[i].children[0].setAttribute("style", "background:linear-gradient(orange 70%, yellow 85%, green 100%)");
            }
        }
    }
})();