Coindoog Faucet Auto Refresh + Timer

Auto-refresh Coindoog faucet page every 1 minute with on-screen countdown

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Coindoog Faucet Auto Refresh + Timer
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Auto-refresh Coindoog faucet page every 1 minute with on-screen countdown
// @author        KukuModZ
// @match        https://coindoog.com/faucet/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const REFRESH_INTERVAL = 60; // seconds

    // Create timer element
    const timerBox = document.createElement('div');
    timerBox.style.position = 'fixed';
    timerBox.style.bottom = '10px';
    timerBox.style.right = '10px';
    timerBox.style.padding = '8px 12px';
    timerBox.style.background = 'rgba(0,0,0,0.7)';
    timerBox.style.color = 'white';
    timerBox.style.fontSize = '14px';
    timerBox.style.borderRadius = '5px';
    timerBox.style.zIndex = '9999';
    timerBox.style.fontFamily = 'monospace';
    document.body.appendChild(timerBox);

    let secondsLeft = REFRESH_INTERVAL;
    timerBox.textContent = `Refreshing in ${secondsLeft}s`;

    // Countdown timer
    const interval = setInterval(() => {
        secondsLeft--;
        if (secondsLeft <= 0) {
            clearInterval(interval);
            location.reload();
        } else {
            timerBox.textContent = `Refreshing in ${secondsLeft}s`;
        }
    }, 1000);
})();