ambient-section-particles — скилл для Claude Code: частицы в секции
Скилл добавляет сдержанную атмосферу из частиц внутри одной секции страницы: лепестки, снег, искры, конфетти. Контент остаётся читаемым.
npx skills add MengTo/Skills --skill ambient-section-particles -a claude-codeЧто делает ambient-section-particles
Скилл помогает агенту собрать слой частиц, привязанный к одной секции, а не к целой странице. Формы, плотность, гравитация, ветер, покачивание, вращение и режим поведения задаются одним объектом конфигурации. Плотность считается от площади контейнера, а не от ширины окна, и ограничивается для мобильных устройств.
Внутри — правила выбора рендерера: canvas примерно от 40 мелких частиц, DOM или inline SVG для небольшого числа брендовых фрагментов, WebGL только для тысяч частиц и глубины. Слой ставится за контентом, получает pointer-events: none, а движение указателя слушается на самой секции. Есть режимы recycle, exit, settle и static, пауза по IntersectionObserver и при скрытой вкладке.
Для работы ничего дополнительно ставить не нужно, но скилл опирается на ResizeObserver и IntersectionObserver — в старых браузерах без них эффект не запустится. При prefers-reduced-motion: reduce слой либо становится разреженной статичной картинкой, либо убирается совсем. В репозитории есть рабочий пример demo/index.html и demo/PROMPT.md для пересборки.
Какие задачи решает
- добавить падающий снег в шапку лендинга
- сделать фон из лепестков за блоком с текстом
- настроить реакцию частиц на движение курсора
- поставить паузу анимации, когда секция вне экрана
- собрать статичную композицию для режима reduced motion
Примеры запросов агенту
- добавь ambient-section-particles в секцию с отзывами, лепестки, плотность небольшая
- настрой слой искр за заголовком героя, чтобы частицы реагировали на курсор
- сделай режим settle для конфетти в блоке с формой
Как установить ambient-section-particles
1Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill ambient-section-particles -a claude-code2Вручную: положить файлы
~/.claude/skills/ambient-section-particles/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/ambient-section-particles/
1Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill ambient-section-particles -a codex2Вручную: положить файлы
.agents/skills/ambient-section-particles/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill ambient-section-particles -a cursor2Вручную: положить файлы
.cursor/skills/ambient-section-particles/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install MengTo/Skills ambient-section-particles2Вручную: положить файлы
.github/skills/ambient-section-particles/SKILL.md1Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill ambient-section-particles -a gemini-cli2Командой платформы
gemini skills install https://github.com/MengTo/Skills --path agent-skills/web-design/ambient-section-particlesВручную: положить файлы
.devin/skills/ambient-section-particles/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill ambient-section-particles -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора148
Похожие
Рядом в теме «Фронтенд и UI»
Всё по теме «Фронтенд и UI» →Вопросы о ambient-section-particles
Как установить ambient-section-particles в Claude?
Выполните npx skills add MengTo/Skills --skill ambient-section-particles -a claude-code. После этого файл скилла появится по пути ~/.claude/skills/ambient-section-particles/SKILL.md.
Что делает ambient-section-particles?
Описывает агенту, как построить слой частиц внутри одной секции: конфигурацию, выбор рендерера, симуляцию, паузу при невидимости и откат для reduced motion.
Нужны ли дополнительные библиотеки?
Скилл не требует установки пакетов. Он опирается на ResizeObserver и IntersectionObserver, поэтому в браузерах без них анимация не запустится.
Исходный текст
SKILL.md · MIT
---
name: ambient-section-particles
description: 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.
---
# 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
```js
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
1. Give the section a positioning context and clip overflow when particles should remain bounded.
2. Place the particle surface behind content but above the background.
3. Set the layer to `pointer-events: none`; listen for pointer movement on the section.
4. Reserve a quiet content zone or lower density behind long text and controls.
5. 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 `requestAnimationFrame` loop for the whole layer.
- Resize with `ResizeObserver`; cap canvas backing resolution at `min(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](demo/index.html) as the working reference and [demo/PROMPT.md](demo/PROMPT.md) to recreate or remix it. Keep [REFERENCES.md](REFERENCES.md) as the links-only implementation source list.
© MengTo · MIT · MengTo/Skills