Greasy Fork

Greasy Fork is available in English.

Pianku 片库评分筛选器手动输入筛选分值,包含没有评分

片库评分筛选功能

当前为 2021-09-09 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Pianku 片库评分筛选器手动输入筛选分值,包含没有评分
// @namespace    http://tampermonkey.net/
// @version      0.74
// @description  片库评分筛选功能
// @author       SSSS
// @match        https://www.mypianku.net/*/*
// @match        https://www.pianku.li/*/*
// @grant        none
// ==/UserScript==

function setScore() {
  let filter_score = prompt('请输入筛选数值0~10.0}:');
  localStorage.setItem('filter_score', filter_score);
}


(function () {
    document.querySelector('header > div > nav > ul > li:nth-child(1)').onclick = function() {
        setScore()
        location.reload()
    }
    let storedScore = ''
    if(!localStorage.getItem('filter_score')) {
        setScore();
    } else {
        storedScore = localStorage.getItem('filter_score');
    }
    document.querySelector('header > div > nav > ul > li:nth-child(1)').innerHTML = '点击重设筛选分数:' + storedScore;
    document.querySelector('header > div > nav > ul > li:nth-child(1)').style.color = "blue";
    document.querySelector('header > div > nav > ul > li:nth-child(1)').style.fontSize = '25px';
    document.querySelector('header > div > nav > ul > li:nth-child(1)').style.padding = '0px 25px';


    var filternum = parseFloat(storedScore)
    for(var num = 1;num<42;num++){
        var item = document.querySelector('body > main > div > ul > li:nth-child(' + num + ') > div.li-bottom > h3 > span')
        var itemv = parseFloat(item.innerText)
        // 如果不包含 N/A
        if (isNaN(itemv)){
            num = num + 0
        //if (isNaN(itemv)){
            //item.parentNode.parentNode.parentNode.remove()
            //num = num - 1
        } else{
            if (itemv < filternum){
            item.parentNode.parentNode.parentNode.remove()
            num = num - 1
            }
        }
    }
})();