DOM disintegrate effect: spark motion default + trademark-safe rename - #155
Open
mkayander wants to merge 21 commits into
Open
DOM disintegrate effect: spark motion default + trademark-safe rename#155mkayander wants to merge 21 commits into
mkayander wants to merge 21 commits into
Conversation
Introduce particleMotionMode with splat (radial burst) and windy (flow-field turbulence) physics. Windy mode uses Perlin-style noise to steer particles along curved gust paths, with lighter gravity and stronger horizontal carry. Defaults to windy; splat remains available via particleMotionMode: "splat".
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Replace horizontal flow-field gusts with upward spark launch, high-frequency flutter, decaying buoyancy lift, and a gravity arc. Sparks fade faster and wobble more like embers than wind-blown dust.
- Remove 80-line windTurbulence.ts (Perlin only contributed tiny drift) - Add sparkFlutter.ts and sparkParticlePhysics.ts with clear naming - Centralize motion profiles and spark constants - Fix getParticleRevealMargin double-resolve - Drop noise implementation-detail test
Require agents to implement important and medium fixes, and always remove dead or duplicated code in the same session. Document severity tiers, workflow, and output format. Cross-link from AGENTS.md and .cursorrules.
Move .cursor/commands/deep-code-review.md to .cursor/skills/deep-code-review/SKILL.md with disable-model-invocation. Update AGENTS.md and .cursorrules cross-links. Project rules stay as always-on .mdc files.
Add trigger-rich description, workflow checklist, severity table, output template, and concrete example. Tighten prose per skill authoring best practices.
Remove disable-model-invocation so agents auto-apply fix-in-place review rules when users ask to review changes, diffs, or PRs — not only on explicit /deep-code-review. Expand description triggers.
Replace thanosDisintegrate module, types, hooks, and docs with domDisintegrate naming. Planned public package: @dstruct/dom-disintegrate. All 67 effect tests pass.
- Retune flutter to slower sine waves keyed on time since release - Boost lateral sway, reduce drag, extend buoyancy/fade, stronger launch - Extract createTestDisintegrateParticle; fix padding double-resolve - Fix stale turbulenceSeed comment; drop legacy .cursor/commands note
- Steer lateral velocity along a high-frequency sine for visible zig-zag legs - Extend fade duration and buoyancy for longer flight before disappearing - Widen canvas padding to account for zig-zag lateral extent
Replace synchronized sine steering with position-based turbulence: per-particle frequency/phase/influence, vertical-travel-proportional sway, and scattered launch velocities from spawn position.
- Remove gravity and decaying buoyancy from windy mode - Apply constant per-particle lift plus shared global wind acceleration - Align launch velocity with wind drift (up-right when wind blows right) - Clamp downward velocity; turbulence affects lateral motion only
- Share hashSparkSeed01 between spark physics and turbulence - Prewarm chunk mask worker during idle capture for chunks mode - Clarify windy vs splat option docs; fix duplicate JSDoc typo - Update deep-code-review skill example
Detect device pressure from hardware concurrency, device memory, coarse pointer, and prefers-reduced-motion. Apply tier-based particleStep, maxDuration, and maxChunkMaskSteps when resolving options with a target element. Bump particle stride further when the surface grid exceeds per-tier cell budgets.
Do not downgrade tier for coarse pointer alone; score only CPU and memory. High tier skips surface particle-step bumping so modern mobile gets the same visual settings as desktop.
- Use windy-specific travel bounds for canvas padding (~35% smaller buffer) - Dirty-region canvas clears instead of full padded surface each frame - Cache spark turbulence profile and lift factor on particles at spawn - Skip physics for faded particles; pass resolved options into stepParticles - Radial masks via CSS variables with radii write deduplication - Skip redundant chunk mask DOM updates when frame index is unchanged - Rely on scroll/resize listeners for overlay sync instead of every rAF
mkayander
marked this pull request as ready for review
August 2, 2026 19:48
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
…pled capture - Prebuild chunk mask sequences during idle warm-up for chunks mode - Reuse warm masks at dismiss when strategy matches (centerOut) - Track active released particles to skip dead/unreleased in step/draw - Use setTransform instead of save/restore per particle when rotating - Downsample canvas before getImageData (~9x fewer pixels at step 3)
Use identical starting state and only vary turbulence seed/profile so random launch velocities cannot make the separation threshold flaky.
Prefer the original radial burst over windy sparks for the banner disintegrate animation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Performance optimizations
Animation loop (prior commit + this one)
Capture & warm-up (this commit)
Cookie banner uses
maskMode: "radial"so chunk warm-up does not apply there, but downsampled capture and active-particle tracking do.Testing
pnpm exec vitest run src/shared/ui/effects/domDisintegrate/__tests__— 87 testspnpm lint