Agent skill Web motion
Add Shader Cursor Trail
Create a visual effect for a web page or interactive component.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/add-shader-cursor-trail --skill add-shader-cursor-trail --agent claude-code --yesCheck this file in your project.claude/skills/add-shader-cursor-trail/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/add-shader-cursor-trail --skill add-shader-cursor-trailSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Bring an existing page and static artwork or background. The runtime uses the separate shaders package and needs a WebGPU-capable browser for the moving trail. The bundled verifier checks adapted React source files in Node.js.
View operation manualWhat this skill helps with
- Create a visual effect for a web page or interactive component.
Good for
- Interactive visual effects
- Publisher
- Meng To, with an implementation reference, React examples, and source verifier.
- Inputs
- Target section, framework, static fallback, and the foreground controls to preserve.
- Shader graph
- One Shader root, six layers in the published order, and two driver-to-mask links.
- Verification
- Run the React source verifier, then check visible motion and ineligible states in the browser.
- Skill name
add-shader-cursor-trail- Repository
MengTo/Skills
Keep the section usable while the effect loads
An effect with no lifecycle
Add a cursor canvas to my hero and make it run on every screen.
An always-mounted canvas can start work before it is needed, obstruct controls, and leave touch or reduced-motion users without a usable fallback.
A gated visual enhancement
- Keep the image and page controls in normal HTML.
- Load one shader behind the content only when the browser and preferences allow it.
- Inspect the effect and verify the fallback, keyboard path, and cleanup.
Add Shader Cursor Trail operation manual
Add the halftone trail to an existing React hero, or isolate why a previous integration shows the gradient without moving dots.
Keep the original image and controls in place while adding a cursor-driven layer on eligible desktop browsers.
Identify the host section and fallback
Check the framework and which layers need to stay above the effect before choosing a blend mode.
Prompt · Step 1Use Meng To’s installed add-shader-cursor-trail Skill to plan an enhancement to my existing React hero. Find the route, hero image or dark background, foreground text, and primary action. Read references/implementation.md and the files in assets/react. Draw the stacking order for the static background, aria-hidden shader layer, and controls. Choose screen blending as the first comparison for a photograph, or normal blending for a standalone dark surface. Explain which browser or preference conditions must preserve the static section. Keep this pass read-only.Preserve the layer order and capability checks
Use one shader root and keep ChromaFlow and DotGrid as invisible drivers with the published links.
Prompt · Step 2Use add-shader-cursor-trail to implement the approved hero treatment. Use the project’s package manager and shaders/react. Adapt the bundled CursorTrailGate.tsx, CursorTrailShader.tsx, and cursor-trail.css. Keep the six graph nodes in the reference order. Make trailFlow drive the trailDots dot-size map and use trailDots as the bright gradient mask. Keep both drivers invisible. Place one aria-hidden canvas layer below the real text and controls. Gate the heavy module on WebGPU, fine hover pointer, normal motion and transparency preferences, window focus, page visibility, and proximity to the viewport. Retain the CSS accessibility fallbacks and remove listeners and the observer on teardown. Preserve the existing primary action and return the local route.Verify the graph and the running hero
Run the bundled command from the installed Skill to check its templates. Use the same verifier with your three adapted source paths for the project check.
- The trail follows a fine pointer on an eligible browser.
- The original controls remain reachable by mouse and keyboard.
- The gate keeps ineligible visitors on the static section.
Prompt · Step 3Use add-shader-cursor-trail to verify the React integration. Run its installed verify-cursor-trail.mjs script with the three actual project paths for shader, gate, and CSS, in that order. Run the project’s production build and relevant checks. In a compatible browser sweep the pointer first over the photo and then near the main link. Confirm the trail and the link are both usable. In a fresh browser context check the static section before client initialization and with WebGPU unavailable, reduced motion, and a coarse pointer. Scroll beyond the observer margin or blur the window and verify that the shader unmounts. Report the graph result, browser and API availability, and any visual checks you could not run.node scripts/verify-cursor-trail.mjs assets/react/CursorTrailShader.tsx assets/react/CursorTrailGate.tsx assets/react/cursor-trail.css
Look up a cursor trail failure
Specify the affected route, browser, input method, and whether a canvas mounted.
There is a gradient but no dotsGraph
- Command or reference
trailFlow → trailDots → maskSource- Examples
- Compare the map source, alpha channel, and bright gradient mask against the bundled reference.
The effect stays running after scrolling awayLifecycle
- Command or reference
IntersectionObserver / visibility / blur- Examples
- Scroll outside the observer margin and check whether the router and capability gate release the shader.
The hero link loses mouse or keyboard accessLayering
- Command or reference
aria-hidden / isolation / z-index- Examples
- Keep the effect below the foreground content and test pointer tracking before changing canvas pointer-events.
Cursor trail troubleshooting
Does the Node verifier exercise WebGPU?
It inspects the React files for graph, gates, and cleanup. To verify the rendered trail, also open the app in a compatible WebGPU browser.
Why can I see the image without a canvas?
The static background stays in the HTML. The gate mounts a shader only on an eligible browser with a fine pointer, acceptable preferences, and a visible, focused page.
Can I adapt the effect to Vue or Svelte?
Use the framework-specific Shaders entry and preserve the same lazy gate and graph. The provided Node checker expects the bundled React file structure.