nexus click

app.nexus.xyz click

As of 2025-02-19. See the latest version.

// ==UserScript==
// @name         nexus click
// @namespace    nexus.xyz
// @version      2025-02-19 01
// @description  app.nexus.xyz click
// @author       You
// @match        https://app.nexus.xyz
// @icon         https://www.google.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
     console.log('...........................');

    function getTargetElements() {
        // 获取目标图片及父容器
        const targetImg = document.querySelector('img[alt*="Circle Image"]');
        if (!targetImg) {
            console.log("未找到基础图片元素");
            return null;
        }

        const parentDiv = targetImg.closest('div.relative');
        if (!parentDiv) {
            console.log("未找到带 relative 类的父容器");
            return null;
        }

        return { img: targetImg, parentDiv };
    }

    function checkAndClick() {
        const elements = getTargetElements();
        if (elements) {
            // 最终点击前的二次验证
            if (!elements.img.classList.contains('invert')) {
                console.log("最终检测到 invert 类,终止点击");
                return;
            }
            console.log("执行点击操作:", elements.parentDiv);
            elements.parentDiv.click();
        } else {
            console.log("操作条件未满足");
        }
    }

    function scheduleCheck() {
        setTimeout(() => {
            checkAndClick();
            scheduleCheck();
        }, 1000 * 10);
    }

    setTimeout(function() {
        location.reload(true);
    }, 1800000); // 30分钟后执行刷新

    scheduleCheck();
})();