Greasy Fork 还支持 简体中文。

Click Counter and Mistake Tracker

Counts clicks on the "Generate Random Words" button and mistakes when the counter is clicked

目前為 2024-06-17 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Click Counter and Mistake Tracker
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Counts clicks on the "Generate Random Words" button and mistakes when the counter is clicked
// @author       YourName
// @match        https://randomwordgenerator.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Create a counter display
    const counterDisplay = document.createElement('div');
    counterDisplay.id = 'clickCounter';
    counterDisplay.style.position = 'fixed';
    counterDisplay.style.bottom = '10px';
    counterDisplay.style.right = '10px';
    counterDisplay.style.backgroundColor = 'blue';
    counterDisplay.style.color = 'white';
    counterDisplay.style.padding = '10px';
    counterDisplay.style.border = '1px solid black';
    counterDisplay.style.borderRadius = '5px';
    counterDisplay.style.cursor = 'pointer'; // Make it clickable
    counterDisplay.style.zIndex = '1000';
    document.body.appendChild(counterDisplay);

    // Initialize counters
    let clickCount = 0;
    let mistakeCount = 0;

    // Update the counter display
    function updateCounter() {
        counterDisplay.textContent = `Clicked: ${clickCount} times\nMistakes: ${mistakeCount}`;
    }

    // Attach event listener to the button
    const generateButton = document.querySelector('input[type="submit"][value="Generate Random Words"]');
    if (generateButton) {
        generateButton.addEventListener('click', () => {
            clickCount++;
            updateCounter();
        });
    }

    // Attach event listener to the counter display
    counterDisplay.addEventListener('click', () => {
        mistakeCount++;
        updateCounter();
    });

    // Initialize counter display
    updateCounter();
})();