Click Counter Button

A button that counts clicks

目前為 2025-03-25 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Click Counter Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description A button that counts clicks
  6. // @author Your Name
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Create a button element
  15. const button = document.createElement('button');
  16. button.innerText = '0';
  17. button.style.fontSize = '24px';
  18. button.style.padding = '10px 20px';
  19. button.style.cursor = 'pointer';
  20. document.body.appendChild(button);
  21.  
  22. // Click event listener
  23. let clickCount = 0;
  24. button.addEventListener('click', function() {
  25. clickCount++;
  26. button.innerText = clickCount;
  27.  
  28. // Check if click count reaches 1000
  29. if (clickCount === 1000) {
  30. // Open YouTube video
  31. window.open('https://www.youtube.com/embed/NVLAPYx0dc8?', '_blank');
  32.  
  33. // Alert message after video ends
  34. setTimeout(() => {
  35. alert("Wow! You reached 1000 clicks!!");
  36. }, 10000); // Assuming the video is approximately 10 seconds long
  37. }
  38. });
  39. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址