SkyWatchFree

Filter out paid images

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         SkyWatchFree
// @namespace    https://explore.skywatch.com/
// @version      2024-09-03
// @description  Filter out paid images
// @author       Geromet
// @match        https://explore.skywatch.com/
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    function removeNonFreeProducts() {
        const products = document.querySelectorAll('.panel-content.MuiBox-root.mui-0 .MuiPaper-root.MuiPaper-elevation.MuiPaper-rounded.MuiPaper-elevation1.MuiCard-root.product-card.existing-product-card.mui-vlgagv');
        products.forEach(product => {
            const cardInfo = product.querySelector('.card-info.align-items-end.text-right.MuiBox-root.mui-0');
            if (cardInfo) {
                const priceSpan = cardInfo.querySelector('.MuiTypography-root.MuiTypography-caption.mui-rwsqkt');
                if (priceSpan) {
                    const priceText = priceSpan.textContent.trim();
                    if (!/Total:\s*\$0\b/.test(priceText)) {
                        product.remove();
                    }
                }
            }
        });
    }
    function createFloatingButton() {
        const button = document.createElement('button');
        button.innerText = 'Show Free Products';
        button.style.position = 'fixed';
        button.style.bottom = '20px';
        button.style.left = '15px';
        button.style.zIndex = '10000';
        button.style.backgroundColor = '#007BFF';
        button.style.color = 'white';
        button.style.border = 'none';
        button.style.padding = '10px 20px';
        button.style.fontSize = '14px';
        button.style.borderRadius = '5px';
        button.style.cursor = 'pointer';
        button.style.boxShadow = '0px 2px 10px rgba(0, 0, 0, 0.2)';

        button.addEventListener('click', function(event) {
            event.preventDefault();
            removeNonFreeProducts();
        });
        document.body.appendChild(button);
    }
    window.addEventListener('load', function() {
        createFloatingButton();
    });

})();