home / skills / harborgrid-justin / lexiflow-premium / drag-and-drop-physics-engine
/frontend/.github-skills/drag-and-drop-physics-engine
This skill enables fluid drag-and-drop with physics-based animations, tracking pointer events, collisions, and spring-like reordering for responsive UIs.
npx playbooks add skill harborgrid-justin/lexiflow-premium --skill drag-and-drop-physics-engineReview the files below or copy the command above to add this skill to your agents.
---
name: drag-and-drop-physics-engine
description: Implement fluid drag-and-drop interactions with physics-based animations.
---
# Drag-and-Drop Physics Engine
## Summary
Implement fluid drag-and-drop interactions with physics-based animations.
## Key Capabilities
- Track pointer events.
- Calculate layout collisions.
- Animate reordering with springs.
## PhD-Level Challenges
- Optimize collision detection.
- Handle nested scroll containers.
- Ensure accessibility.
## Acceptance Criteria
- Create a sortable list.
- Demonstrate fluid animations.
- Support keyboard sorting.
This skill implements fluid drag-and-drop interactions with physics-based animations for web interfaces. It provides pointer tracking, collision-aware layout updates, and spring-driven reordering so list items move naturally. The implementation also targets keyboard accessibility and supports nested scroll contexts for robust behavior.
The engine listens to pointer and keyboard events to pick up items and track movement. It computes collision regions against sibling elements and predicts target positions. Reordering and release animations use spring physics for smooth transitions and momentum. Edge cases include nested scrolling containers, layout shifts, and accessibility focus management.
Does this support keyboard sorting?
Yes. Keyboard events move focus and swap items, and release triggers the same spring animations as pointer interactions.
How does it handle nested scroll containers?
The engine detects scrollable ancestors and translates pointer coordinates to local plane coordinates, applying overscroll prevention and container-specific auto-scroll behavior.