GC - Giveaways Helper

Add visual indicators to giveaways to make it easier to distinguish between special, normal, and entered giveaways. Sorts entered giveaways to the bottom of the page.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         GC - Giveaways Helper
// @namespace    https://greasyfork.org/en/users/1175371/
// @version      0.3
// @description  Add visual indicators to giveaways to make it easier to distinguish between special, normal, and entered giveaways. Sorts entered giveaways to the bottom of the page.
// @author       sanjix
// @match        https://www.grundos.cafe/giveaways*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
// @grant        none
// ==/UserScript==

var entered = document.evaluate(
        '//div[contains(@class,"giveaway-item")][p[contains(.,"Entered")]]',
        document,
        null,
        XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
        null
    );

var special = document.evaluate(
        '//div[contains(@class,"giveaway-item")][p[contains(.,"Special")]]',
        document,
        null,
        XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
        null
    );
for (let i = 0; i < special.snapshotLength; i++) {
    special.snapshotItem(i).style.backgroundImage = "linear-gradient(to bottom left, #b827fc 0%, #2c90fc 25%, #b8fd33 50%, #fec837 75%, #fd1892 100%)";
    special.snapshotItem(i).classList.add('special');
}
for (let i = 0; i < entered.snapshotLength; i++) {
    let cur = entered.snapshotItem(i);
    cur.style.backgroundColor = "rgba(128,128,128,.1)";
    cur.style.order = 99999;
    if (cur.classList.contains('special')) {
        cur.style.backgroundImage = "linear-gradient(to left bottom, rgba(199, 0, 255, 0.2), rgba(0,0,255,.2), rgba(0,255,0,.2), rgba(247, 255, 0, 0.2), rgba(255, 131, 0, 0.2), rgba(255,0,0,.2))"
    }
}