exh which is gif?

Highlights .gif files in gallery view by adding a glow around the thumbnail. Customizable settings are shown in the right sidebar, under the petition rename/expunge links.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         exh which is gif?
// @namespace    https://sleazyfork.org/en/scripts/436971
// @version      0.31
// @description  Highlights .gif files in gallery view by adding a glow around the thumbnail. Customizable settings are shown in the right sidebar, under the petition rename/expunge links.
// @author       coombrain
// @match        https://exhentai.org/g/*
// @match        https://e-hentai.org/g/*
// @icon         none
// @grant        GM.setValue
// @grant        GM.getValue
// @require      http://code.jquery.com/jquery-latest.min.js
// @license      MIT
// ==/UserScript==
var $ = window.jQuery;

var defc = GM.getValue("wigColor", "#00ffff").then(function(wigColor) { defc = wigColor; });
var defs = GM.getValue("wigSize", 8).then(function(wigSize) { defs = wigSize; });
var defw = GM.getValue("webpChk", true).then(function(webpChk) {defw = webpChk});

(function() {
    'use strict';

    $(document).ready(function () {
        $("#gd5").append(`<div class="wigcn"><a class="g2 wigst" href="#" style="font-weight:bold;">Which is GIF? ⚙️</a></div>`);
        $(".wigcn").append(`<div class="wigcns"><div class="tha nosel wigsto"><input type="color" name="which is gif? glow color" id="cpick" value="${defc}" style="border:none;padding:0;margin:0;height:24px;"></div>`);
        $(".wigcn").append(`<div class="tha nosel wigsto"><input type="number" name="which is gif? glow size" id="wigsz" min="0" value="${defs}" style="border:none;padding:0 0 0 5px;margin:none;max-width:50px;height:24px;"></div>`);
        $(".wigcn").append(`<div class="thtgl nosel wigsto"><label><input type="checkbox" name="which is gif? webp toggle" id="wbpc">Highlight .webp</label></div></div>`);
        $("#wbpc").prop('checked', defw);

        $("#cpick, #wigsz, #wbpc").on("change", wigupd);

        //-----------------
        // Uncomment the line below to hide the setting sidebar once you've set your desired glow color/size. Comment it out again to have it appear again.
        // $(".wigcn").css({"display":"none"});
        //-----------------

        $(".wigsto").css({"display":"none","margin":"0 auto 0 10px"});
        $(".wigst").css({"margin":"0 auto 0 10px","max-width":"150px","padding":"0"}).click(function() {
            $(".wigsto").css("display",$(".wigsto").css("display") == "none" ? "inline-block" : "none");
        });

        wigupd();

        function wigupd() {
            let WG_GLOW_COLOR = $("#cpick")[0].value;
            let WG_GLOW_SIZE = $("#wigsz")[0].value;
            let WG_WEBP_CHK = $("#wbpc")[0].checked;
            GM.setValue("wigColor", WG_GLOW_COLOR);
            GM.setValue("wigSize", WG_GLOW_SIZE);
            GM.setValue("webpChk", WG_WEBP_CHK);
            wigApply(WG_GLOW_COLOR, WG_GLOW_SIZE, WG_WEBP_CHK);
        }

        function wigApply(wigc, wigs, wbpc) {
            $("#gdt a div").each(function() {
                let tmtl = $(this).attr("title");
                let tmei = tmtl.lastIndexOf(".") + 1;
                let tmex = tmtl.substr(tmei);

                console.log(wbpc)

                if (tmex == "gif" || tmex == "apng" || tmex == "webm" || (tmex == "webp" && wbpc == true)) {
                    //as of writing only gif is supported on exh galleries so lol
                    $(this).css("box-shadow", `0 0 ${wigs}px ${wigc}`);
                } else if (tmex == "webp" && wbpc == false) {
                    $(this).css("box-shadow", `0 0 0px ${wigc}`);
                }
            });
       }
    });

})();