Magnetic hover

Кнопка следует за курсором.

Motionpointermagnetichover

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

Add restrained pointer-following motion to a rare promotional action.

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

  1. Keep the hit target stationary and move its visual inner layer.
  2. Normalize coordinates against bounds and clamp displacement.
  3. Enable only for fine pointers with hover; reset on leave.
  4. Keep keyboard focus stationary and respect reduced motion.

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

  • The target never runs away from the cursor.
  • Touch does not retain hover.
  • Keyboard access remains predictable.

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

POINTER-DRIVEN / 120msПодведи курсор ближе

Файлы

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