IDK

Adds a stylish button to the page that redirects you to a Rickroll link when clicked

  1. // ==UserScript==
  2. // @name IDK
  3. // @namespace http://tampermonkey.net/
  4. // @version 3.5
  5. // @description Adds a stylish button to the page that redirects you to a Rickroll link when clicked
  6. // @author Joshua
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. function redirectToRickroll() {
  15. window.location.href = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
  16. }
  17.  
  18. // Check if the current page URL is the Rickroll link
  19. if (window.location.href !== 'https://www.youtube.com/watch?v=dQw4w9WgXcQ') {
  20. console.log('Creating button...');
  21. var button = document.createElement('button');
  22. button.textContent = 'Click here for a surprise!';
  23. button.style.position = 'fixed';
  24. button.style.bottom = '20px'; // Moved to the bottom
  25. button.style.right = '20px'; // Moved to the right
  26. button.style.zIndex = '9999';
  27. button.style.padding = '15px 30px';
  28. button.style.border = 'none';
  29. button.style.backgroundColor = '#ff0000';
  30. button.style.color = '#ffffff';
  31. button.style.fontFamily = 'Arial, sans-serif';
  32. button.style.fontSize = '18px';
  33. button.style.fontWeight = 'bold';
  34. button.style.borderRadius = '10px';
  35. button.style.boxShadow = '0px 4px 8px rgba(0, 0, 0, 0.3)';
  36. button.style.cursor = 'pointer';
  37. button.style.transition = 'transform 0.2s, box-shadow 0.2s';
  38.  
  39. button.addEventListener('mouseenter', function() {
  40. button.style.transform = 'scale(1.05)';
  41. button.style.boxShadow = '0px 8px 16px rgba(0, 0, 0, 0.3)';
  42. });
  43.  
  44. button.addEventListener('mouseleave', function() {
  45. button.style.transform = 'scale(1)';
  46. button.style.boxShadow = '0px 4px 8px rgba(0, 0, 0, 0.3)';
  47. });
  48.  
  49. button.addEventListener('click', function(event) {
  50. event.preventDefault(); // Prevent default button click action
  51. redirectToRickroll(); // Redirect to the Rickroll link
  52. button.remove(); // Remove the button
  53. });
  54.  
  55. console.log('Appending button to document...');
  56. document.body.appendChild(button);
  57. console.log('Button creation complete.');
  58. }
  59. })();