Пружинные взаимодействия

Инерция и прерываемое движение.

Motionspringdragphysics

Когда использовать

Implement direct manipulation that preserves position and velocity.

Решения для реализации

  1. Use pointer capture and handle pointercancel, with a keyboard alternative.
  2. Use a damped spring for return motion; simple hover belongs in CSS.
  3. Integrate with elapsed seconds and clamp delta after tab suspension.
  4. Stop when settled, hidden or reduced motion is active.

Как проверить результат

  • Leaving the target does not lose the gesture.
  • New drag interrupts at the current position.
  • Reduced motion returns instantly.

Работающий пример

Потяни. Отпусти. Ещё раз.k 140 / damping 15

Файлы

SKILL.mdcomponents/demos.tsx
WEBCRAFT © 2026Оригинальные исходники и интерактивные примерыMIT License