图标:可访问的 SVG 实现与性能 - Openclaw Skills

作者:互联网

2026-04-06

AI教程

什么是 图标?

图标技能专注于从传统的图标字体过渡到现代 SVG 标准,确保高性能和原生可访问性。它为处理装饰性和信息性图标提供了健壮的架构,利用 aria-hidden 和 aria-labelledby 等模式确保与屏幕阅读器的兼容性。通过利用 Openclaw Skills 资源,开发人员可以创建主题感知组件,利用 currentColor 实现无缝颜色继承,并建立与排版完美缩放的一致尺寸网格。

下载入口:https://github.com/openclaw/skills/tree/main/skills/ivangdavila/icons

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install icons

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 icons。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

图标 应用场景

  • 为精简的用户界面创建可访问的纯图标按钮。
  • 实现可根据明暗模式自动调整的主题响应式图标。
  • 通过使用 tree-shaken SVG 集合替换庞大的字体库来优化页面加载速度。
  • 构建具有合适触摸目标和描边粗细的移动优先界面。
  • 使用符号精灵(symbol sprites)管理复杂的图标系统,以减少 DOM 开销。
图标 工作原理
  1. 识别图标的功能角色,确定其是否需要可访问标签或应向辅助技术隐藏。
  2. 准备 SVG 资产,移除硬编码的颜色属性,以实现通过 CSS 进行动态样式设置。
  3. 使用内联 SVG(用于关键路径元素)或符号精灵(用于重复资产)来实现图标。
  4. 根据 UI 上下文应用标准化的尺寸和描边粗细(例如,密集布局为 16px,主要操作为 24px)。
  5. 验证实现是否遵循 Openclaw Skills 关于性能和视觉一致性的最佳实践。

图标 配置指南

要开始使用这些图标模式,请确保您的环境支持 SVG 操作和 CSS 继承。您可以使用以下 CSS 模式设置基础图标组件:

.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: middle;
}

如果您使用的是库,请安装支持 tree-shakable 的集合以最小化包体积:

npm install lucide-react # 或您喜欢的基于 SVG 的图标库

图标 数据架构与分类体系

该技能通过结构化的属性和样式方法组织图标元数据和实现模式:

属性 上下文 影响
aria-hidden="true" 装饰性图标 防止屏幕阅读器朗读冗余信息
focusable="false" 所有 SVG 阻止 IE/Edge 创建额外的制表位
fill="currentColor" 路径/SVG 实现从父文本继承颜色
viewBox SVG 根 定义用于缩放的内部坐标系
name: Icons
description: Implement accessible icons with proper sizing, color inheritance, and performance.
metadata: {"clawdbot":{"emoji":"??","requires":{},"os":["linux","darwin","win32"]}}

SVG vs Icon Fonts

SVG is the modern standard:

  • Better accessibility (native ARIA support)
  • No flash of invisible/wrong icon (FOIT)
  • Multicolor support
  • Smaller bundles with tree-shaking

Only consider icon fonts for legacy IE11 support.

Accessibility Patterns

Decorative icons (next to visible text):


Informative icons (standalone, no label):





SVG with accessible name:


  Warning: system error
  

Key rules:

  • aria-hidden="true" on SVGs that duplicate visible text
  • focusable="false" prevents unwanted tab stops in IE/Edge
  • </CODE> must be first child inside <CODE><svg></CODE> for screen reader support</LI> <LI>IDs must be unique if multiple SVGs are inline</LI></UL> <H2 id=color-inheritance>Color Inheritance</H2><PRE><CODE class=language-svg><svg fill="currentColor"> <path d="..."/> </svg> </CODE></PRE> <P><CODE>currentColor</CODE> inherits from CSS <CODE>color</CODE> property. The icon changes color with hover states automatically:</P><PRE><CODE class=language-css>.button { color: blue; } .button:hover { color: red; } /* icon turns red too */ </CODE></PRE> <P>Remove hardcoded <CODE>fill="#000"</CODE> from SVGs before using currentColor.</P> <P>For stroke-based icons, use <CODE>stroke="currentColor"</CODE> instead.</P> <H2 id=sizing>Sizing</H2> <P>Standard grid sizes: 16, 20, 24, 32px</P> <P>Match stroke weight to size:</P> <DIV class=table-scroll-wrapper> <TABLE> <THEAD> <TR> <TH>Size</TH> <TH>Stroke</TH> <TH>Use case</TH></TR></THEAD> <TBODY> <TR> <TD>16px</TD> <TD>1px</TD> <TD>Dense layouts, small text</TD></TR> <TR> <TD>20px</TD> <TD>1.25px</TD> <TD>Default UI</TD></TR> <TR> <TD>24px</TD> <TD>1.5px</TD> <TD>Buttons, primary actions</TD></TR> <TR> <TD>32px</TD> <TD>2px</TD> <TD>Headers, navigation</TD></TR></TBODY></TABLE></DIV> <P>Touch targets need 44x44px minimum—icon can be smaller if tappable area is larger via padding.</P><PRE><CODE class=language-css>.icon-button { width: 24px; height: 24px; padding: 10px; /* Creates 44x44 touch target */ } </CODE></PRE> <H2 id=scaling-with-text>Scaling with Text</H2><PRE><CODE class=language-css>.icon { width: 1em; height: 1em; } </CODE></PRE> <P>Icon scales with surrounding text size automatically.</P> <H2 id=symbol-sprites>Symbol Sprites</H2> <P>For many repeated icons, reduce DOM nodes with sprites:</P><PRE><CODE class=language-html><!-- Define once, hidden --> <svg style="display:none"> <symbol id="icon-search" viewBox="0 0 24 24"> <path d="..."/> </symbol> <symbol id="icon-menu" viewBox="0 0 24 24"> <path d="..."/> </symbol> </svg> <!-- Use anywhere --> <svg aria-hidden="true"><use href="#icon-search"/></svg> </CODE></PRE> <P>External sprites (<CODE><use href="/icons.svg#search"/></CODE>) don't work in older Safari without polyfill.</P> <H2 id=performance>Performance</H2> <P>Benchmark (1000 icons):</P> <UL> <LI><CODE><img></CODE> with data URI: 67ms (fastest)</LI> <LI>Inline SVG optimized: 75ms</LI> <LI>Symbol sprite: 99ms</LI> <LI><CODE><img></CODE> external: 76ms</LI></UL> <P>Recommendations:</P> <UL> <LI>Tree-shake icon libraries (Lucide, Heroicons support this)</LI> <LI>Don't import entire Font Awesome (1MB+)—use subset or switch to SVG</LI> <LI>Inline critical icons, lazy-load sprite for non-critical</LI></UL> <H2 id=consistency>Consistency</H2> <UL> <LI>Stick to one icon set—mixing styles looks unprofessional</LI> <LI>Match icon stroke weight to your font weight (regular text = 1.5px stroke)</LI> <LI>Pick one style per context: outlined for inactive, filled for active</LI> <LI>Optical alignment differs from mathematical—circles reach edges, squares don't</LI> <LI>Name icons by appearance, not meaning: <CODE>stopwatch</CODE> not <CODE>speed</CODE></LI></UL> <H2 id=common-mistakes>Common Mistakes</H2> <UL> <LI>Missing <CODE>aria-hidden</CODE> on decorative icons—screen readers announce gibberish</LI> <LI>Mixing rounded and sharp icon styles in same interface</LI> <LI>Giant icon libraries for 10 icons—massive bundle bloat</LI> <LI>Icon-only buttons without accessible name—impossible to use with screen readers</LI> <LI>Hardcoded colors preventing theme switching</LI> <LI>Stroke width not scaling with icon size—16px icon with 2px stroke looks heavy</LI></UL> </div> <div class="lastanext flexRow"> <a class="lastart flexRow" href="/wz/335228.html" ><span>上一篇:</span><span>Consortium AI 创建账户:安全钱包配置 - Openclaw Skills</span></a> <a class="nextart flexRow" href="/wz/335230.html" ><span>下一篇:</span><span>Zotero Scholar:自动化处理学术研究论文管理 - Openclaw Skills</span></a> </div> </div> <div class="dtl-xgtj"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>相关推荐</p></div> </div> <div class="tjlist flexRow"> <div class="tj-item "> <div class="tjitemd"> <div class="tjimd-top flexRow"> <a class="imdta flexRow" href="/wz/365045.html" > <img src="/jiaoben/image/noimg.png" > </a> <div class="imdt-right flexColumn"> <a class="imdtra flexRow overflowclass" href="/wz/365045.html" >本地AI实用派!OpenClaw 2026版实操指南,办公效率直接拉满</a> <a class="imdtrap flexRow overflowclass" href="/wz/365045.html" > OpenClaw 2026版是专为职场人与学生打造的本地AI智能体,零代码、一键部署,支持离线运行。聚焦文件整理、文档处理、数据汇总等高频场景,自然语言指令即可自动执行,全程数据不出设备,安全高效。实操指南直击下载报错、部署卡点、指令优化等痛点,3分钟上手,效率立升。 </a> </div> </div> <div class="tjimd-down flexRow"> <div class="imdd-tab flexRow"> <p class="imddt-time flexRow"><b></b><span>2026-04-16</span></p> </div> <a href="/wz/365045.html" class="imdd-more flexRow flexcenter" >立即查看</a> </div> </div> </div> <div class="tj-item "> <div class="tjitemd"> <div class="tjimd-top flexRow"> <a class="imdta flexRow" href="/wz/365044.html" > <img src="/jiaoben/image/noimg.png" > </a> <div class="imdt-right flexColumn"> <a class="imdtra flexRow overflowclass" href="/wz/365044.html" >OpenClaw 2026 版本升级解析</a> <a class="imdtrap flexRow overflowclass" href="/wz/365044.html" > OpenClaw 2026版(v2.60+)重磅升级:Windows一键零代码部署、多Agent协同任务处理、深度适配阿里云生态。本指南详解安装避坑要点、标准化部署流程及高频报错解决方案,助开发者3分钟快速启用AI智能体。(239字) </a> </div> </div> <div class="tjimd-down flexRow"> <div class="imdd-tab flexRow"> <p class="imddt-time flexRow"><b></b><span>2026-04-16</span></p> </div> <a href="/wz/365044.html" class="imdd-more flexRow flexcenter" >立即查看</a> </div> </div> </div> <div class="tj-item "> <div class="tjitemd"> <div class="tjimd-top flexRow"> <a class="imdta flexRow" href="/wz/365043.html" > <img src="/jiaoben/image/noimg.png" > </a> <div class="imdt-right flexColumn"> <a class="imdtra flexRow overflowclass" href="/wz/365043.html" >OpenClaw(小龙虾)Windows 11</a> <a class="imdtrap flexRow overflowclass" href="/wz/365043.html" > OpenClaw(小龙虾)是开源本地AI智能体,支持电脑控制、文件整理、浏览器操作等自动化任务,纯离线运行,隐私安全。本教程专为Win11优化,零代码、免配置,解压即用,一键解决拦截、权限、路径等问题。(239字) </a> </div> </div> <div class="tjimd-down flexRow"> <div class="imdd-tab flexRow"> <p class="imddt-time flexRow"><b></b><span>2026-04-16</span></p> </div> <a href="/wz/365043.html" class="imdd-more flexRow flexcenter" >立即查看</a> </div> </div> </div> <div class="tj-item "> <div class="tjitemd"> <div class="tjimd-top flexRow"> <a class="imdta flexRow" href="/wz/365042.html" > <img src="/jiaoben/image/noimg.png" > </a> <div class="imdt-right flexColumn"> <a class="imdtra flexRow overflowclass" href="/wz/365042.html" >2026最新版OpenClaw,Windows一键安装,高效不拖沓(包含新安装包)</a> <a class="imdtrap flexRow overflowclass" href="/wz/365042.html" > 2026最新版OpenClaw中文一键安装包,Windows双击即用!免代码、免命令、免配置,内置汉化与运行环境,自动适配全版本系统。本地运行更安全,支持文件整理、办公自动化等高频任务,新手3分钟极速部署。(239字) </a> </div> </div> <div class="tjimd-down flexRow"> <div class="imdd-tab flexRow"> <p class="imddt-time flexRow"><b></b><span>2026-04-16</span></p> </div> <a href="/wz/365042.html" class="imdd-more flexRow flexcenter" >立即查看</a> </div> </div> </div> </div> </div> </div> <div class="cd-right dtlcd-right"> <div class="dtl-ht"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>专题</p></div> </div> <div class="dtlht-list "> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-69351.html" >#数据可视化</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-69351.html" >数据可视化(Data Visu</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="69351" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-69342.html" >#自然语言处理</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-69342.html" >自然语言处理(Natural</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="69342" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-68363.html" >#Excel公式</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-68363.html" >Excel公式就是:用函数 +</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="68363" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-68355.html" >#Excel技巧</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-68355.html" >Excel是日常生活中必不可</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="68355" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-68081.html" >#蛋仔派对</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-68081.html" >蛋仔派对最新官方活动、关卡速</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="68081" >+ 收藏</p> </div> <div class="htl-item flexRow"> <div class="htmitem-left"> <div class="htiteml-top flexRow"> <a href="/wz/zt-68000.html" >#人工智能</a> <span></span> </div> <a class="htiteml-down flexRow" href="/wz/zt-68000.html" >人工智能(AI),简单说,就</a> </div> <p class="htmitem-right flexRow flexcenter gz" data-id="68000" >+ 收藏</p> </div> </div> </div> <div class=" dtl-zt"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>最新数据</p></div> </div> <div class="wkch-downs"> <div class="weekch-top flexRow"> <a class="wktpa flexRow" href="/wz/335235.html" > <img src="/jiaoben/image/noimg.png" > </a> <div class="wktpa-right flexColumn"> <a class="wktpara flexRow overflowclass" href="/wz/335235.html" >Google 搜索 Grounding:先进的 AI 搜索与引用 - Openclaw Skills</a> <a class="wktparp flexRow overflowclass" href="/wz/335235.html" > 什么是 Google 搜索 Gr </a> </div> </div> <div class="weekch-list"> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335234.html" class="weekcha flexRow flexcenter overflowclass" >注册营养师:精准饮食规划与宏量营养素优化 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335233.html" class="weekcha flexRow flexcenter overflowclass" >VPS 管理:安全配置虚拟服务器 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335232.html" class="weekcha flexRow flexcenter overflowclass" >多渠道参与代理:自主社交自动化 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335231.html" class="weekcha flexRow flexcenter overflowclass" >CMA-email:面向 AI 智能体的自动化 Gmail 集成 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335227.html" class="weekcha flexRow flexcenter overflowclass" >微博管理器:基于 Puppeteer 的安全微博自动化 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335226.html" class="weekcha flexRow flexcenter overflowclass" >CMO 内容营销:战略需求生成与品牌权威 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335225.html" class="weekcha flexRow flexcenter overflowclass" >阿里云 OSS 文件上传:为 Openclaw Skills 提供安全存储</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335224.html" class="weekcha flexRow flexcenter overflowclass" >Instapaper 导入:自动化阅读笔记提取 - Openclaw Skills</a> </div> <div class="weekch-con flexRow"> <div class="weekch-icon flexRow"><b></b></div> <a href="/wz/335223.html" class="weekcha flexRow flexcenter overflowclass" >多智能体角色设计:专业 AI 编排 - Openclaw Skills</a> </div> </div> </div> </div> <div class=" dtl-wz"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>相关文章</p></div> </div> <div class="blog-list"> <a href="/wz/361191.html" class="bloga flexRow over"><p class="overflowclass">CI 生成器:自动化 GitHub Actions 工作流 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361192.html" class="bloga flexRow over"><p class="overflowclass">Bundle Checker:AI 驱动的 JS 包体积优化 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361193.html" class="bloga flexRow over"><p class="overflowclass">AI 备份脚本生成器:自动执行数据库备份 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361195.html" class="bloga flexRow over"><p class="overflowclass">录用信生成器:专业招聘文档自动化 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361196.html" class="bloga flexRow over"><p class="overflowclass">MCP Hub 技能:连接 1200+ AI 代理工具 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361197.html" class="bloga flexRow over"><p class="overflowclass">HTML 幻灯片:构建交互式 reveal.js 演示文稿 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361198.html" class="bloga flexRow over"><p class="overflowclass">Doc Pipeline:文档工作流自动化 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361199.html" class="bloga flexRow over"><p class="overflowclass">批量转换:自动化多格式文档管线 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361201.html" class="bloga flexRow over"><p class="overflowclass">Soul World:AI 智能体社交模拟平台 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> <a href="/wz/361202.html" class="bloga flexRow over"><p class="overflowclass">agent-sims:社交 AI 智能体模拟平台 - Openclaw Skills</p><div class="blogtime"><span>04/</span>16</div></a> </div> </div> <div class="cdr-ai"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>AI精选 </p></div> <a class="jbtitle-more flexRow" href="/category/list_344_1.html" title=""><span>更多</span><b></b></a> </div> <div class="ai-list"> <div class="ail-top flexRow"> <a href="/wz/365002.html" title="" class="ailta "> <img src="https://images.jiaoben.net/uploads/20260416/logo_69e09258f3ecd1.png" > <p ><span>Strict Identity</span></p></a> <a href="/wz/365001.html" title="" class="ailta "> <img src="https://images.jiaoben.net/uploads/20260416/logo_69e0924e486491.jpg" > <p ><span>逼真的斜倚人像,带 Contr</span></p></a> </div> <div class="ail-down"> <a class="ali-con flexRow" href="/wz/365000.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">Sabrina Carpenter 舞台表演魅力提示</p> </a> <a class="ali-con flexRow" href="/wz/364999.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">电影级人像修复提示词</p> </a> <a class="ali-con flexRow" href="/wz/364998.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">金发女郎的镜面自拍</p> </a> <a class="ali-con flexRow" href="/wz/364997.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">悉尼·斯威尼 (Sydney Sweeney) 奢华衣橱镜面自拍</p> </a> <a class="ali-con flexRow" href="/wz/364987.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">奢华护肤品:香水瓶中的立体模型</p> </a> <a class="ali-con flexRow" href="/wz/364986.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">欧洲咖啡馆黄金时段肖像提示</p> </a> <a class="ali-con flexRow" href="/wz/364985.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">混凝土表面上的霓虹灯文字</p> </a> <a class="ali-con flexRow" href="/wz/364984.html" title=""> <div class="alicon-left flexRow"><span>精选</span></div> <p class="aliconp overflowclass">电影级写实人像,带微缩克隆体</p> </a> </div> </div> </div> <div class="cdr-blog"> <div class="jb-titles flexRow"> <div class="jbtle-left flexRow"><b></b><p>脚本推荐</p></div> </div> <div class="blog-list"> <a href="/wz/zt-49225.html" title="" class="bloga flexRow over"><p class="overflowclass">SeeDance 2.0 Video Creator专区</p></a> <a href="/wz/zt-49224.html" title="" class="bloga flexRow over"><p class="overflowclass">OpenClaw AI专区</p></a> <a href="/wz/zt-49223.html" title="" class="bloga flexRow over"><p class="overflowclass">cowork专区</p></a> <a href="/wz/zt-49222.html" title="" class="bloga flexRow over"><p class="overflowclass">claude code skills专区</p></a> </div> </div> </div> </div> </div> </div> </main> <script> $(function() { // “+ 收藏”按钮点击事件 $(document).on('click', '.htmitem-right, .ztop-right', function(e) { // 仅针对包含 “+ 收藏” 文字的按钮 if ($(this).text().indexOf('+ 收藏') === -1) return; e.preventDefault(); const id = $(this).data('id'); if (!id) { layer.msg('该项暂无有效ID,无法收藏'); return; } // 构造收藏 URL: 当前域名 + /wz/zt- + id + / const bookmarkUrl = window.location.origin + '/wz/zt-' + id + '.html'; // 获取收藏标题 (优先从同级元素获取话题名称,否则使用页面标题) let bookmarkTitle = $(this).closest('.htl-item, .zttopd').find('a:first, span.overflowclass').text().trim() || document.title; if (bookmarkTitle.startsWith('#')) bookmarkTitle = bookmarkTitle.substring(1); // 浏览器收藏逻辑 (带 Fallback) try { if (window.sidebar && window.sidebar.addPanel) { // Firefox < 23 window.sidebar.addPanel(bookmarkTitle, bookmarkUrl, ""); } else if (window.external && ('AddFavorite' in window.external)) { // IE window.external.AddFavorite(bookmarkUrl, bookmarkTitle); } else { // Chrome, Safari, Firefox 23+, etc. const isMac = /Mac/i.test(navigator.userAgent); const keyStr = isMac ? 'Command + D' : 'Ctrl + D'; layer.confirm('由于浏览器安全限制,请使用 <b>' + keyStr + '</b> 手动添加收藏。<br><br>收藏地址:<br><small>' + bookmarkUrl + '</small>', { title: '收藏提示', btn: ['复制链接', '知道了'], yes: function(index) { copyToClipboard(bookmarkUrl).then(() => { layer.msg('链接已复制,请手动添加到收藏夹'); }).catch(() => { layer.msg('复制失败,请手动选择复制'); }); layer.close(index); } }); } } catch (err) { layer.msg('收藏失败,请手动添加'); } }); // 兼容非 HTTPS 的复制函数 function copyToClipboard(text) { if (navigator.clipboard && window.isSecureContext) { return navigator.clipboard.writeText(text); } else { let textArea = document.createElement("textarea"); textArea.value = text; textArea.style.position = "fixed"; textArea.style.left = "-999999px"; textArea.style.top = "-999999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); return new Promise((res, rej) => { document.execCommand('copy') ? res() : rej(); textArea.remove(); }); } } }); </script> <footer> <div class="foot "> <div class="foot-top flexRow"> <div class="foot-left"> <div class="ftl-top flexRow"><span class="flexRow flexcenter">脚本</span>在线</div> <p class="ftl-down"> 智能赋能梦想,脚本构筑现实。我们致力于链接AI智能指令 与传统自动化,为您提供一站式、高效率的脚 本资产与生成 服务。 </p> </div> <div class="foot-right flexRow"> <div class="ftr-list flexColumn"> <p>核心板块</p> <span>AI脚本库</span> <span>自动化仓库</span> <span>脚本实验室</span> </div> <div class="ftr-list flexColumn"> <p>关于我们</p> <a href="/category/list_229_1.html" >最新游戏</a> <span>商务合作</span> <span>隐私政策</span> </div> <div class="ftr-list flexColumn"> <p>社区支持</p> <span >API文档</span> <a href="/category/list_334_1.html" >攻略资讯</a> <span>违规举报</span> </div> </div> </div> <div class="foot-down flexColumn"> <p>© 2026 jiaoben.net | 脚本在线 | 联系:jiaobennet2026@163.com</p> <p>备案:<a style="color: #7F7F7F;" href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">湘ICP备18025217号-11</a> </p> </div> </div> </footer> <div style="display:none;"> <script type="text/javascript"> var _paq = window._paq = window._paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//tongji.zhangwan.net/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '29']); // Add this code below within the Matomo JavaScript tracker code // Important: the tracker url includes the /matomo.php var secondaryTrackerUrl = u+'matomo.php'; var secondaryWebsiteId = 27; // Also send all of the tracking data to this other Matomo server, in website ID 77 _paq.push(['addTracker', secondaryTrackerUrl, secondaryWebsiteId]); // That's it! var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?5d3cfe1f36b1988029fe82a0d475b20d"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </div> </body> </html>