// ==UserScript== // @name Better Hydro // @namespace http://tampermonkey.net/ // @version 3.0 // @description Improve the Hydro interface with custom settings! // @author Cheerimy // @match *://hydro.ac/* // @match *://oiclass.com/* // @match *://www.oiclass.com/* // @match *://106.53.100.188:1000/* // @icon https://s21.ax1x.com/2024/08/22/pAi6KDP.png // @grant none // @license GPLv3 // @downloadURL none // ==/UserScript== (function() { 'use strict'; //Cookies 初始化函数 function setCookieIfNotExists(name, value) { if (!document.cookie.split('; ').map(cookie => cookie.split('=')[0]).includes(name)) { document.cookie = `${name}=${encodeURIComponent(value)};path=/;expires=${new Date(Date.now()+365*24*60*60*1000).toUTCString()}` } } //获取 Cookies 模块 function getCookie(name) { const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); return match ? decodeURIComponent(match[2]) : null } //初始化 Cookies 模块 function initCookies() { setCookieIfNotExists('browserupdateorg', 'pause'); setCookieIfNotExists('background', 'https://api.imlazy.ink/mcapi/mcbg.php'); setCookieIfNotExists('music', '//music.163.com/outchain/player?type=2&id=133567&auto=0&height=66'); console.log('Cookies 模块加载成功!'); } //基本模块(欢迎栏与 UI 优化) function loadWelcomeMessage() { const username = Array.from(document.querySelectorAll('li[data-dropdown-target="#menu-nav-user"]')).map(item => item.querySelector('a')).find(link => link && link.textContent.trim() !== 'Language')?.textContent.trim() || 'Visitor'; const panel = document.getElementById('panel'); panel.style.backgroundImage = `url(${getCookie('background')})`; panel.style.backgroundSize = 'cover'; panel.style.backgroundPosition = 'center'; const style = document.createElement('style'); style.textContent = `.section{border-radius:8px!important;opacity:0.75!important}.section:hover{opacity:1!important}.section__table-header{border-radius:8px 8px 0 0;opacity:0.75!important}.section__table-header:hover{opacity:1!important}`; document.head.append(style); const title=document.title; const name=title.split(" - ").pop().trim(); const newHTML = `