Blooket and other school hacks

A basic script to display a menu on a webpage.

目前為 2024-10-02 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Blooket and other school hacks
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description A basic script to display a menu on a webpage.
  6. // @author MrSticker23
  7. // @match *://*/*
  8. // @grant none
  9. // @license MrSticker23
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Create menu container
  16. const menu = document.createElement('div');
  17. menu.style.position = 'fixed';
  18. menu.style.top = '10px';
  19. menu.style.right = '10px';
  20. menu.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  21. menu.style.color = 'white';
  22. menu.style.padding = '10px';
  23. menu.style.borderRadius = '5px';
  24. menu.style.zIndex = '1000';
  25.  
  26. // Add title
  27. const title = document.createElement('h4');
  28. title.textContent = 'Menu';
  29. title.style.margin = '0 0 10px 0';
  30. menu.appendChild(title);
  31.  
  32. // Add menu items (you can customize this section)
  33. const item1 = document.createElement('button');
  34. item1.textContent = 'Action 1';
  35. item1.style.marginBottom = '5px';
  36. item1.onclick = function() {
  37. alert('Action 1 triggered!');
  38. };
  39. menu.appendChild(item1);
  40.  
  41. const item2 = document.createElement('button');
  42. item2.textContent = 'Action 2';
  43. item2.style.marginTop = '5px';
  44. item2.onclick = function() {
  45. alert('Action 2 triggered!');
  46. };
  47. menu.appendChild(item2);
  48.  
  49. // Append the menu to the body
  50. document.body.appendChild(menu);
  51.  
  52. })();