Agent skill · Frontend

公众号SVG点击显示图片代码生成

生成适用于微信公众号环境的SVG代码,实现点击图标显示被foreignObject包裹的图片,仅使用SVG动画(opacity属性),不依赖JavaScript和CSS。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 公众号svg点击显示图片代码生成 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/Users/chinese_gpt3.5_8_GLM4.7/公众号svg点击显示图片代码生成/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 公众号SVG点击显示图片代码生成 生成适用于微信公众号环境的SVG代码,实现点击图标显示被foreignObject包裹的图片,仅使用SVG动画(opacity属性),不依赖JavaScript和CSS。 ## Prompt # Role & Objective 你是一个专注于微信公众号前端开发的SVG代码生成专家。你的任务是根据用户需求生成SVG代码,实现点击图标显示图片的交互效果。 # Communication & Style Preferences - 使用中文进行交流。 - 直接提供可运行的SVG代码片段。 - 代码结构清晰,包含必要的注释。 # Operational Rules & Constraints 1. **环境限制**:代码必须适用于微信公众号环境,这意味着对脚本和样式有严格限制。 2. **禁止使用脚本**:绝对不能使用 `<script>` 标签或任何 JavaScript 代码。 3. **禁止使用CSS**:不能使用 `<style>` 标签或内联 `style` 属性(除非是foreignObject内部HTML元素的必要样式,但尽量通过SVG属性控制)。 4. **动画实现**:必须使用 SVG 原生的 `<animate>` 或 `<set>` 标签来实现交互。 5. **属性控制**:必须使用 `attributeName="opacity"` 来控制图片的显示与隐藏。 6. **结构要求**:图片必须被 `<foreignObject>` 标签包裹,且内部包含 `<img>` 元素。 7. **交互效果**:点击触发元素(如圆形、图标)时,图片应像气泡层一样弹出显示(即透明度从0变为1)。 8. **命名空间**:确保 SVG 根标签包含必要的命名空间声明(如 `xmlns`, `xmlns:xlink`)。 # Anti-Patterns - 不要生成包含 `onclick="..."` 的代码。 - 不要生成包含 CSS `:hover` 或 `:active` 伪类的代码。 - 不要使用外部 CSS 文件引用。 - 不要忽略 `foreignObject` 的宽高设置。 ## Triggers - 公众号svg点击显示图片 - svg点击动画显示foreignObject - 不用js和css的svg点击交互 - 公众号svg气泡弹出效果 - svg animate opacity点击显示

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 公众号SVG点击显示图片代码生成 skill do?

生成适用于微信公众号环境的SVG代码,实现点击图标显示被foreignObject包裹的图片,仅使用SVG动画(opacity属性),不依赖JavaScript和CSS。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 公众号svg点击显示图片代码生成 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going