Greasy Fork 还支持 简体中文。

IsThereAnyDeal with thumbnails

Displaying game thumbnails next to the deals

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         IsThereAnyDeal with thumbnails
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Displaying game thumbnails next to the deals
// @author       Zoltan Wacha - steampeek.hu (find similar games)
// @match        https://isthereanydeal.com/*
// @exclude      https://isthereanydeal.com/waitlist/*
// @exclude      https://isthereanydeal.com/collection/*
// @grant        none
// ==/UserScript==

var refreshTimer = null;

let observer = new MutationObserver(mutationsList => {
	for (let mutation of mutationsList)
	{
		if (mutation.type === 'childList')
		{
			clearTimeout(refreshTimer);
            refreshTimer = setTimeout(function () {
                updateThumbs();
            }, 250);
		}
	}
});

observer.observe(document, {childList: true, subtree: true});

function GM_main ($) {
    $("body").prepend("<style>.itadthumb{width:96px;height:36px;background-repeat:no-repeat;background-position:center;background-size:contain;display:inline-block;margin:0 10px 0 0;flex:none;} .itadthumb.nothumb{background-color: #6f6f6f;background-size: 50%;opacity: 0.1;background-image:url(https://d2uym1p5obf9p8.cloudfront.net/images/logo.png)} .itadthumb.placeholder{opacity: 0.3;background-size: 65%;} .gameinfocontainer{flex:1;}</style>");

    clearTimeout(refreshTimer);
    refreshTimer = setTimeout(function () {
        updateThumbs();
    }, 250);
}

function updateThumbs() {
    let thumbadded = false;
    let lnk = null;
    let steamid = null;

    $("#games > .game:not(.thumbnailhandled)").each(function(index) {
        {
            thumbadded = false;
            lnk = $(this).find('.noticeable').attr('href');

            $(this).wrapInner("<div class='gameinfocontainer'></div>");

            if($(this).data("steamid") && $(this).data("steamid").startsWith('app'))
            {
                steamid = $(this).data("steamid");
                steamid = steamid.replace("app", "apps");

                if(steamid)
                {
                    $(this).prepend("<a href='"+lnk+"' class='itadthumb' style='background-image:url(https://steamcdn-a.akamaihd.net/steam/"+steamid+"/capsule_184x69.jpg)'></a>");
                    thumbadded = true;
                }
            }

            if(!thumbadded)
            {
                $(this).prepend("<a href='"+lnk+"' class='itadthumb nothumb'></a>");
            }

            $(this).css("display", "flex");
            $(this).css("align-items", "center");

            $(this).addClass("thumbnailhandled");
        }
    });
}

if (typeof jQuery === "function") {
    GM_main(jQuery);
}