perf: speed up bead animations for fast abacus calculations
- Replace slow config.gentle with fast, snappy animation config - Use tension: 400, friction: 30, mass: 0.8 for quick bead movement - Apply fast animation to both position changes and drag snap-back - Maintains smooth animation while enabling rapid abacus work - Reflects the speed-focused nature of abacus as a calculation tool 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
97690d6b59
commit
1303c930f2
|
|
@ -259,7 +259,7 @@ const Bead: React.FC<BeadProps> = ({
|
|||
api.start({ x: x + mx, y: y + my, immediate: true });
|
||||
onDrag?.({ x: mx, y: my });
|
||||
} else {
|
||||
api.start({ x, y });
|
||||
api.start({ x, y, config: { tension: 400, friction: 30, mass: 0.8 } }); // Fast snap-back
|
||||
}
|
||||
},
|
||||
{ enabled: draggable }
|
||||
|
|
@ -267,7 +267,7 @@ const Bead: React.FC<BeadProps> = ({
|
|||
|
||||
React.useEffect(() => {
|
||||
if (enableAnimation) {
|
||||
api.start({ x, y, config: config.gentle });
|
||||
api.start({ x, y, config: { tension: 400, friction: 30, mass: 0.8 } }); // Fast, snappy abacus animation
|
||||
} else {
|
||||
api.set({ x, y });
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue