ambient-section-particles
What it does
This skill guides an AI agent in adding a light, bounded particle effect to part of a web page. It is for designers who want a mood, such as snow or petals, while keeping text easy to read.
When to use it
- ✓When a section needs a gentle mood effect like snow, leaves or sparks.
- ✓When you want particles that react slightly to the mouse without blocking clicks.
- ✓When the effect must stop on slow devices and for visitors who prefer reduced motion.
Skill link
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/ambient-section-particles/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Add a few soft falling petals to the header of my spring sale page, but keep the text clear.”
5 new skills a week. 1 minute to read.
How it works
The agent chooses a simple drawing method, sets a modest number of particles and places them behind the content. It pauses the effect when it cannot be seen and provides a still version for reduced-motion visitors.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Ambient Section Particles
Build particles as a bounded atmosphere layer, not as a page-wide screensaver. Keep the content primary and stop work when the effect cannot be seen.
Choose the renderer
- Use canvas for roughly 40 or more small particles, frequent motion, pointer forces, or simple procedural shapes.
- Use DOM or inline SVG for a small count of branded fragments that need individual styling or semantic labels.
- Use WebGL only for thousands of particles, depth, shaders, or real 3D behavior. Cap device pixel ratio and provide a static fallback.
Start with the least expensive renderer that preserves the desired shape language.
Define one configuration
const particles = {
count: 54,
gravity: 7,
wind: -3,
sway: 16,
speed: [8, 18],
size: [4, 12],
opacity: [0.18, 0.62],
rotation: [-0.8, 0.8],
mode: "recycle",
pointerRadius: 110,
maxDpr: 2
};
Scale density by container area, then clamp it for mobile and low-power devices. Do not derive count from viewport width alone.
Layer the section
- Give the section a positioning context and clip overflow when particles should remain bounded.
- Place the particle surface behind content but above the background.
- Set the layer to
pointer-events: none; listen for pointer movement on the section. - Reserve a quiet content zone or lower density behind long text and controls.
- Keep controls and links in normal DOM stacking with visible focus.
Run the simulation
- Seed particles inside or just above the container bounds.
- Update gravity, wind, phase-based sway, rotation, opacity, and position from elapsed time.
- Clamp large time deltas after background tabs or stalled frames.
- Use one
requestAnimationFrameloop for the whole layer. - Resize with
ResizeObserver; cap canvas backing resolution atmin(devicePixelRatio, maxDpr). - For pointer disturbance, apply a small distance-based force and let particles settle back naturally. Never attach a listener per particle.
Support explicit end modes:
recycle: return particles above the section after exit.exit: remove particles after they leave the bounds.settle: resolve into a shallow visual pile with a strict height cap.static: render a deterministic still composition.
Stop invisible work
Use IntersectionObserver to start only when the section is visible. Cancel animation frames when it exits or document.hidden becomes true. Resume from the current simulation state instead of spawning a second loop.
On teardown, disconnect observers, remove resize and pointer listeners, cancel the frame, and release renderer resources.
Respect the reader
- Under
prefers-reduced-motion: reduce, render a sparse static arrangement or remove the layer. - Keep particles decorative and hidden from assistive technology.
- Control opacity and contrast so motion never crosses the legibility threshold.
- Avoid full-screen pointer repulsion, rapid direction changes, flashes, and large objects crossing form controls.
- Pause decorative motion while a modal or critical task in the section is active when it competes for attention.
Verify
Test entry and exit pausing, background-tab recovery, fast resize, 390/768/1440 widths, device pixel ratio, pointer and touch input, reduced motion, section overflow, content focus, long text, route cleanup, and console errors. Confirm only one animation loop survives repeated mounts.
Use demo/index.html as the working reference and demo/PROMPT.md to recreate or remix it. Keep REFERENCES.md as the links-only implementation source list.
FAQ
Will the particles block buttons?
No. The skill sets the layer so pointer events pass through it, and asks for quiet zones behind long text.
How many particles are used?
The count scales with the area of the section and is capped for phones and low-power devices.
Can I use my brand shapes?
Yes. The skill allows shapes such as icons or brand fragments, as long as they support the section's mood.
Details
Original description by the author
Add a restrained particle atmosphere inside one section with configurable shapes, density, gravity, wind, sway, rotation, recycling or settling, pointer disturbance, visibility pausing, responsive limits, and reduced-motion fallbacks. Use for petals, leaves, snow, sparks, confetti, dots, paper, icons, or brand fragments that support a section's mood without obscuring content.
repo: MengTo/Skills
Popularity
- GitHub stars
- 7.2k
- Ranking position
- #13395
- License
- MIT
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
3d-cloth-material
7.2kHelps your agent build realistic woven fabric in Three.js, with thread weave, soft sheen, natural folds, hems and seams.
3d-falling-leaves
7.2kHelps your agent add realistic falling leaves to a 3D scene, with leaves that tumble, drift with the wind and recycle as the camera moves.
3d-four-seasons
7.2kHelps your agent add spring, summer, fall and winter looks to a 3D scene, changing foliage, light, sky and snow without rebuilding it.
3d-high-poly-models
7.2kHelps your agent build detailed 3D models with smooth shapes and believable edges, then prepare lighter versions that run well on the web.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.