add-shader-cursor-trail
它能做什么
这个技能指导 AI 智能体为网页添加着色器效果,光标经过时会留下柔和的点状拖尾。适合希望打造醒目的交互式首屏,并为其他访客提供简单备用方案的设计师和开发者。
适用场景
- ✓你想在首屏上添加一道跟随光标的网点拖尾的时候。
- ✓页面需要 WebGPU 着色器效果,并在手机和减少动态效果的用户端保持关闭的时候。
- ✓你想在不改变板块文字或图片的前提下添加效果的时候。
技能链接
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/add-shader-cursor-trail/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我的首屏添加网点光标拖尾效果,并为手机提供一张静态图片。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会安装着色器包,并在页面内容后方放置一个全宽的效果层。它只会在具备能力的桌面浏览器上加载该效果,并在板块离开屏幕时暂停。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Add Shader Cursor Trail
Implement the exact trail as progressive enhancement. Preserve the host section's semantic content, imagery, controls, and static first frame.
Workflow
- Inspect the framework, rendering mode, existing motion stack, layer order, reduced-motion rules, and package manager. Do not add another smooth-scroll engine or replace the section's content.
- Install
shaderswith the existing package manager. Import from the matching framework subpath:shaders/react,shaders/vue,shaders/svelte, orshaders/solid. - Read references/implementation.md before implementation. Keep the six shader nodes, their order, both invisible drivers, and both ID linkages exact.
- For React or Next.js, copy and adapt the files in
assets/react/. Keep the lightweight capability gate separate from the heavy shader module so ineligible visitors do not request the shader bundle. - Place one full-bleed,
aria-hidden="true"shader layer behind the section content. Keep links and controls above it. Do not setpointer-events: noneon the canvas unless cursor tracking is verified to use global events. - Gate loading on WebGPU, a fine hover pointer, normal motion/transparency preferences, document visibility, window focus, and section intersection. Unmount when the section leaves view so GPU work stops.
- Keep the original image or dark background as the complete fallback. Hide the layer for reduced motion, reduced transparency, coarse/no-hover pointers, and forced colors.
- Adapt only presentation variables such as opacity and blend mode. Do not change the graph to decorative noise, add WebGL/Three.js, or hotlink Shaders preview assets.
Validate
Run the project's lint, typecheck/tests, and production build. For React implementations, also run:
node /path/to/add-shader-cursor-trail/scripts/verify-cursor-trail.mjs \
path/to/CursorTrailShader.tsx \
path/to/CursorTrailGate.tsx \
path/to/cursor-trail.css
Verify the static section with JavaScript unavailable, keyboard access to content above the layer, touch behavior, reduced motion, unsupported WebGPU, focus/visibility cleanup, and absence of runtime requests to previews.shaders.com or data.shaders.com.
Report the chosen blend mode, fallback, capability gates, production-build result, and any browser limitation. Do not claim WebGPU visual verification unless it was actually performed in a compatible browser.
常见问题
手机访客会看到什么?
对于触屏设备和偏好较少动态的访客,技能会保留原始的静态图片或第一帧。
它会拖慢页面吗?
技能只在需要时加载着色器,并在板块离开屏幕时将其停止。
它能在所有浏览器中工作吗?
不能。它依赖 WebGPU 支持,因此技能为不支持的浏览器提供了备用方案。
详情
作者的原始描述
Add the Shaders WebGPU mouse effect used for the Tidal Commons hero: a white twinkling halftone cursor trail driven by ChromaFlow, masked through a DotGrid, finished with chromatic ripples and film grain, and protected by static, touch, accessibility, SSR, and performance fallbacks. Use when a user asks for this shader mouse effect, a halftone cursor trail, an interactive WebGPU hero/contact background, or a reusable cursor-following shader layer in React, Next.js, Vue, Svelte, Solid, or plain web projects.
repo: MengTo/Skills
热度
- GitHub 星标
- 7.2k
- 排名
- #13393
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
3d-cloth-material
7.2k帮你的智能体在 Three.js 中制作逼真的编织织物,包括纱线编织纹理、柔和光泽、自然褶皱、下摆和缝线。
3d-falling-leaves
7.2k帮你的智能体在 3D 场景中添加逼真的飘落树叶,树叶会翻滚、随风飘动,并在镜头移动时循环利用。
3d-four-seasons
7.2k帮你的智能体为 3D 场景添加春夏秋冬四季效果,无需重建场景即可改变植被、光线、天空和积雪。
3d-high-poly-models
7.2k帮你的智能体构建形状平滑、边缘可信的精细 3D 模型,然后制作在网页上运行流畅的轻量版本。