- 积分
- 6596
- 明经币
- 个
- 注册时间
- 2011-5-13
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2025-8-29 16:20:03
|
显示全部楼层
AI各种魔改
翻译不乱码、加字体、颜色
 - // ==UserScript==
- // @name 明经通道论坛小面板
- // @namespace http://tampermonkey.net/
- // @version 1.0.3
- // @description 在所有网站显示明经通道论坛导航面板,蓝色标注晓东链接,红色标注国外链接
- // @author maiko
- // @icon http://www.mjtd.com/favicon.ico
- // @require https://code.jquery.com/jquery-3.6.0.min.js
- // @grant GM_addStyle
- // @grant GM_addElement
- // @run-at document-end
- // @match *://*/*
- // ==/UserScript==
- (function() {
- 'use strict';
- // 防止翻译的元字符保护
- GM_addElement('head', 'meta', {
- charset: 'utf-8',
- name: 'google',
- content: 'notranslate'
- });
- // 添加面板样式 - 包含防翻译保护和链接颜色样式
- const panelStyle = `
- #happy_monkey,
- #happy_monkey * {
- font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif !important;
- text-transform: none !important;
- unicode-bidi: normal !important;
- }
- #happy_monkey {
- position: fixed;
- left: 0;
- top: 100px;
- z-index: 10000;
- filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.12));
- transition: all 0.3s ease;
- }
- .happy_monkey_head {
- background: linear-gradient(135deg, #d94040 0%, #BA350F 100%);
- color: rgba(255, 255, 255, 0.95) !important;
- width: 20px;
- padding: 12px 4px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 1em;
- font-weight: 700;
- text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
- border-radius: 4px;
- margin-bottom: 8px;
- writing-mode: vertical-lr;
- text-orientation: upright;
- letter-spacing: 0.5em;
- line-height: 1.8;
- cursor: pointer;
- transition: all 0.3s ease;
- }
- .happy_monkey_head:hover {
- transform: translateX(5px);
- }
- .happy_monkey_main {
- background: linear-gradient(to right, rgba(255, 255, 255, 0.98) 0%, rgba(240, 245, 255, 0.96) 100%);
- color: #2D3748 !important;
- width: 140px;
- padding: 12px 16px;
- cursor: pointer;
- border-left: 2px solid rgba(0, 0, 0, 0.05);
- position: absolute;
- left: 30px;
- top: 0;
- font-size: 1em;
- transition: all 0.3s ease;
- box-shadow: 0 2px 4px rgba(0,0,0,0.05);
- border-radius: 6px;
- opacity: 0;
- transform: translateX(-10px);
- pointer-events: none;
- }
- .happy_monkey_main.visible {
- opacity: 1;
- transform: translateX(0);
- pointer-events: auto;
- }
- #happy_monkey ul {
- padding: 0;
- margin: 0;
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
- #happy_monkey li {
- list-style: none;
- transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
- }
- #happy_monkey li:hover {
- transform: translateX(8px);
- filter: brightness(110%);
- }
- #happy_monkey a {
- display: flex;
- align-items: center;
- text-decoration: none !important;
- font-family: 'Microsoft YaHei', '微软雅黑', sans-serif !important;
- font-weight: 600;
- border-radius: 8px;
- overflow: hidden;
- padding: 8px 12px;
- background-color: #ffffff;
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
- transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
- color: #333 !important;
- font-size: 12px !important;
- }
- #happy_monkey a:hover {
- transform: scale(1.03);
- box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
- background-color: #f0f4f8;
- }
- /* 晓东链接特殊样式 - 蓝色文字 */
- #happy_monkey a.xiaodong-link {
- color: #1976D2 !important; /* 深蓝色 */
- }
- #happy_monkey a.xiaodong-link:hover {
- color: #0D47A1 !important; /* 悬停时更深的蓝色 */
- }
- /* 国外链接特殊样式 - 红色文字 */
- #happy_monkey a.foreign-link {
- color: #D32F2F !important; /* 深红色 */
- }
- #happy_monkey a.foreign-link:hover {
- color: #B71C1C !important; /* 悬停时更深的红色 */
- }
- `;
- // 添加样式到页面
- GM_addStyle(panelStyle);
- // 创建面板HTML - 添加notranslate类保护和链接特殊类
- const panelHTML = `
- <div id="happy_monkey" class="notranslate">
- <div class="happy_monkey_head notranslate">明经通道LISP快速导航</div>
- <ul class="happy_monkey_main notranslate" id="happy_monkey_tao">
- <li><a href="http://bbs.mjtd.com/forum-3-1.html" target="_blank" class="notranslate">明经_编程技术</a></li>
- <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=new" target="_blank" class="notranslate">明经_最新回复</a></li>
- <li><a href="http://bbs.mjtd.com/forum-25-1.html" target="_blank" class="notranslate">明经_编程申请</a></li>
- <li><a href="http://bbs.mjtd.com/forum-16-1.html" target="_blank" class="notranslate">明经_源码共享</a></li>
- <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=newthread" target="_blank" class="notranslate">明经_最新发表</a></li>
- <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=hot" target="_blank" class="notranslate">明经_最新热门</a></li>
- <li><a href="http://bbs.mjtd.com/forum.php?mod=collection&action=view&ctid=13" target="_blank" class="notranslate">明经_通用函数</a></li>
- <li><a href="http://bbs.mjtd.com/forum.php?mod=collection&action=view&ctid=3" target="_blank" class="notranslate">明经_高飞鸟</a></li>
- <li><a href="http://bbs.mjtd.com/forum.php?mod=forumdisplay&fid=3&filter=typeid&typeid=109" target="_blank" class="notranslate">明经_Gu_xl</a></li>
- <li><a href="http://www.mjtd.com/home.php?mod=space&uid=396777&do=thread&type=thread&view=me&from=space" target="_blank" class="notranslate">明经_大海</a></li>
- <!-- 添加晓东链接特殊类 -->
- <li><a href="http://bbs.xdcad.net/forum-260-1.html" target="_blank" class="notranslate xiaodong-link">晓东_开源库</a></li>
- <li><a href="http://bbs.xdcad.net/forum.php?mod=forumdisplay&fid=14&filter=typeid&typeid=226" target="_blank" class="notranslate xiaodong-link">晓东_每日一码</a></li>
- <!-- 添加外国链接特殊类 -->
- <li><a href="https://www.theswamp.org/" target="_blank" class="notranslate foreign-link">国外_theswamp</a></li>
- <li><a href="https://www.lee-mac.com/tabsort.html" target="_blank" class="notranslate foreign-link">国外_lee-mac</a></li>
- <li><a href="https://www.afralisp.net/" target="_blank" class="notranslate foreign-link">国外_afralisp</a></li>
- </ul>
- </div>
- `;
- // 添加面板到页面
- $('body').append(panelHTML);
- // 面板显示/隐藏功能
- let panelTimeout;
- $('.happy_monkey_head').hover(
- function() {
- clearTimeout(panelTimeout);
- $('#happy_monkey_tao').addClass('visible');
- },
- function() {
- panelTimeout = setTimeout(() => {
- $('#happy_monkey_tao').removeClass('visible');
- }, 300);
- }
- );
- $('#happy_monkey_tao').hover(
- function() {
- clearTimeout(panelTimeout);
- $(this).addClass('visible');
- },
- function() {
- $(this).removeClass('visible');
- }
- );
- // 初始隐藏菜单
- $('#happy_monkey_tao').removeClass('visible');
- // 面板拖动功能
- let isDragging = false;
- let offsetX, offsetY;
- $('#happy_monkey').mousedown(function(e) {
- if (e.target.classList.contains('happy_monkey_head')) {
- isDragging = true;
- offsetX = e.clientX - $(this).offset().left;
- offsetY = e.clientY - $(this).offset().top;
- }
- });
- $(document).mousemove(function(e) {
- if (isDragging) {
- $('#happy_monkey').css({
- left: (e.clientX - offsetX) + 'px',
- top: (e.clientY - offsetY) + 'px'
- });
- }
- });
- $(document).mouseup(function() {
- isDragging = false;
- });
- })();
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|