Motion
mapRange
Turns one number into another by lining up two ranges: a drag's offset into a tilt, a scroll into an opacity. Pair it with a live value in v-animate.
Maps a number from one range onto another. mapRange(x, [0, 300], [0, 1]) gives 0 at 0, 0.5 at 150 and 1 at 300. Past either end it holds the end value. Add points to bend the line: mapRange(x, [-300, 0, 300], [-20, 0, 20]). Use it with a live value in v-animate.
Install
import { mapRange } from 'vael-ui/motion'