ambient-section-particles

Implements a bounded, visibility-aware canvas particle layer inside a single page section.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill ambient-section-particles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ambient-section-particles
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/ambient-section-particles
Command: npx skills add https://github.com/MengTo/Skills --skill ambient-section-particles

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Decorative particle effects often run as page-wide screensavers that obscure content, drain battery, and ignore accessibility settings. This Skill provides a disciplined pattern for adding a restrained particle atmosphere scoped to one section, with visibility pausing, responsive density, and reduced-motion fallbacks.

Core Features & Use Cases

  • Renderer Selection Guidance: Choose between canvas, DOM/SVG, or WebGL based on particle count, motion complexity, and branding needs.
  • Configurable Simulation: One configuration object controls count, gravity, wind, sway, speed, size, opacity, rotation, pointer disturbance radius, and end modes (recycle, exit, settle, static).
  • Performance & Accessibility Guardrails: IntersectionObserver and document visibility pausing, ResizeObserver with device-pixel-ratio caps, area-based density clamping, and prefers-reduced-motion static fallbacks.
  • Use Case: Add falling seed, snow, petal, or confetti particles behind a landing page hero that pause when scrolled out of view, respond gently to pointer movement, and render a static composition for reduced-motion users.

Quick Start

Use the ambient-section-particles skill to add a restrained, visibility-aware particle layer behind this section without competing with its content.

Frequently Asked Questions about ambient-section-particles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add falling particles to one section of a webpage?

Create a positioned section with a canvas layer behind the content, seed particles inside its bounds, and animate them with a single requestAnimationFrame loop applying gravity, wind, and sway. Use IntersectionObserver to start the loop only when the section is visible.

Canvas vs DOM vs WebGL for particle effects: which should I use?

Use canvas for roughly 40 or more small moving particles or pointer forces, DOM or inline SVG for a small count of branded fragments needing individual styling, and WebGL only for thousands of particles, depth, or shaders. Start with the least expensive renderer that preserves the desired shapes.

How do I pause canvas animations when the section is off-screen?

Use IntersectionObserver on the section to start the animation frame loop when it enters the viewport and cancel it when it exits. Also listen for document visibility changes so background tabs stop the loop, and resume from the current simulation state rather than spawning a second loop.

How do I make particle animations respect prefers-reduced-motion?

Under the prefers-reduced-motion: reduce media query, render a sparse deterministic static arrangement or remove the particle layer entirely instead of running a continuous loop. Keep particles decorative and hidden from assistive technology with aria-hidden.

Why does my particle animation stutter after switching browser tabs?

Large time deltas accumulate when requestAnimationFrame stalls in background tabs, causing particles to jump. Clamp the delta time per frame, for example to 0.034 seconds, and cancel the loop when document.hidden becomes true.

How many particles should a section animation use on mobile?

Derive the count from container area rather than viewport width, then clamp it with strict minimum and maximum limits for mobile and low-power devices. The demo scales density as width times height divided by a constant, capped between 28 and 76 particles.