Shake an element by mutating its inline CSS each rAF tick. One shake per instance — re-calling shake while one is active returns null. The returned dispose function (and natural timer expiry) restores every CSS key the shake touched.
Only the built-in SHAKE_TYPES (NORMAL, FAST) are supported today. Letting callers define their own would be a natural extension — impact pulses, slow rumble, directional jolts — since ShakeType is already public.
Start a shake of the given shakeType. Returns a dispose function that stops the shake early and restores every CSS key it touched, or null if a shake is already active on this instance. Auto-stops and restores when the timer reaches zero.
Shake an element by mutating its inline CSS each rAF tick. One shake per instance — re-calling shake while one is active returns
null. The returned dispose function (and natural timer expiry) restores every CSS key the shake touched.Only the built-in SHAKE_TYPES (
NORMAL,FAST) are supported today. Letting callers define their own would be a natural extension — impact pulses, slow rumble, directional jolts — since ShakeType is already public.