明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: maiko

油猴脚本_论坛切换小面板

[复制链接]
发表于 2025-8-29 12:33:25 | 显示全部楼层
yanshengjiang 发表于 2025-8-29 12:18
明经通道LISP快速导航
        
            
  • 明经_最新回复
    1. // ==UserScript==
    2. // @name 明经通道论坛小面板
    3. // @namespace http://tampermonkey.net/
    4. // @version 1.0.0
    5. // @description 在所有网站显示明经通道论坛导航面板
    6. // @author maiko
    7. // @icon http://www.mjtd.com/favicon.ico
    8. // @require https://code.jquery.com/jquery-3.6.0.min.js
    9. // @grant GM_addStyle
    10. // @grant unsafeWindow
    11. // @run-at document-end
    12. // @match *://*/*
    13. // ==/UserScript==

    14. (function() {
    15. 'use strict';

    16. // 添加面板样式
    17. const panelStyle = `
    18. #happy_monkey {
    19. position: fixed;
    20. left: 0;
    21. top: 100px;
    22. z-index: 10000;
    23. filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.12));
    24. transition: all 0.3s ease;
    25. }

    26. .happy_monkey_head {
    27. background: linear-gradient(135deg, #d94040 0%, #BA350F 100%);
    28. color: rgba(255, 255, 255, 0.95);
    29. width: 20px;
    30. padding: 12px 4px;
    31. display: flex;
    32. align-items: center;
    33. justify-content: center;
    34. font-size: 1em;
    35. font-weight: 700;
    36. text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    37. border-radius: 4px;
    38. margin-bottom: 8px;
    39. writing-mode: vertical-lr;
    40. text-orientation: upright;
    41. letter-spacing: 0.5em;
    42. line-height: 1.8;
    43. cursor: pointer;
    44. transition: all 0.3s ease;
    45. }

    46. .happy_monkey_head:hover {
    47. transform: translateX(5px);
    48. }

    49. .happy_monkey_main {
    50. background: linear-gradient(to right, rgba(255, 255, 255, 0.98) 0%, rgba(240, 245, 255, 0.96) 100%);
    51. color: #2D3748;
    52. width: 140px;
    53. padding: 12px 16px;
    54. cursor: pointer;
    55. border-left: 2px solid rgba(0, 0, 0, 0.05);
    56. position: absolute;
    57. left: 30px;
    58. top: 0;
    59. font-size: 1em;
    60. transition: all 0.3s ease;
    61. box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    62. border-radius: 6px;
    63. opacity: 0;
    64. transform: translateX(-10px);
    65. pointer-events: none;
    66. }

    67. .happy_monkey_main.visible {
    68. opacity: 1;
    69. transform: translateX(0);
    70. pointer-events: auto;
    71. }

    72. #happy_monkey ul {
    73. padding: 0;
    74. margin: 0;
    75. display: flex;
    76. flex-direction: column;
    77. gap: 8px;
    78. }

    79. #happy_monkey li {
    80. list-style: none;
    81. transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    82. }

    83. #happy_monkey li:hover {
    84. transform: translateX(8px);
    85. filter: brightness(110%);
    86. }

    87. #happy_monkey a {
    88. display: flex;
    89. align-items: center;
    90. text-decoration: none;
    91. font-family: 'Segoe UI', 'SF Pro Display', system-ui, sans-serif;
    92. font-weight: 600;
    93. border-radius: 8px;
    94. overflow: hidden;
    95. padding: 8px 12px;
    96. background-color: #ffffff;
    97. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    98. transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
    99. color: #333;
    100. font-size: 12px;
    101. }

    102. #happy_monkey a:hover {
    103. transform: scale(1.03);
    104. box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    105. background-color: #f0f4f8;
    106. }
    107. `;

    108. // 添加样式到页面
    109. GM_addStyle(panelStyle);

    110. // 创建面板HTML
    111. const panelHTML = `
    112. <div id="happy_monkey">
    113. <div class="happy_monkey_head">明经通道LISP快速导航</div>
    114. <ul class="happy_monkey_main" id="happy_monkey_tao">
    115. <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=new" target="_blank">明经_最新回复</a></li>
    116. <li><a href="http://bbs.mjtd.com/forum-3-1.html" target="_blank">明经_编程技术</a></li>
    117. <li><a href="http://bbs.mjtd.com/forum-25-1.html" target="_blank">明经_编程申请</a></li>
    118. <li><a href="http://bbs.mjtd.com/forum-16-1.html" target="_blank">明经_源码共享</a></li>
    119. <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=newthread" target="_blank">明经_最新发表</a></li>
    120. <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=hot" target="_blank">明经_最新热门</a></li>
    121. <li><a href="http://bbs.mjtd.com/forum.php?mod=collection&action=view&ctid=13" target="_blank">明经_通用函数</a></li>
    122. <li><a href="http://bbs.mjtd.com/forum.php?mod=collection&action=view&ctid=3" target="_blank">明经_高飞鸟</a></li>
    123. <li><a href="http://bbs.mjtd.com/forum.php?mod=forumdisplay&fid=3&filter=typeid&typeid=109" target="_blank">明经_Gu_xl</a></li>
    124. <li><a href="http://bbs.xdcad.net/forum-260-1.html" target="_blank">晓东_开源库</a></li>
    125. <li><a href="http://bbs.xdcad.net/forum.php?mod=forumdisplay&fid=14&filter=typeid&typeid=226" target="_blank">晓东_每日一码</a></li>
    126. </ul>
    127. </div>
    128. `;

    129. // 添加面板到页面
    130. $('body').append(panelHTML);

    131. // 面板显示/隐藏功能
    132. let panelTimeout;

    133. $('.happy_monkey_head').hover(
    134. function() {
    135. clearTimeout(panelTimeout);
    136. $('#happy_monkey_tao').addClass('visible');
    137. },
    138. function() {
    139. panelTimeout = setTimeout(() => {
    140. $('#happy_monkey_tao').removeClass('visible');
    141. }, 300);
    142. }
    143. );

    144. $('#happy_monkey_tao').hover(
    145. function() {
    146. clearTimeout(panelTimeout);
    147. $(this).addClass('visible');
    148. },
    149. function() {
    150. $(this).removeClass('visible');
    151. }
    152. );

    153. // 初始隐藏菜单
    154. $('#happy_monkey_tao').removeClass('visible');

    155. // 面板拖动功能
    156. let isDragging = false;
    157. let offsetX, offsetY;

    158. $('#happy_monkey').mousedown(function(e) {
    159. if (e.target.classList.contains('happy_monkey_head')) {
    160. isDragging = true;
    161. offsetX = e.clientX - $(this).offset().left;
    162. offsetY = e.clientY - $(this).offset().top;
    163. }
    164. });

    165. $(document).mousemove(function(e) {
    166. if (isDragging) {
    167. $('#happy_monkey').css({
    168. left: (e.clientX - offsetX) + 'px',
    169. top: (e.clientY - offsetY) + 'px'
    170. });
    171. }
    172. });

    173. $(document).mouseup(function() {
    174. isDragging = false;
    175. });
    176. })();
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2025-8-29 13:13:21 | 显示全部楼层

    好是好,但是每个脚本这样弄,浏览器会拖慢了
    回复 支持 反对

    使用道具 举报

    发表于 2025-8-29 16:20:03 | 显示全部楼层
    AI各种魔改
    翻译不乱码、加字体、颜色
    1. // ==UserScript==
    2. // @name         明经通道论坛小面板
    3. // @namespace    http://tampermonkey.net/
    4. // @version      1.0.3
    5. // @description  在所有网站显示明经通道论坛导航面板,蓝色标注晓东链接,红色标注国外链接
    6. // @author       maiko
    7. // @icon         http://www.mjtd.com/favicon.ico
    8. // @require      https://code.jquery.com/jquery-3.6.0.min.js
    9. // @grant        GM_addStyle
    10. // @grant        GM_addElement
    11. // @run-at       document-end
    12. // @match        *://*/*
    13. // ==/UserScript==

    14. (function() {
    15. 'use strict';

    16. // 防止翻译的元字符保护
    17. GM_addElement('head', 'meta', {
    18.     charset: 'utf-8',
    19.     name: 'google',
    20.     content: 'notranslate'
    21. });

    22. // 添加面板样式 - 包含防翻译保护和链接颜色样式
    23. const panelStyle = `
    24. #happy_monkey,
    25. #happy_monkey * {
    26.   font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif !important;
    27.   text-transform: none !important;
    28.   unicode-bidi: normal !important;
    29. }

    30. #happy_monkey {
    31.   position: fixed;
    32.   left: 0;
    33.   top: 100px;
    34.   z-index: 10000;
    35.   filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.12));
    36.   transition: all 0.3s ease;
    37. }

    38. .happy_monkey_head {
    39.   background: linear-gradient(135deg, #d94040 0%, #BA350F 100%);
    40.   color: rgba(255, 255, 255, 0.95) !important;
    41.   width: 20px;
    42.   padding: 12px 4px;
    43.   display: flex;
    44.   align-items: center;
    45.   justify-content: center;
    46.   font-size: 1em;
    47.   font-weight: 700;
    48.   text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    49.   border-radius: 4px;
    50.   margin-bottom: 8px;
    51.   writing-mode: vertical-lr;
    52.   text-orientation: upright;
    53.   letter-spacing: 0.5em;
    54.   line-height: 1.8;
    55.   cursor: pointer;
    56.   transition: all 0.3s ease;
    57. }

    58. .happy_monkey_head:hover {
    59.   transform: translateX(5px);
    60. }

    61. .happy_monkey_main {
    62.   background: linear-gradient(to right, rgba(255, 255, 255, 0.98) 0%, rgba(240, 245, 255, 0.96) 100%);
    63.   color: #2D3748 !important;
    64.   width: 140px;
    65.   padding: 12px 16px;
    66.   cursor: pointer;
    67.   border-left: 2px solid rgba(0, 0, 0, 0.05);
    68.   position: absolute;
    69.   left: 30px;
    70.   top: 0;
    71.   font-size: 1em;
    72.   transition: all 0.3s ease;
    73.   box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    74.   border-radius: 6px;
    75.   opacity: 0;
    76.   transform: translateX(-10px);
    77.   pointer-events: none;
    78. }

    79. .happy_monkey_main.visible {
    80.   opacity: 1;
    81.   transform: translateX(0);
    82.   pointer-events: auto;
    83. }

    84. #happy_monkey ul {
    85.   padding: 0;
    86.   margin: 0;
    87.   display: flex;
    88.   flex-direction: column;
    89.   gap: 8px;
    90. }

    91. #happy_monkey li {
    92.   list-style: none;
    93.   transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    94. }

    95. #happy_monkey li:hover {
    96.   transform: translateX(8px);
    97.   filter: brightness(110%);
    98. }

    99. #happy_monkey a {
    100.   display: flex;
    101.   align-items: center;
    102.   text-decoration: none !important;
    103.   font-family: 'Microsoft YaHei', '微软雅黑', sans-serif !important;
    104.   font-weight: 600;
    105.   border-radius: 8px;
    106.   overflow: hidden;
    107.   padding: 8px 12px;
    108.   background-color: #ffffff;
    109.   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    110.   transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
    111.   color: #333 !important;
    112.   font-size: 12px !important;
    113. }

    114. #happy_monkey a:hover {
    115.   transform: scale(1.03);
    116.   box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    117.   background-color: #f0f4f8;
    118. }

    119. /* 晓东链接特殊样式 - 蓝色文字 */
    120. #happy_monkey a.xiaodong-link {
    121.   color: #1976D2 !important;  /* 深蓝色 */
    122. }

    123. #happy_monkey a.xiaodong-link:hover {
    124.   color: #0D47A1 !important;  /* 悬停时更深的蓝色 */
    125. }

    126. /* 国外链接特殊样式 - 红色文字 */
    127. #happy_monkey a.foreign-link {
    128.   color: #D32F2F !important;  /* 深红色 */
    129. }

    130. #happy_monkey a.foreign-link:hover {
    131.   color: #B71C1C !important;  /* 悬停时更深的红色 */
    132. }
    133. `;

    134. // 添加样式到页面
    135. GM_addStyle(panelStyle);

    136. // 创建面板HTML - 添加notranslate类保护和链接特殊类
    137. const panelHTML = `
    138. <div id="happy_monkey" class="notranslate">
    139.   <div class="happy_monkey_head notranslate">明经通道LISP快速导航</div>
    140.   <ul class="happy_monkey_main notranslate" id="happy_monkey_tao">
    141.     <li><a href="http://bbs.mjtd.com/forum-3-1.html" target="_blank" class="notranslate">明经_编程技术</a></li>
    142.     <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=new" target="_blank" class="notranslate">明经_最新回复</a></li>
    143.     <li><a href="http://bbs.mjtd.com/forum-25-1.html" target="_blank" class="notranslate">明经_编程申请</a></li>
    144.     <li><a href="http://bbs.mjtd.com/forum-16-1.html" target="_blank" class="notranslate">明经_源码共享</a></li>
    145.     <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=newthread" target="_blank" class="notranslate">明经_最新发表</a></li>
    146.     <li><a href="http://bbs.mjtd.com/forum.php?mod=guide&view=hot" target="_blank" class="notranslate">明经_最新热门</a></li>
    147.     <li><a href="http://bbs.mjtd.com/forum.php?mod=collection&action=view&ctid=13" target="_blank" class="notranslate">明经_通用函数</a></li>
    148.     <li><a href="http://bbs.mjtd.com/forum.php?mod=collection&action=view&ctid=3" target="_blank" class="notranslate">明经_高飞鸟</a></li>
    149.     <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>
    150.     <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>

    151.     <!-- 添加晓东链接特殊类 -->
    152.     <li><a href="http://bbs.xdcad.net/forum-260-1.html" target="_blank" class="notranslate xiaodong-link">晓东_开源库</a></li>
    153.     <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>

    154.     <!-- 添加外国链接特殊类 -->
    155.     <li><a href="https://www.theswamp.org/" target="_blank" class="notranslate foreign-link">国外_theswamp</a></li>
    156.     <li><a href="https://www.lee-mac.com/tabsort.html" target="_blank" class="notranslate foreign-link">国外_lee-mac</a></li>
    157.     <li><a href="https://www.afralisp.net/" target="_blank" class="notranslate foreign-link">国外_afralisp</a></li>
    158.   </ul>
    159. </div>
    160. `;

    161. // 添加面板到页面
    162. $('body').append(panelHTML);

    163. // 面板显示/隐藏功能
    164. let panelTimeout;

    165. $('.happy_monkey_head').hover(
    166.   function() {
    167.     clearTimeout(panelTimeout);
    168.     $('#happy_monkey_tao').addClass('visible');
    169.   },
    170.   function() {
    171.     panelTimeout = setTimeout(() => {
    172.       $('#happy_monkey_tao').removeClass('visible');
    173.     }, 300);
    174.   }
    175. );

    176. $('#happy_monkey_tao').hover(
    177.   function() {
    178.     clearTimeout(panelTimeout);
    179.     $(this).addClass('visible');
    180.   },
    181.   function() {
    182.     $(this).removeClass('visible');
    183.   }
    184. );

    185. // 初始隐藏菜单
    186. $('#happy_monkey_tao').removeClass('visible');

    187. // 面板拖动功能
    188. let isDragging = false;
    189. let offsetX, offsetY;

    190. $('#happy_monkey').mousedown(function(e) {
    191.   if (e.target.classList.contains('happy_monkey_head')) {
    192.     isDragging = true;
    193.     offsetX = e.clientX - $(this).offset().left;
    194.     offsetY = e.clientY - $(this).offset().top;
    195.   }
    196. });

    197. $(document).mousemove(function(e) {
    198.   if (isDragging) {
    199.     $('#happy_monkey').css({
    200.       left: (e.clientX - offsetX) + 'px',
    201.       top: (e.clientY - offsetY) + 'px'
    202.     });
    203.   }
    204. });

    205. $(document).mouseup(function() {
    206.   isDragging = false;
    207. });
    208. })();

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?注册

    x
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2025-8-29 16:54:40 | 显示全部楼层
    yanshengjiang 发表于 2025-8-29 16:20
    AI各种魔改
    翻译不乱码、加字体、颜色

    你能翻墙google?
    回复 支持 反对

    使用道具 举报

    发表于 2025-8-29 19:21:44 | 显示全部楼层

    没有,就是火狐浏览器自动翻译英语网站的时候,这个AI代码可以不乱码。
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
    ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

    GMT+8, 2025-9-16 05:02 , Processed in 0.166939 second(s), 17 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表