No description
Dragging a piece now follows the cursor with spring lag and a subtle tilt, scales up with a deeper shadow while lifted, and on a valid drop glides smoothly from the cursor-release position into the destination square. Invalid drops spring back to the origin. Dragging is disabled entirely for the non-playing side (no grab cursor, no transforms, no drag events). Cursor tracking uses a document-level `dragover` listener — the `drag` event on the source element is throttled by Chromium and reports 0/0 in Firefox, so is unusable for smooth tracking. Replaces motion`s `layoutId` FLIP with a manual implementation. Motion measures layout rects without inline transforms, so `layoutId` always animated from the source square instead of the cursor position. The new approach stashes the transformed `getBoundingClientRect` on dragend and consumes it from a `useLayoutEffect` at mount, jumping the spring to the delta and letting it animate home — producing a true release-to-target FLIP. |
||
|---|---|---|
| .github/workflows | ||
| .sisyphus | ||
| docs | ||
| packages | ||
| scripts | ||
| .gitignore | ||
| eslint.config.js | ||
| lefthook.yml | ||
| LICENSE | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.base.json | ||
| tsconfig.json | ||
| vitest.workspace.ts | ||
@paratype
A Doorenbos-style Rete II rules engine for TypeScript games, with an authoritative WebSocket chess demo.
Packages
packages/rete— Rete II engine corepackages/chess— Browser chess demo (React + Vite)packages/server— Authoritative Bun WebSocket server
Docs
- SPEC.md — Engine specification
- PHASES.md — Development phases & perf budgets
- RULES.md — Chess rule presets
- PROTOCOL.md — WebSocket message protocol
Getting Started
bun install && bun run check