// ==UserScript== // @name hao123助手 // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.1.0 // @description 用于hao123去广告以及页面美化(其实更丑,不建议使用,也不建议使用hao123) // @author 聚高- // @match *://*hao123.com/ // @grant GM_addStyle // ==/UserScript== /*global ajaxHooker*/ (function () { 'use strict'; // Your code here... const hideElements = () => { const navRecommend = document.getElementById('navrecommend-hjw'); if (navRecommend) { navRecommend.style.display = 'none'; } const ads = document.querySelectorAll('.bottom-banner-link'); ads.forEach(ad => ad.style.display = 'none'); const layout = document.querySelectorAll('.layout-main') layout.forEach(l => l.style.display = 'none'); document.querySelectorAll('.rightTip-img').forEach(r => r.style.display = 'none'); document.querySelectorAll('#shortcut-box').forEach(r => r.style.display = 'none'); document.querySelectorAll('.suggest').forEach(r => r.style.display = 'none'); }; const observer = new MutationObserver(hideElements); observer.observe(document.body, { childList: true, subtree: true }); hideElements(); GM_addStyle(` .nav-container { right: 20px; bottom: 20px; background: linear-gradient(135deg,rgb(85, 85, 85) 0%, #16213e 100%); border-radius: 15px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); width: 100%; transition: transform 0.3s ease; } .nav-header { text-align: center; margin-bottom: 20px; } .nav-title { color: #fff; font-family: 'Arial', sans-serif; font-size: 24px; margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,0.3); } .category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 15px; } .category-card { background: rgba(255,255,255,0.1); border-radius: 10px; padding: 15px; backdrop-filter: blur(5px); transition: transform 0.2s ease; } .category-card:hover { transform: translateY(-5px); } .category-title { color: #e94560; font-size: 14px; margin: 0 0 10px 0; font-weight: bold; text-align: center; } .link-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } .nav-link { display: flex; align-items: center; padding: 8px; background: rgba(255,255,255,0.05); border-radius: 6px; color: #fff; text-decoration: none; font-size: 12px; transition: all 0.2s ease; } .nav-link:hover { background: rgba(229,69,96,0.2); box-shadow: 0 4px 6px rgba(0,0,0,0.2); } .link-icon { width: 20px; height: 20px; margin-right: 8px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2)); } `); // 导航面板HTML结构 const navHTML = ` `; document.body.insertAdjacentHTML('beforeend', navHTML); })();