Greasy Fork 支持简体中文。

Google Classroom Custom Loading for Homes (Exclude GoGuardian)

Move spinner lower and add loading text on Google Classroom homes (not schools using GoGuardian).

  1. // ==UserScript==
  2. // @name Google Classroom Custom Loading for Homes (Exclude GoGuardian)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Move spinner lower and add loading text on Google Classroom homes (not schools using GoGuardian).
  6. // @author Your Name
  7. // @match https://classroom.google.com/*
  8. // @grant GM_addStyle
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Function to detect if GoGuardian is active
  15. function isGoGuardianActive() {
  16. // Check if elements related to GoGuardian are present on the page
  17. return !!document.querySelector('iframe[src*="goguardian.com"], script[src*="goguardian.com"]');
  18. }
  19.  
  20. // Only run this script if GoGuardian is NOT active
  21. if (!isGoGuardianActive()) {
  22. // Apply custom CSS to move the spinner lower on the home page
  23. GM_addStyle(`
  24. /* Targeting the loading spinner */
  25. .uArJ5e.Y5sE8d.VkkpIf {
  26. top: 60% !important; /* Move the spinner lower */
  27. transform: translateY(-50%); /* Center it vertically */
  28. }
  29.  
  30. /* Add custom loading text */
  31. #custom-loading-text {
  32. position: absolute;
  33. top: 65%; /* Position just below the spinner */
  34. width: 100%;
  35. text-align: center;
  36. font-size: 18px;
  37. color: #666;
  38. font-family: Arial, sans-serif;
  39. }
  40. `);
  41.  
  42. // Create and append the custom loading text element
  43. const loadingText = document.createElement('div');
  44. loadingText.id = 'custom-loading-text';
  45. loadingText.innerText = 'Loading... Please wait.';
  46. document.body.appendChild(loadingText);
  47. }
  48.  
  49. })();